C# Class Lucene.Net.Search.Searcher

An abstract base class for search implementations. Implements the main search methods.

Note that you can only access Hits from a Searcher as long as it is not yet closed, otherwise an IOException will be thrown.

Inheritance: Lucene.Net.Search.Searchable
Afficher le fichier Open project: synhershko/lucene.net Class Usage Examples

Méthodes publiques

Méthode Description
CreateWeight ( Query query ) : Weight

creates a weight for query

Dispose ( ) : void
Doc ( int i ) : Lucene.Net.Documents.Document
Doc ( int docid, FieldSelector fieldSelector ) : Lucene.Net.Documents.Document
DocFreq ( Lucene.Net.Index.Term term ) : int
DocFreqs ( Lucene.Net.Index.Term terms ) : int[]
Explain ( Query query, int doc ) : Explanation

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.

Explain ( Weight weight, int doc ) : Explanation
Rewrite ( Query query ) : Query
Search ( Query query, Filter filter, int n ) : Lucene.Net.Search.TopDocs

Finds the top n hits for query, applying filter if non-null.

Search ( Query query, int n ) : Lucene.Net.Search.TopDocs

Finds the top n hits for query.

Search ( Weight weight, Filter filter, int n ) : Lucene.Net.Search.TopDocs
Search ( Query query, Filter filter, int n, Lucene.Net.Search.Sort sort ) : Lucene.Net.Search.TopFieldDocs

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.

NOTE: this does not compute scores by default; use IndexSearcher.SetDefaultFieldSortScoring(bool,bool) to enable scoring.

Search ( Weight weight, Filter filter, int n, Lucene.Net.Search.Sort sort ) : Lucene.Net.Search.TopFieldDocs
Search ( Query query, Collector results ) : void

Lower-level search API.

Collector.Collect(int) is called for every matching document.

Applications should only use this if they need all of the matching documents. The high-level search API (Searcher.Search(Query, int) ) 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 query, Filter filter, Collector results ) : void

Lower-level search API.

Collector.Collect(int) is called for every matching document.
Collector-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 (Searcher.Search(Query, Filter, int)) is usually more efficient, as it skips non-high-scoring hits.

Search ( Weight weight, Filter filter, Collector results ) : void

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void
Searcher ( ) : System

Private Methods

Méthode Description
Close ( ) : void
InitBlock ( ) : void

Method Details

CreateWeight() public méthode

creates a weight for query
public CreateWeight ( Query query ) : Weight
query Query
Résultat Weight

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected abstract méthode

protected abstract Dispose ( bool disposing ) : void
disposing bool
Résultat void

Doc() public abstract méthode

public abstract Doc ( int i ) : Lucene.Net.Documents.Document
i int
Résultat Lucene.Net.Documents.Document

Doc() public abstract méthode

public abstract Doc ( int docid, FieldSelector fieldSelector ) : Lucene.Net.Documents.Document
docid int
fieldSelector FieldSelector
Résultat Lucene.Net.Documents.Document

DocFreq() public abstract méthode

public abstract DocFreq ( Lucene.Net.Index.Term term ) : int
term Lucene.Net.Index.Term
Résultat int

DocFreqs() public méthode

public DocFreqs ( Lucene.Net.Index.Term terms ) : int[]
terms Lucene.Net.Index.Term
Résultat int[]

Explain() public méthode

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.

public Explain ( Query query, int doc ) : Explanation
query Query
doc int
Résultat Explanation

Explain() public abstract méthode

public abstract Explain ( Weight weight, int doc ) : Explanation
weight Weight
doc int
Résultat Explanation

Rewrite() public abstract méthode

public abstract Rewrite ( Query query ) : Query
query Query
Résultat Query

Search() public méthode

Finds the top n hits for query, applying filter if non-null.
public Search ( Query query, Filter filter, int n ) : Lucene.Net.Search.TopDocs
query Query
filter Filter
n int
Résultat Lucene.Net.Search.TopDocs

Search() public méthode

Finds the top n hits for query.
public Search ( Query query, int n ) : Lucene.Net.Search.TopDocs
query Query
n int
Résultat Lucene.Net.Search.TopDocs

Search() public abstract méthode

public abstract Search ( Weight weight, Filter filter, int n ) : Lucene.Net.Search.TopDocs
weight Weight
filter Filter
n int
Résultat Lucene.Net.Search.TopDocs

Search() public méthode

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.

NOTE: this does not compute scores by default; use IndexSearcher.SetDefaultFieldSortScoring(bool,bool) to enable scoring.

public Search ( Query query, Filter filter, int n, Lucene.Net.Search.Sort sort ) : Lucene.Net.Search.TopFieldDocs
query Query
filter Filter
n int
sort Lucene.Net.Search.Sort
Résultat Lucene.Net.Search.TopFieldDocs

Search() public abstract méthode

public abstract Search ( Weight weight, Filter filter, int n, Lucene.Net.Search.Sort sort ) : Lucene.Net.Search.TopFieldDocs
weight Weight
filter Filter
n int
sort Lucene.Net.Search.Sort
Résultat Lucene.Net.Search.TopFieldDocs

Search() public méthode

Lower-level search API.

Collector.Collect(int) is called for every matching document.

Applications should only use this if they need all of the matching documents. The high-level search API (Searcher.Search(Query, int) ) 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.

public Search ( Query query, Collector results ) : void
query Query
results Collector
Résultat void

Search() public méthode

Lower-level search API.

Collector.Collect(int) is called for every matching document.
Collector-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 (Searcher.Search(Query, Filter, int)) is usually more efficient, as it skips non-high-scoring hits.

public Search ( Query query, Filter filter, Collector results ) : void
query Query to match documents ///
filter Filter if non-null, used to permit documents to be collected. ///
results Collector to receive hits ///
Résultat void

Search() public abstract méthode

public abstract Search ( Weight weight, Filter filter, Collector results ) : void
weight Weight
filter Filter
results Collector
Résultat void

Searcher() protected méthode

protected Searcher ( ) : System
Résultat System