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