C# Класс 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.

Наследование: Lucene.Net.Search.Searchable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void
Searcher ( ) : System

Приватные методы

Метод Описание
Close ( ) : void
InitBlock ( ) : void

Описание методов

CreateWeight() публичный Метод

creates a weight for query
public CreateWeight ( Query query ) : Weight
query Query
Результат Weight

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Dispose() защищенный абстрактный Метод

protected abstract Dispose ( bool disposing ) : void
disposing bool
Результат void

Doc() публичный абстрактный Метод

public abstract Doc ( int i ) : Lucene.Net.Documents.Document
i int
Результат Lucene.Net.Documents.Document

Doc() публичный абстрактный Метод

public abstract Doc ( int docid, FieldSelector fieldSelector ) : Lucene.Net.Documents.Document
docid int
fieldSelector FieldSelector
Результат Lucene.Net.Documents.Document

DocFreq() публичный абстрактный Метод

public abstract DocFreq ( Lucene.Net.Index.Term term ) : int
term Lucene.Net.Index.Term
Результат int

DocFreqs() публичный Метод

public DocFreqs ( Lucene.Net.Index.Term terms ) : int[]
terms Lucene.Net.Index.Term
Результат int[]

Explain() публичный Метод

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
Результат Explanation

Explain() публичный абстрактный Метод

public abstract Explain ( Weight weight, int doc ) : Explanation
weight Weight
doc int
Результат Explanation

Rewrite() публичный абстрактный Метод

public abstract Rewrite ( Query query ) : Query
query Query
Результат Query

Search() публичный Метод

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
Результат Lucene.Net.Search.TopDocs

Search() публичный Метод

Finds the top n hits for query.
public Search ( Query query, int n ) : Lucene.Net.Search.TopDocs
query Query
n int
Результат Lucene.Net.Search.TopDocs

Search() публичный абстрактный Метод

public abstract Search ( Weight weight, Filter filter, int n ) : Lucene.Net.Search.TopDocs
weight Weight
filter Filter
n int
Результат Lucene.Net.Search.TopDocs

Search() публичный Метод

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
Результат Lucene.Net.Search.TopFieldDocs

Search() публичный абстрактный Метод

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
Результат Lucene.Net.Search.TopFieldDocs

Search() публичный Метод

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
Результат void

Search() публичный Метод

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 ///
Результат void

Search() публичный абстрактный Метод

public abstract Search ( Weight weight, Filter filter, Collector results ) : void
weight Weight
filter Filter
results Collector
Результат void

Searcher() защищенный Метод

protected Searcher ( ) : System
Результат System