Methods Summary |
---|
public abstract void | close()
|
protected org.apache.lucene.search.Weight | createWeight(org.apache.lucene.search.Query query)creates a weight for query
return query.weight(this);
|
public abstract org.apache.lucene.document.Document | doc(int i)
|
public abstract int | docFreq(org.apache.lucene.index.Term term)
|
public int[] | docFreqs(org.apache.lucene.index.Term[] terms)
int[] result = new int[terms.length];
for (int i = 0; i < terms.length; i++) {
result[i] = docFreq(terms[i]);
}
return result;
|
public abstract org.apache.lucene.search.Explanation | explain(org.apache.lucene.search.Weight weight, int doc)
|
public org.apache.lucene.search.Explanation | explain(org.apache.lucene.search.Query query, int doc)Returns an Explanation that describes how doc scored against
query .
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.
return explain(createWeight(query), doc);
|
public org.apache.lucene.search.Similarity | getSimilarity()Expert: Return the Similarity implementation used by this Searcher.
This defaults to the current value of {@link Similarity#getDefault()}.
return this.similarity;
|
public abstract int | maxDoc()
|
public abstract org.apache.lucene.search.Query | rewrite(org.apache.lucene.search.Query query)
|
public final org.apache.lucene.search.Hits | search(org.apache.lucene.search.Query query)Returns the documents matching query .
return search(query, (Filter)null);
|
public abstract void | search(org.apache.lucene.search.Weight weight, org.apache.lucene.search.Filter filter, org.apache.lucene.search.HitCollector results)
|
public abstract org.apache.lucene.search.TopDocs | search(org.apache.lucene.search.Weight weight, org.apache.lucene.search.Filter filter, int n)
|
public org.apache.lucene.search.Hits | search(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter)Returns the documents matching query and
filter .
return new Hits(this, query, filter);
|
public abstract org.apache.lucene.search.TopFieldDocs | search(org.apache.lucene.search.Weight weight, org.apache.lucene.search.Filter filter, int n, org.apache.lucene.search.Sort sort)
|
public org.apache.lucene.search.Hits | search(org.apache.lucene.search.Query query, org.apache.lucene.search.Sort sort)Returns documents matching query sorted by
sort .
return new Hits(this, query, null, sort);
|
public org.apache.lucene.search.Hits | search(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, org.apache.lucene.search.Sort sort)Returns documents matching query and filter ,
sorted by sort .
return new Hits(this, query, filter, sort);
|
public org.apache.lucene.search.TopFieldDocs | search(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, int n, org.apache.lucene.search.Sort sort)Expert: Low-level search implementation with arbitrary sorting. Finds
the top n hits for query , applying
filter if non-null, and sorting the hits by the criteria in
sort .
Applications should usually call {@link
Searcher#search(Query,Filter,Sort)} instead.
return search(createWeight(query), filter, n, sort);
|
public void | search(org.apache.lucene.search.Query query, org.apache.lucene.search.HitCollector results)Lower-level search API.
{@link HitCollector#collect(int,float)} is called for every non-zero
scoring document.
Applications should only use this if they need all of the
matching documents. The high-level search API ({@link
Searcher#search(Query)}) is usually more efficient, as it skips
non-high-scoring hits.
Note: The score 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.
search(query, (Filter)null, results);
|
public void | search(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, org.apache.lucene.search.HitCollector results)Lower-level search API.
{@link HitCollector#collect(int,float)} is called for every non-zero
scoring document.
HitCollector-based access to remote indexes is discouraged.
Applications should only use this if they need all of the
matching documents. The high-level search API ({@link
Searcher#search(Query)}) is usually more efficient, as it skips
non-high-scoring hits.
search(createWeight(query), filter, results);
|
public org.apache.lucene.search.TopDocs | search(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, int n)Expert: Low-level search implementation. Finds the top n
hits for query , applying filter if non-null.
Called by {@link Hits}.
Applications should usually call {@link Searcher#search(Query)} or
{@link Searcher#search(Query,Filter)} instead.
return search(createWeight(query), filter, n);
|
public void | setSimilarity(org.apache.lucene.search.Similarity similarity)Expert: Set the Similarity implementation used by this Searcher.
this.similarity = similarity;
|