searcher.html

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

HTML
978
字号
 <p>Applications should usually call <A HREF="../../../../org/apache/lucene/search/Searcher.html#search(org.apache.lucene.search.Query, org.apache.lucene.search.Filter, org.apache.lucene.search.Sort)"><CODE>search(Query,Filter,Sort)</CODE></A> instead.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/BooleanQuery.TooManyClauses.html" title="class in org.apache.lucene.search">BooleanQuery.TooManyClauses</A></CODE><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="search(org.apache.lucene.search.Query, org.apache.lucene.search.HitCollector)"><!-- --></A><H3>
search</H3>
<PRE>
public void <B>search</B>(<A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A>&nbsp;query,                   <A HREF="../../../../org/apache/lucene/search/HitCollector.html" title="class in org.apache.lucene.search">HitCollector</A>&nbsp;results)            throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Lower-level search API. <p><A HREF="../../../../org/apache/lucene/search/HitCollector.html#collect(int, float)"><CODE>HitCollector.collect(int,float)</CODE></A> is called for every non-zero scoring document. <p>Applications should only use this if they need <i>all</i> of the matching documents.  The high-level search API (<A HREF="../../../../org/apache/lucene/search/Searcher.html#search(org.apache.lucene.search.Query)"><CODE>search(Query)</CODE></A>) is usually more efficient, as it skips non-high-scoring hits. <p>Note: The <code>score</code> passed to this method is a raw score. In other words, the score will not necessarily be a float whose value is between 0 and 1.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/BooleanQuery.TooManyClauses.html" title="class in org.apache.lucene.search">BooleanQuery.TooManyClauses</A></CODE><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="search(org.apache.lucene.search.Query, org.apache.lucene.search.Filter, org.apache.lucene.search.HitCollector)"><!-- --></A><H3>
search</H3>
<PRE>
public void <B>search</B>(<A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A>&nbsp;query,                   <A HREF="../../../../org/apache/lucene/search/Filter.html" title="class in org.apache.lucene.search">Filter</A>&nbsp;filter,                   <A HREF="../../../../org/apache/lucene/search/HitCollector.html" title="class in org.apache.lucene.search">HitCollector</A>&nbsp;results)            throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Lower-level search API. <p><A HREF="../../../../org/apache/lucene/search/HitCollector.html#collect(int, float)"><CODE>HitCollector.collect(int,float)</CODE></A> is called for every non-zero scoring document. <br>HitCollector-based access to remote indexes is discouraged. <p>Applications should only use this if they need <i>all</i> of the matching documents.  The high-level search API (<A HREF="../../../../org/apache/lucene/search/Searcher.html#search(org.apache.lucene.search.Query)"><CODE>search(Query)</CODE></A>) is usually more efficient, as it skips non-high-scoring hits.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>query</CODE> - to match documents<DD><CODE>filter</CODE> - if non-null, a bitset used to eliminate some documents<DD><CODE>results</CODE> - to receive hits<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/BooleanQuery.TooManyClauses.html" title="class in org.apache.lucene.search">BooleanQuery.TooManyClauses</A></CODE><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="search(org.apache.lucene.search.Query, org.apache.lucene.search.Filter, int)"><!-- --></A><H3>
search</H3>
<PRE>
public <A HREF="../../../../org/apache/lucene/search/TopDocs.html" title="class in org.apache.lucene.search">TopDocs</A> <B>search</B>(<A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A>&nbsp;query,                      <A HREF="../../../../org/apache/lucene/search/Filter.html" title="class in org.apache.lucene.search">Filter</A>&nbsp;filter,                      int&nbsp;n)               throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Expert: Low-level search implementation.  Finds the top <code>n</code> hits for <code>query</code>, applying <code>filter</code> if non-null. <p>Called by <A HREF="../../../../org/apache/lucene/search/Hits.html" title="class in org.apache.lucene.search"><CODE>Hits</CODE></A>. <p>Applications should usually call <A HREF="../../../../org/apache/lucene/search/Searcher.html#search(org.apache.lucene.search.Query)"><CODE>search(Query)</CODE></A> or <A HREF="../../../../org/apache/lucene/search/Searcher.html#search(org.apache.lucene.search.Query, org.apache.lucene.search.Filter)"><CODE>search(Query,Filter)</CODE></A> instead.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/BooleanQuery.TooManyClauses.html" title="class in org.apache.lucene.search">BooleanQuery.TooManyClauses</A></CODE><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="explain(org.apache.lucene.search.Query, int)"><!-- --></A><H3>
explain</H3>
<PRE>
public <A HREF="../../../../org/apache/lucene/search/Explanation.html" title="class in org.apache.lucene.search">Explanation</A> <B>explain</B>(<A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A>&nbsp;query,                           int&nbsp;doc)                    throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Returns an Explanation that describes how <code>doc</code> scored against <code>query</code>. <p>This is intended to be used in developing Similarity implementations, and, for good performance, should not be displayed with every hit. Computing an explanation is as expensive as executing the query over the entire index.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="setSimilarity(org.apache.lucene.search.Similarity)"><!-- --></A><H3>
setSimilarity</H3>
<PRE>
public void <B>setSimilarity</B>(<A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A>&nbsp;similarity)</PRE>
<DL>
<DD>Expert: Set the Similarity implementation used by this Searcher.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/search/Similarity.html#setDefault(org.apache.lucene.search.Similarity)"><CODE>Similarity.setDefault(Similarity)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getSimilarity()"><!-- --></A><H3>
getSimilarity</H3>
<PRE>
public <A HREF="../../../../org/apache/lucene/search/Similarity.html" title="class in org.apache.lucene.search">Similarity</A> <B>getSimilarity</B>()</PRE>
<DL>
<DD>Expert: Return the Similarity implementation used by this Searcher. <p>This defaults to the current value of <A HREF="../../../../org/apache/lucene/search/Similarity.html#getDefault()"><CODE>Similarity.getDefault()</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="createWeight(org.apache.lucene.search.Query)"><!-- --></A><H3>
createWeight</H3>
<PRE>
protected <A HREF="../../../../org/apache/lucene/search/Weight.html" title="interface in org.apache.lucene.search">Weight</A> <B>createWeight</B>(<A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A>&nbsp;query)                       throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>creates a weight for <code>query</code>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>new weight<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="docFreqs(org.apache.lucene.index.Term[])"><!-- --></A><H3>
docFreqs</H3>
<PRE>
public int[] <B>docFreqs</B>(<A HREF="../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</A>[]&nbsp;terms)               throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../org/apache/lucene/search/Searchable.html" title="interface in org.apache.lucene.search">Searchable</A></CODE></B></DD>
<DD>Expert: For each term in the terms array, calculates the number of documents containing <code>term</code>. Returns an array with these document frequencies. Used to minimize number of remote calls.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Searchable.html#docFreqs(org.apache.lucene.index.Term[])">docFreqs</A></CODE> in interface <CODE><A HREF="../../../../org/apache/lucene/search/Searchable.html" title="interface in org.apache.lucene.search">Searchable</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="search(org.apache.lucene.search.Weight, org.apache.lucene.search.Filter, org.apache.lucene.search.HitCollector)"><!-- --></A><H3>
search</H3>
<PRE>
public abstract void <B>search</B>(<A HREF="../../../../org/apache/lucene/search/Weight.html" title="interface in org.apache.lucene.search">Weight</A>&nbsp;weight,                            <A HREF="../../../../org/apache/lucene/search/Filter.html" title="class in org.apache.lucene.search">Filter</A>&nbsp;filter,                            <A HREF="../../../../org/apache/lucene/search/HitCollector.html" title="class in org.apache.lucene.search">HitCollector</A>&nbsp;results)                     throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../org/apache/lucene/search/Searchable.html" title="interface in org.apache.lucene.search">Searchable</A></CODE></B></DD>
<DD>Lower-level search API. <p><A HREF="../../../../org/apache/lucene/search/HitCollector.html#collect(int, float)"><CODE>HitCollector.collect(int,float)</CODE></A> is called for every non-zero scoring document. <br>HitCollector-based access to remote indexes is discouraged. <p>Applications should only use this if they need <i>all</i> of the matching documents.  The high-level search API (<A HREF="../../../../org/apache/lucene/search/Searcher.html#search(org.apache.lucene.search.Query)"><CODE>search(Query)</CODE></A>) is usually more efficient, as it skips non-high-scoring hits.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Searchable.html#search(org.apache.lucene.search.Weight, org.apache.lucene.search.Filter, org.apache.lucene.search.HitCollector)">search</A></CODE> in interface <CODE><A HREF="../../../../org/apache/lucene/search/Searchable.html" title="interface in org.apache.lucene.search">Searchable</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>weight</CODE> - to match documents<DD><CODE>filter</CODE> - if non-null, a bitset used to eliminate some documents<DD><CODE>results</CODE> - to receive hits<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public abstract void <B>close</B>()                    throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../org/apache/lucene/search/Searchable.html" title="interface in org.apache.lucene.search">Searchable</A></CODE></B></DD>
<DD>Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects

⌨️ 快捷键说明

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