Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Classes | Public Member Functions | Protected Member Functions | Properties | List of all members
Lucene.Net.Search.MultiSearcher Class Reference

Implements search over a set of Searchables. More...

Inherits Lucene.Net.Search.Searcher.

Inherited by Lucene.Net.Search.ParallelMultiSearcher.

Public Member Functions

 MultiSearcher (params Searchable[] searchables)
 Creates a searcher which searches searchers.
 
virtual Searchable[] GetSearchables ()
 Return the array of Searchables this searches.
 
override int DocFreq (Term term)
 Expert: Returns the number of documents containing term. Called by search code to compute term weights.
 
override Document Doc (int n)
 Expert: Returns the stored fields of document i.
 
override Document Doc (int n, FieldSelector fieldSelector)
 Get the Lucene.Net.Documents.Documentat the nth position. The Lucene.Net.Documents.FieldSelector may be used to determine what Lucene.Net.Documents.Fields to load and how they should be loaded.
 
virtual int SubSearcher (int n)
 Returns index of the searcher for document n in the array used to construct this searcher.
 
virtual int SubDoc (int n)
 Returns the document number of document n within its sub-index.
 
override TopDocs Search (Weight weight, Filter filter, int nDocs)
 Expert: Low-level search implementation. Finds the top n hits for query, applying filter if non-null.
 
override TopFieldDocs Search (Weight weight, Filter filter, int n, Sort sort)
 inheritdoc />
 
override void Search (Weight weight, Filter filter, Collector collector)
 Lower-level search API.
 
override Query Rewrite (Query original)
 Expert: called to re-write queries into primitive queries.
 
override Explanation Explain (Weight weight, int doc)
 Expert: low-level implementation method Returns an Explanation that describes how doc scored against weight.
 
override Weight CreateWeight (Query original)
 Create weight in multiple index scenario.
 
- Public Member Functions inherited from Lucene.Net.Search.Searcher
virtual TopFieldDocs Search (Query query, Filter filter, int n, Sort sort)
 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.
 
virtual void Search (Query query, Collector results)
 Lower-level search API.
 
virtual void Search (Query query, Filter filter, Collector results)
 Lower-level search API.
 
virtual TopDocs Search (Query query, Filter filter, int n)
 Finds the top n hits for query, applying filter if non-null.
 
virtual TopDocs Search (Query query, int n)
 Finds the top n hits for query.
 
virtual Explanation Explain (Query query, int doc)
 Returns an Explanation that describes how doc scored against query.
 
virtual int[] DocFreqs (Term[] terms)
 Expert: For each term in the terms array, calculates the number of documents containing term. Returns an array with these document frequencies. Used to minimize number of remote calls.
 
void Close ()
 Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects that reference this searchable
 
void Dispose ()
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from Lucene.Net.Search.Searcher
 Searcher ()
 

Properties

override int MaxDoc [get]
 
- Properties inherited from Lucene.Net.Search.Searcher
virtual Similarity Similarity [get, set]
 Expert: Gets or Sets the Similarity implementation used by this Searcher.
 
abstract int MaxDoc [get]
 
- Properties inherited from Lucene.Net.Search.Searchable
int MaxDoc [get]
 Expert: Returns one greater than the largest possible document number. Called by search code to compute term weights.
 

Detailed Description

Implements search over a set of Searchables.

Applications usually need only call the inherited Searcher.Search(Query, int) or Searcher.Search(Query,Filter, int) methods.

Definition at line 38 of file MultiSearcher.cs.

Constructor & Destructor Documentation

Lucene.Net.Search.MultiSearcher.MultiSearcher ( params Searchable[]  searchables)

Creates a searcher which searches searchers.

Definition at line 180 of file MultiSearcher.cs.

Member Function Documentation

override Weight Lucene.Net.Search.MultiSearcher.CreateWeight ( Query  original)
virtual

Create weight in multiple index scenario.

Distributed query processing is done in the following steps:

  1. rewrite query
  2. extract necessary terms
  3. collect dfs for these terms from the Searchables
  4. create query weight using aggregate dfs.
  5. distribute that weight to Searchables
  6. merge results

Steps 1-4 are done here, 5+6 in the search() methods

Returns
rewritten queries

Reimplemented from Lucene.Net.Search.Searcher.

Definition at line 354 of file MultiSearcher.cs.

override void Lucene.Net.Search.MultiSearcher.Dispose ( bool  disposing)
protectedvirtual

Implements Lucene.Net.Search.Searcher.

Definition at line 204 of file MultiSearcher.cs.

override Document Lucene.Net.Search.MultiSearcher.Doc ( int  i)
virtual

Expert: Returns the stored fields of document i.

See Also
Lucene.Net.Index.IndexReader.Document(int)

<throws> CorruptIndexException if the index is corrupt </throws> <throws> IOException if there is a low-level IO error </throws>

Implements Lucene.Net.Search.Searcher.

