memoryindex.html

来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 577 行 · 第 1/3 页

HTML
577
字号
                     <A HREF="../../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A>&nbsp;analyzer)</PRE>
<DL>
<DD>Convenience method; Tokenizes the given field text and adds the resulting terms to the index; Equivalent to adding an indexed non-keyword Lucene <A HREF="../../../../../org/apache/lucene/document/Field.html" title="class in org.apache.lucene.document"><CODE>Field</CODE></A> that is <A HREF="../../../../../org/apache/lucene/document/Field.Index.html#TOKENIZED"><CODE>tokenized</CODE></A>, <A HREF="../../../../../org/apache/lucene/document/Field.Store.html#NO"><CODE>not stored</CODE></A>, <A HREF="../../../../../org/apache/lucene/document/Field.TermVector.html#WITH_POSITIONS"><CODE>termVectorStored with positions</CODE></A> (or <A HREF="../../../../../org/apache/lucene/document/Field.TermVector.html#WITH_POSITIONS"><CODE>termVectorStored with positions and offsets</CODE></A>),
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>fieldName</CODE> - a name to be associated with the text<DD><CODE>text</CODE> - the text to tokenize and index.<DD><CODE>analyzer</CODE> - the analyzer to use for tokenization</DL>
</DD>
</DL>
<HR>

<A NAME="keywordTokenStream(java.util.Collection)"><!-- --></A><H3>
keywordTokenStream</H3>
<PRE>
public <A HREF="../../../../../org/apache/lucene/analysis/TokenStream.html" title="class in org.apache.lucene.analysis">TokenStream</A> <B>keywordTokenStream</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&nbsp;keywords)</PRE>
<DL>
<DD>Convenience method; Creates and returns a token stream that generates a token for each keyword in the given collection, "as is", without any transforming text analysis. The resulting token stream can be fed into <A HREF="../../../../../org/apache/lucene/index/memory/MemoryIndex.html#addField(java.lang.String, org.apache.lucene.analysis.TokenStream)"><CODE>addField(String, TokenStream)</CODE></A>, perhaps wrapped into another <A HREF="../../../../../org/apache/lucene/analysis/TokenFilter.html" title="class in org.apache.lucene.analysis"><CODE>TokenFilter</CODE></A>, as desired.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>keywords</CODE> - the keywords to generate tokens for<DT><B>Returns:</B><DD>the corresponding token stream</DL>
</DD>
</DL>
<HR>

<A NAME="addField(java.lang.String, org.apache.lucene.analysis.TokenStream)"><!-- --></A><H3>
addField</H3>
<PRE>
public void <B>addField</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;fieldName,                     <A HREF="../../../../../org/apache/lucene/analysis/TokenStream.html" title="class in org.apache.lucene.analysis">TokenStream</A>&nbsp;stream)</PRE>
<DL>
<DD>Equivalent to <code>addField(fieldName, stream, 1.0f)</code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>fieldName</CODE> - a name to be associated with the text<DD><CODE>stream</CODE> - the token stream to retrieve tokens from</DL>
</DD>
</DL>
<HR>

<A NAME="addField(java.lang.String, org.apache.lucene.analysis.TokenStream, float)"><!-- --></A><H3>
addField</H3>
<PRE>
public void <B>addField</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;fieldName,                     <A HREF="../../../../../org/apache/lucene/analysis/TokenStream.html" title="class in org.apache.lucene.analysis">TokenStream</A>&nbsp;stream,                     float&nbsp;boost)</PRE>
<DL>
<DD>Iterates over the given token stream and adds the resulting terms to the index; Equivalent to adding a tokenized, indexed, termVectorStored, unstored, Lucene <A HREF="../../../../../org/apache/lucene/document/Field.html" title="class in org.apache.lucene.document"><CODE>Field</CODE></A>. Finally closes the token stream. Note that untokenized keywords can be added with this method via  <A HREF="../../../../../org/apache/lucene/index/memory/MemoryIndex.html#keywordTokenStream(java.util.Collection)"><CODE>keywordTokenStream(Collection)</CODE></A>, the Lucene contrib <code>KeywordTokenizer</code> or similar utilities.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>fieldName</CODE> - a name to be associated with the text<DD><CODE>stream</CODE> - the token stream to retrieve tokens from.<DD><CODE>boost</CODE> - the boost factor for hits for this field<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/lucene/document/AbstractField.html#setBoost(float)"><CODE>AbstractField.setBoost(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="createSearcher()"><!-- --></A><H3>
createSearcher</H3>
<PRE>
public <A HREF="../../../../../org/apache/lucene/search/IndexSearcher.html" title="class in org.apache.lucene.search">IndexSearcher</A> <B>createSearcher</B>()</PRE>
<DL>
<DD>Creates and returns a searcher that can be used to execute arbitrary Lucene queries and to collect the resulting query results as hits.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>a searcher</DL>
</DD>
</DL>
<HR>

<A NAME="search(org.apache.lucene.search.Query)"><!-- --></A><H3>
search</H3>
<PRE>
public float <B>search</B>(<A HREF="../../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A>&nbsp;query)</PRE>
<DL>
<DD>Convenience method that efficiently returns the relevance score by matching this index against the given Lucene query expression.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>query</CODE> - an arbitrary Lucene query to run against this index<DT><B>Returns:</B><DD>the relevance score of the matchmaking; A number in the range         [0.0 .. 1.0], with 0.0 indicating no match. The higher the number         the better the match.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/lucene/queryParser/QueryParser.html#parse(java.lang.String)"><CODE>QueryParser.parse(String)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getMemorySize()"><!-- --></A><H3>
getMemorySize</H3>
<PRE>
public int <B>getMemorySize</B>()</PRE>
<DL>
<DD>Returns a reasonable approximation of the main memory [bytes] consumed by this instance. Useful for smart memory sensititive caches/pools. Assumes fieldNames are interned, whereas tokenized terms are memory-overlaid.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the main memory consumption</DL>
</DD>
</DL>
<HR>

<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE>
<DL>
<DD>Returns a String representation of the index data for debugging purposes.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the string representation</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MemoryIndex.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/lucene/index/memory/AnalyzerUtil.html" title="class in org.apache.lucene.index.memory"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/lucene/index/memory/PatternAnalyzer.html" title="class in org.apache.lucene.index.memory"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MemoryIndex.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &copy; 2000-2007 Apache Software Foundation.  All Rights Reserved.
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?