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

Loading...
Searching...
No Matches
Searchable.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 SEARCHABLE_H
8#define SEARCHABLE_H
9
10#include "LuceneObject.h"
11
12 namespace Lucene {
13
24 class LPPAPI Searchable {
25 public:
26 LUCENE_INTERFACE(Searchable);
27 virtual ~Searchable() {}
28
29 public:
42 virtual void search(const WeightPtr& weight, const FilterPtr& filter, const CollectorPtr& collector) = 0;
43
46 virtual void close() = 0;
47
50 virtual int32_t docFreq(const TermPtr& term) = 0;
51
54 virtual Collection<int32_t> docFreqs(Collection<TermPtr> terms) = 0;
55
58 virtual int32_t maxDoc() = 0;
59
63 virtual TopDocsPtr search(const WeightPtr& weight, const FilterPtr& filter, int32_t n) = 0;
64
67 virtual DocumentPtr doc(int32_t n) = 0;
68
86 virtual DocumentPtr doc(int32_t n, const FieldSelectorPtr& fieldSelector) = 0;
87
89 virtual QueryPtr rewrite(const QueryPtr& query) = 0;
90
98 virtual ExplanationPtr explain(const WeightPtr& weight, int32_t doc) = 0;
99
104 virtual TopFieldDocsPtr search(const WeightPtr& weight, const FilterPtr& filter, int32_t n, const SortPtr& sort) = 0;
105};
106
107}
108
109#endif
LuceneObject.h
LUCENE_INTERFACE
#define LUCENE_INTERFACE(Name)
Definition LuceneObject.h:19
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::Searchable
The interface for search implementations.
Definition Searchable.h:24
Lucene::Searchable::docFreq
virtual int32_t docFreq(const TermPtr &term)=0
Returns the number of documents containing term.
Lucene::Searchable::search
virtual TopFieldDocsPtr search(const WeightPtr &weight, const FilterPtr &filter, int32_t n, const SortPtr &sort)=0
Low-level search implementation with arbitrary sorting. Finds the top n hits for query,...
Lucene::Searchable::search
virtual TopDocsPtr search(const WeightPtr &weight, const FilterPtr &filter, int32_t n)=0
Low-level search implementation. Finds the top n hits for query, applying filter if non-null....
Lucene::Searchable::doc
virtual DocumentPtr doc(int32_t n)=0
Returns the stored fields of document i.
Lucene::Searchable::close
virtual void close()=0
Frees resources associated with this Searcher. Be careful not to call this method while you are still...
Lucene::Searchable::doc
virtual DocumentPtr doc(int32_t n, const FieldSelectorPtr &fieldSelector)=0
Get the Document at the n'th position. The FieldSelector may be used to determine what Fields to load...
Lucene::Searchable::maxDoc
virtual int32_t maxDoc()=0
Returns one greater than the largest possible document number.
Lucene::Searchable::search
virtual void search(const WeightPtr &weight, const FilterPtr &filter, const CollectorPtr &collector)=0
Lower-level search API.
Lucene::Searchable::rewrite
virtual QueryPtr rewrite(const QueryPtr &query)=0
Called to re-write queries into primitive queries.
Lucene::Searchable::~Searchable
virtual ~Searchable()
Definition Searchable.h:27
Lucene::Searchable::docFreqs
virtual Collection< int32_t > docFreqs(Collection< TermPtr > terms)=0
For each term in the terms array, calculates the number of documents containing term....
Lucene::Searchable::explain
virtual ExplanationPtr explain(const WeightPtr &weight, int32_t doc)=0
Low-level implementation method. Returns an Explanation that describes how doc scored against weight.
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