Definition at line 226 of file MultiSearcher.cs.

override Document Lucene.Net.Search.MultiSearcher.Doc ( int  n,
FieldSelector  fieldSelector 
)
virtual

Get the Lucene.Net.Documents.Documentat the nth position. The Lucene.Net.Documents.FieldSelector may be used to determine what Lucene.Net.Documents.Fields to load and how they should be loaded.

NOTE: If the underlying Reader (more specifically, the underlying FieldsReader) is closed before the lazy Lucene.Net.Documents.Field is loaded an exception may be thrown. If you want the value of a lazy Lucene.Net.Documents.Field to be available after closing you must explicitly load it or fetch the Document again with a new loader.

Parameters
nGet the document at the nth position
fieldSelectorThe Lucene.Net.Documents.FieldSelector to use to determine what Fields should be loaded on the Document. May be null, in which case all Fields will be loaded.
Returns
The stored fields of the Lucene.Net.Documents.Document at the nth position

<throws> CorruptIndexException if the index is corrupt </throws> <throws> IOException if there is a low-level IO error </throws>

See Also
Lucene.Net.Index.IndexReader.Document(int, FieldSelector)
See Also
IFieldable
See Also
Lucene.Net.Documents.FieldSelector
See Also
Lucene.Net.Documents.SetBasedFieldSelector
See Also
Lucene.Net.Documents.LoadFirstFieldSelector

Implements Lucene.Net.Search.Searcher.

Definition at line 233 of file MultiSearcher.cs.

override int Lucene.Net.Search.MultiSearcher.DocFreq ( Term  term)
virtual

Expert: Returns the number of documents containing term. Called by search code to compute term weights.

See Also
Lucene.Net.Index.IndexReader.DocFreq(Term)

Implements Lucene.Net.Search.Searcher.

Reimplemented in Lucene.Net.Search.ParallelMultiSearcher.

Definition at line 217 of file MultiSearcher.cs.

override Explanation Lucene.Net.Search.MultiSearcher.Explain ( Weight  weight,
int  doc 
)
virtual

Expert: low-level implementation method Returns an Explanation that describes how doc scored against weight.

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.

Applications should call Searcher.Explain(Query, int).

<throws> BooleanQuery.TooManyClauses </throws>

Implements Lucene.Net.Search.Searcher.

Definition at line 333 of file MultiSearcher.cs.

virtual Searchable [] Lucene.Net.Search.MultiSearcher.GetSearchables ( )
virtual

Return the array of Searchables this searches.

Definition at line 194 of file MultiSearcher.cs.

override Query Lucene.Net.Search.MultiSearcher.Rewrite ( Query  query)
virtual

Expert: called to re-write queries into primitive queries.

<throws> BooleanQuery.TooManyClauses </throws>

Implements Lucene.Net.Search.Searcher.

Definition at line 323 of file MultiSearcher.cs.

override TopDocs Lucene.Net.Search.MultiSearcher.Search ( Weight  weight,
Filter  filter,
int  n 
)
virtual

Expert: Low-level search implementation. Finds the top n hits for query, applying filter if non-null.

Applications should usually call Searcher.Search(Query, int) or Searcher.Search(Query,Filter,int) instead.

<throws> BooleanQuery.TooManyClauses </throws>

Implements Lucene.Net.Search.Searcher.

Reimplemented in Lucene.Net.Search.ParallelMultiSearcher.

Definition at line 261 of file MultiSearcher.cs.

override TopFieldDocs Lucene.Net.Search.MultiSearcher.Search ( Weight  weight,
Filter  filter,
int  n,
Sort  sort 
)
virtual

inheritdoc />

Implements Lucene.Net.Search.Searcher.

Reimplemented in Lucene.Net.Search.ParallelMultiSearcher.

Definition at line 285 of file MultiSearcher.cs.

override void Lucene.Net.Search.MultiSearcher.Search ( Weight  weight,
Filter  filter,
Collector  collector 
)
virtual

Lower-level search API.

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

Parameters
weightto match documents
filterif non-null, used to permit documents to be collected.
collectorto receive hits

<throws> BooleanQuery.TooManyClauses </throws>

Implements Lucene.Net.Search.Searcher.

Reimplemented in Lucene.Net.Search.ParallelMultiSearcher.

Definition at line 312 of file MultiSearcher.cs.

virtual int Lucene.Net.Search.MultiSearcher.SubDoc ( int  n)
virtual

Returns the document number of document n within its sub-index.

Definition at line 251 of file MultiSearcher.cs.

virtual int Lucene.Net.Search.MultiSearcher.SubSearcher ( int  n)
virtual

Returns index of the searcher for document n in the array used to construct this searcher.

Definition at line 242 of file MultiSearcher.cs.

Property Documentation

override int Lucene.Net.Search.MultiSearcher.MaxDoc
get

Definition at line 257 of file MultiSearcher.cs.


The documentation for this class was generated from the following file: