CLucene - a full-featured, c++ search engine
API Documentation
Searchables
.
More...
#include <MultiSearcher.h>
Public Member Functions | |
MultiSearcher (Searchable **searchables) | |
Creates a searcher which searches Searchables. | |
~MultiSearcher () | |
void | close () |
Frees resources associated with this Searcher . | |
int32_t | docFreq (const lucene::index::Term *term) const |
Expert: Returns the number of documents containing term . | |
bool | doc (int32_t n, lucene::document::Document *document) |
For use by HitCollector implementations. | |
int32_t | searcherIndex (int32_t n) const |
For use by HitCollector implementations to identify the index of the sub-searcher that a particular hit came from. | |
int32_t | subSearcher (int32_t n) const |
int32_t | subDoc (int32_t n) const |
int32_t | maxDoc () const |
Expert: Returns one greater than the largest possible document number. | |
TopDocs * | _search (Query *query, Filter *filter, const int32_t nDocs) |
Expert: Low-level search implementation. | |
TopFieldDocs * | _search (Query *query, Filter *filter, const int32_t n, const Sort *sort) |
Expert: Low-level search implementation with arbitrary sorting. | |
void | _search (Query *query, Filter *filter, HitCollector *results) |
Lower-level search API. | |
Query * | rewrite (Query *original) |
Expert: called to re-write queries into primitive queries. | |
void | explain (Query *query, int32_t doc, Explanation *ret) |
Returns an Explanation that describes how doc scored against query . | |
Protected Member Functions | |
int32_t * | getStarts () |
int32_t | getLength () |
Searchables
.
Applications usually need only call the inherited search(Query) or search(Query,Filter) methods.
lucene::search::MultiSearcher::MultiSearcher | ( | Searchable ** | searchables | ) |
Creates a searcher which searches Searchables.
lucene::search::MultiSearcher::~MultiSearcher | ( | ) |
int32_t* lucene::search::MultiSearcher::getStarts | ( | ) | [inline, protected] |
int32_t lucene::search::MultiSearcher::getLength | ( | ) | [inline, protected] |
void lucene::search::MultiSearcher::close | ( | ) | [virtual] |
int32_t lucene::search::MultiSearcher::docFreq | ( | const lucene::index::Term * | term | ) | const [virtual] |
Expert: Returns the number of documents containing term
.
Called by search code to compute term weights.
Implements lucene::search::Searchable.
bool lucene::search::MultiSearcher::doc | ( | int32_t | n, | |
lucene::document::Document * | document | |||
) | [virtual] |
int32_t lucene::search::MultiSearcher::searcherIndex | ( | int32_t | n | ) | const |
For use by HitCollector implementations to identify the index of the sub-searcher that a particular hit came from.
int32_t lucene::search::MultiSearcher::subSearcher | ( | int32_t | n | ) | const |
int32_t lucene::search::MultiSearcher::subDoc | ( | int32_t | n | ) | const |
int32_t lucene::search::MultiSearcher::maxDoc | ( | ) | const [virtual] |
Expert: Returns one greater than the largest possible document number.
Called by search code to compute term weights.
Implements lucene::search::Searchable.
TopDocs* lucene::search::MultiSearcher::_search | ( | Query * | query, | |
Filter * | filter, | |||
const int32_t | n | |||
) | [virtual] |
Expert: Low-level search implementation.
Finds the top n
hits for query
, applying filter
if non-null.
Called by Hits.
Applications should usually call Searcher#search(Query*) or Searcher#search(Query*,Filter*) instead.
Implements lucene::search::Searchable.
TopFieldDocs* lucene::search::MultiSearcher::_search | ( | Query * | query, | |
Filter * | filter, | |||
const int32_t | n, | |||
const Sort * | sort | |||
) | [virtual] |
Expert: 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(Query,Filter,Sort) instead.
Implements lucene::search::Searchable.
void lucene::search::MultiSearcher::_search | ( | Query * | query, | |
Filter * | filter, | |||
HitCollector * | results | |||
) | [virtual] |
Lower-level search API.
HitCollector#collect(int32_t,float_t) is called for every non-zero scoring document.
Applications should only use this if they need all of the matching documents. The high-level search API (Searcher#search(Query)) is usually more efficient, as it skips non-high-scoring hits.
query | to match documents | |
filter | if non-null, a bitset used to eliminate some documents | |
results | to receive hits |
Implements lucene::search::Searcher.
void lucene::search::MultiSearcher::explain | ( | Query * | query, | |
int32_t | doc, | |||
Explanation * | ret | |||
) | [virtual] |
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.
Implements lucene::search::Searchable.