7 #ifndef INDEXSEARCHER_H
8 #define INDEXSEARCHER_H
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Implements search over a single IndexReader.
Definition: IndexSearcher.h:23
virtual TopDocsPtr search(const WeightPtr &weight, const FilterPtr &filter, int32_t n)
Low-level search implementation. Finds the top n hits for query, applying filter if non-null....
IndexSearcher(const DirectoryPtr &path, bool readOnly=true)
Creates a searcher searching the index in the named directory. You should pass readOnly = true,...
virtual int32_t maxDoc()
Returns one greater than the largest possible document number.
virtual void search(const WeightPtr &weight, const FilterPtr &filter, const CollectorPtr &results)
Lower-level search API.
bool fieldSortDoMaxScore
Definition: IndexSearcher.h:52
void ConstructSearcher(const IndexReaderPtr &reader, bool closeReader)
virtual ExplanationPtr explain(const WeightPtr &weight, int32_t doc)
Low-level implementation method. Returns an Explanation that describes how doc scored against weight.
virtual void setDefaultFieldSortScoring(bool doTrackScores, bool doMaxScore)
By default, no scores are computed when sorting by field (using FilterPtr, int32_t,...
IndexReaderPtr reader
Definition: IndexSearcher.h:40
virtual QueryPtr rewrite(const QueryPtr &query)
Called to re-write queries into primitive queries.
virtual int32_t docFreq(const TermPtr &term)
Returns the number of documents containing term.
Collection< IndexReaderPtr > subReaders
Definition: IndexSearcher.h:48
virtual DocumentPtr doc(int32_t n)
Returns the stored fields of document i.
void searchWithFilter(const IndexReaderPtr &reader, const WeightPtr &weight, const FilterPtr &filter, const CollectorPtr &collector)
IndexSearcher(const IndexReaderPtr &reader, Collection< IndexReaderPtr > subReaders, Collection< int32_t > docStarts)
Directly specify the reader, subReaders and their docID starts.
virtual void close()
Note that the underlying IndexReader is not closed, if IndexSearcher was constructed with IndexSearch...
Collection< int32_t > docStarts
Definition: IndexSearcher.h:49
IndexSearcher(const IndexReaderPtr &reader)
Creates a searcher searching the provided index.
bool closeReader
Definition: IndexSearcher.h:46
virtual TopFieldDocsPtr search(const WeightPtr &weight, const FilterPtr &filter, int32_t n, const SortPtr &sort, bool fillFields)
Just like search(WeightPtr, FilterPtr, int32_t, SortPtr), but you choose whether or not the fields in...
bool fieldSortDoTrackScores
Definition: IndexSearcher.h:51
void gatherSubReaders(Collection< IndexReaderPtr > allSubReaders, const IndexReaderPtr &reader)
virtual TopFieldDocsPtr search(const WeightPtr &weight, const FilterPtr &filter, int32_t n, const SortPtr &sort)
Low-level search implementation with arbitrary sorting. Finds the top n hits for query,...
IndexReaderPtr getIndexReader()
Return the IndexReader this searches.
virtual DocumentPtr doc(int32_t n, const FieldSelectorPtr &fieldSelector)
Get the Document at the n'th position. The FieldSelector may be used to determine what Fields to load...
An abstract base class for search implementations. Implements the main search methods.
Definition: Searcher.h:18
virtual TopFieldDocsPtr search(const QueryPtr &query, const FilterPtr &filter, int32_t n, const SortPtr &sort)
Search implementation with arbitrary sorting. Finds the top n hits for query, applying filter if non-...
virtual ExplanationPtr explain(const QueryPtr &query, int32_t doc)
Returns an Explanation that describes how doc scored against query.
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< TopDocs > TopDocsPtr
Definition: LuceneTypes.h:471
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
boost::shared_ptr< FieldSelector > FieldSelectorPtr
Definition: LuceneTypes.h:77
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233
boost::shared_ptr< Collector > CollectorPtr
Definition: LuceneTypes.h:295
boost::shared_ptr< Explanation > ExplanationPtr
Definition: LuceneTypes.h:333
boost::shared_ptr< Sort > SortPtr
Definition: LuceneTypes.h:442
boost::shared_ptr< Directory > DirectoryPtr
Definition: LuceneTypes.h:489
boost::shared_ptr< TopFieldDocs > TopFieldDocsPtr
Definition: LuceneTypes.h:474
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
boost::shared_ptr< Document > DocumentPtr
Definition: LuceneTypes.h:74
boost::shared_ptr< Filter > FilterPtr
Definition: LuceneTypes.h:358
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480