Lucene++ - a full-featured, c++ search engine
API Documentation

Loading...
Searching...
No Matches
MultiSearcher.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef MULTISEARCHER_H
8#define MULTISEARCHER_H
9
10#include "Searcher.h"
11#include "Collector.h"
12
13 namespace Lucene {
14
19 class LPPAPI MultiSearcher : public Searcher {
20 public:
22 MultiSearcher(Collection<SearchablePtr> searchables);
23
24 virtual ~MultiSearcher();
25
26 LUCENE_CLASS(MultiSearcher);
27
28 protected:
29 Collection<SearchablePtr> searchables;
30 Collection<int32_t> starts;
31 int32_t _maxDoc;
32
33 public:
34 using Searcher::search;
35
37 Collection<SearchablePtr> getSearchables();
38
39 virtual void close();
40 virtual int32_t docFreq(const TermPtr& term);
41 virtual DocumentPtr doc(int32_t n);
42 virtual DocumentPtr doc(int32_t n, const FieldSelectorPtr& fieldSelector);
43
45 int32_t subSearcher(int32_t n);
46
48 int32_t subDoc(int32_t n);
49
50 virtual int32_t maxDoc();
51 virtual TopDocsPtr search(const WeightPtr& weight, const FilterPtr& filter, int32_t n);
52 virtual TopFieldDocsPtr search(const WeightPtr& weight, const FilterPtr& filter, int32_t n, const SortPtr& sort);
53 virtual void search(const WeightPtr& weight, const FilterPtr& filter, const CollectorPtr& results);
54 virtual QueryPtr rewrite(const QueryPtr& query);
55 virtual ExplanationPtr explain(const WeightPtr& weight, int32_t doc);
56
57 protected:
58 Collection<int32_t> getStarts();
59
73 virtual WeightPtr createWeight(const QueryPtr& query);
74};
75
76}
77
78#endif
Collector.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Searcher.h
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::MultiSearcher::search
virtual void search(const WeightPtr &weight, const FilterPtr &filter, const CollectorPtr &results)
Lower-level search API.
Lucene::MultiSearcher::getStarts
Collection< int32_t > getStarts()
Lucene::MultiSearcher::~MultiSearcher
virtual ~MultiSearcher()
Lucene::MultiSearcher::getSearchables
Collection< SearchablePtr > getSearchables()
Return the array of Searchables this searches.
Lucene::MultiSearcher::searchables
Collection< SearchablePtr > searchables
Definition MultiSearcher.h:29
Lucene::MultiSearcher::close
virtual void close()
Frees resources associated with this Searcher. Be careful not to call this method while you are still...
Lucene::MultiSearcher::subDoc
int32_t subDoc(int32_t n)
Returns the document number of document n within its sub-index.
Lucene::MultiSearcher::createWeight
virtual WeightPtr createWeight(const QueryPtr &query)
Create weight in multiple index scenario.
Lucene::MultiSearcher::rewrite
virtual QueryPtr rewrite(const QueryPtr &query)
Called to re-write queries into primitive queries.
Lucene::MultiSearcher::maxDoc
virtual int32_t maxDoc()
Returns one greater than the largest possible document number.
Lucene::MultiSearcher::search
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,...
Lucene::MultiSearcher::doc
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...
Lucene::MultiSearcher::MultiSearcher
MultiSearcher(Collection< SearchablePtr > searchables)
Creates a searcher which searches searchers.
Lucene::MultiSearcher::starts
Collection< int32_t > starts
Definition MultiSearcher.h:30
Lucene::MultiSearcher::search
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....
Lucene::MultiSearcher::explain
virtual ExplanationPtr explain(const WeightPtr &weight, int32_t doc)
Low-level implementation method. Returns an Explanation that describes how doc scored against weight.
Lucene::MultiSearcher::docFreq
virtual int32_t docFreq(const TermPtr &term)
Returns the number of documents containing term.
Lucene::MultiSearcher::doc
virtual DocumentPtr doc(int32_t n)
Returns the stored fields of document i.
Lucene::MultiSearcher::_maxDoc
int32_t _maxDoc
Definition MultiSearcher.h:31
Lucene::MultiSearcher::subSearcher
int32_t subSearcher(int32_t n)
Returns index of the searcher for document n in the array used to construct this searcher.
Lucene::Searcher::search
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-...
Lucene::Searcher::Searcher
Searcher()
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::SortPtr
boost::shared_ptr< Sort > SortPtr
Definition LuceneTypes.h:442
Lucene::QueryPtr
boost::shared_ptr< Query > QueryPtr
Definition LuceneTypes.h:420
Lucene::WeightPtr
boost::shared_ptr< Weight > WeightPtr
Definition LuceneTypes.h:480
Lucene::FieldSelectorPtr
boost::shared_ptr< FieldSelector > FieldSelectorPtr
Definition LuceneTypes.h:77
Lucene::ExplanationPtr
boost::shared_ptr< Explanation > ExplanationPtr
Definition LuceneTypes.h:333
Lucene::FilterPtr
boost::shared_ptr< Filter > FilterPtr
Definition LuceneTypes.h:358
Lucene::TopDocsPtr
boost::shared_ptr< TopDocs > TopDocsPtr
Definition LuceneTypes.h:471
Lucene::TermPtr
boost::shared_ptr< Term > TermPtr
Definition LuceneTypes.h:233
Lucene::CollectorPtr
boost::shared_ptr< Collector > CollectorPtr
Definition LuceneTypes.h:295
Lucene::TopFieldDocsPtr
boost::shared_ptr< TopFieldDocs > TopFieldDocsPtr
Definition LuceneTypes.h:474
Lucene::DocumentPtr
boost::shared_ptr< Document > DocumentPtr
Definition LuceneTypes.h:74

clucene.sourceforge.net