Lucene++ - a full-featured, c++ search engine
API Documentation
Implements search over a set of Searchables. More...
#include <MultiSearcher.h>
Public Member Functions | |
MultiSearcher (Collection< SearchablePtr > searchables) | |
Creates a searcher which searches searchers. More... | |
virtual | ~MultiSearcher () |
virtual String | getClassName () |
boost::shared_ptr< MultiSearcher > | shared_from_this () |
Collection< SearchablePtr > | getSearchables () |
Return the array of Searchables this searches. More... | |
virtual 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. More... | |
virtual int32_t | docFreq (TermPtr term) |
Returns the number of documents containing term. More... | |
virtual DocumentPtr | doc (int32_t n) |
Returns the stored fields of document i. More... | |
virtual DocumentPtr | doc (int32_t n, FieldSelectorPtr fieldSelector) |
Get the Document at the n'th position. The FieldSelector may be used to determine what Fields to load and how they should be loaded. More... | |
int32_t | subSearcher (int32_t n) |
Returns index of the searcher for document n in the array used to construct this searcher. More... | |
int32_t | subDoc (int32_t n) |
Returns the document number of document n within its sub-index. More... | |
virtual int32_t | maxDoc () |
Returns one greater than the largest possible document number. More... | |
virtual TopDocsPtr | search (WeightPtr weight, FilterPtr filter, int32_t n) |
Low-level search implementation. Finds the top n hits for query, applying filter if non-null. Applications should usually call Searcher#search(QueryPtr, int32_t) or Searcher#search(QueryPtr, FilterPtr, int32_t) instead. More... | |
virtual TopFieldDocsPtr | search (WeightPtr weight, FilterPtr filter, int32_t n, SortPtr sort) |
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. More... | |
virtual void | search (WeightPtr weight, FilterPtr filter, CollectorPtr results) |
Lower-level search API. More... | |
virtual QueryPtr | rewrite (QueryPtr query) |
Called to re-write queries into primitive queries. More... | |
virtual ExplanationPtr | explain (WeightPtr weight, int32_t doc) |
Low-level implementation method. Returns an Explanation that describes how doc scored against weight. More... | |
![]() | |
Searcher () | |
virtual | ~Searcher () |
boost::shared_ptr< Searcher > | shared_from_this () |
virtual TopFieldDocsPtr | search (QueryPtr query, FilterPtr filter, int32_t n, SortPtr 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. More... | |
virtual void | search (QueryPtr query, CollectorPtr results) |
Lower-level search API. More... | |
virtual void | search (QueryPtr query, FilterPtr filter, CollectorPtr results) |
Lower-level search API. More... | |
virtual TopDocsPtr | search (QueryPtr query, FilterPtr filter, int32_t n) |
Finds the top n hits for query, applying filter if non-null. More... | |
virtual TopDocsPtr | search (QueryPtr query, int32_t n) |
Finds the top n hits for query. More... | |
virtual ExplanationPtr | explain (QueryPtr query, int32_t doc) |
Returns an Explanation that describes how doc scored against query. More... | |
virtual void | setSimilarity (SimilarityPtr similarity) |
Set the Similarity implementation used by this Searcher. More... | |
virtual SimilarityPtr | getSimilarity () |
Return the Similarity implementation used by this Searcher. More... | |
virtual Collection< int32_t > | docFreqs (Collection< TermPtr > terms) |
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. More... | |
![]() | |
virtual | ~LuceneObject () |
virtual void | initialize () |
Called directly after instantiation to create objects that depend on this object being fully constructed. More... | |
virtual LuceneObjectPtr | clone (LuceneObjectPtr other=LuceneObjectPtr()) |
Return clone of this object. More... | |
virtual int32_t | hashCode () |
Return hash code for this object. More... | |
virtual bool | equals (LuceneObjectPtr other) |
Return whether two objects are equal. More... | |
virtual int32_t | compareTo (LuceneObjectPtr other) |
Compare two objects. More... | |
virtual String | toString () |
Returns a string representation of the object. More... | |
![]() | |
virtual | ~LuceneSync () |
virtual SynchronizePtr | getSync () |
Return this object synchronize lock. More... | |
virtual LuceneSignalPtr | getSignal () |
Return this object signal. More... | |
virtual void | lock (int32_t timeout=0) |
Lock this object using an optional timeout. More... | |
virtual void | unlock () |
Unlock this object. More... | |
virtual bool | holdsLock () |
Returns true if this object is currently locked by current thread. More... | |
virtual void | wait (int32_t timeout=0) |
Wait for signal using an optional timeout. More... | |
virtual void | notifyAll () |
Notify all threads waiting for signal. More... | |
Static Public Member Functions | |
static String | _getClassName () |
![]() | |
static String | _getClassName () |
![]() | |
static String | _getClassName () |
Protected Member Functions | |
Collection< int32_t > | getStarts () |
virtual WeightPtr | createWeight (QueryPtr query) |
Create weight in multiple index scenario. More... | |
Protected Attributes | |
Collection< SearchablePtr > | searchables |
Collection< int32_t > | starts |
int32_t | _maxDoc |
![]() | |
SimilarityPtr | similarity |
The Similarity implementation used by this searcher. More... | |
Implements search over a set of Searchables.
Applications usually need only call the inherited search(QueryPtr, int32_t) or search(QueryPtr, FilterPtr, int32_t) methods.
Lucene::MultiSearcher::MultiSearcher | ( | Collection< SearchablePtr > | searchables) |
Creates a searcher which searches searchers.
|
virtual |
|
inlinestatic |
|
virtual |
Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects that reference this Searchable.
Implements Lucene::Searcher.
Create weight in multiple index scenario.
Distributed query processing is done in the following steps:
Steps 1-4 are done here, 5+6 in the search() methods
Reimplemented from Lucene::Searcher.
|
virtual |
Returns the stored fields of document i.
Implements Lucene::Searcher.
|
virtual |
Get the Document at the n'th position. The FieldSelector may be used to determine what Fields to load and how they should be loaded.
NOTE: If the underlying Reader (more specifically, the underlying FieldsReader) is closed before the lazy Field is loaded an exception may be thrown. If you want the value of a lazy Field to be available after closing you must explicitly load it or fetch the Document again with a new loader.
n | Get the document at the n'th position |
fieldSelector | The FieldSelector to use to determine what Fields should be loaded on the Document. May be null, in which case all Fields will be loaded. |
Implements Lucene::Searcher.
|
virtual |
Returns the number of documents containing term.
Implements Lucene::Searcher.
Reimplemented in Lucene::ParallelMultiSearcher.
|
virtual |
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(QueryPtr, int32_t).
Implements Lucene::Searcher.
|
inlinevirtual |
Reimplemented from Lucene::Searcher.
Reimplemented in Lucene::ParallelMultiSearcher.
Collection<SearchablePtr> Lucene::MultiSearcher::getSearchables | ( | ) |
Return the array of Searchables this searches.
|
protected |
|
virtual |
Returns one greater than the largest possible document number.
Implements Lucene::Searcher.
Called to re-write queries into primitive queries.
Implements Lucene::Searcher.
|
virtual |
Low-level search implementation. Finds the top n hits for query, applying filter if non-null. Applications should usually call Searcher#search(QueryPtr, int32_t) or Searcher#search(QueryPtr, FilterPtr, int32_t) instead.
Implements Lucene::Searcher.
Reimplemented in Lucene::ParallelMultiSearcher.
|
virtual |
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 Searcher#search(QueryPtr, FilterPtr, int32_t, SortPtr) instead.
Implements Lucene::Searcher.
Reimplemented in Lucene::ParallelMultiSearcher.
|
virtual |
Lower-level search API.
Collector#collect(int32_t) 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(QueryPtr, int32_t)) is usually more efficient, as it skips non-high-scoring hits.
weight | To match documents |
filter | If non-null, used to permit documents to be collected. |
collector | To receive hits |
Implements Lucene::Searcher.
|
inline |
int32_t Lucene::MultiSearcher::subDoc | ( | int32_t | n) |
Returns the document number of document n within its sub-index.
int32_t Lucene::MultiSearcher::subSearcher | ( | int32_t | n) |
Returns index of the searcher for document n in the array used to construct this searcher.
|
protected |
|
protected |
|
protected |