Lucene++ - a full-featured, c++ search engine
API Documentation
Go to the documentation of this file.
7 #ifndef CUSTOMSCOREQUERY_H
8 #define CUSTOMSCOREQUERY_H
78 virtual double customScore(int32_t doc,
double subQueryScore,
double valSrcScore);
126 friend class CustomWeight;
127 friend class CustomScorer;
virtual int32_t hashCode()
Return hash code for this object.
virtual String name()
A short name of this query, used in toString(String).
boost::shared_ptr< CustomScoreProvider > CustomScoreProviderPtr
Definition: LuceneTypes.h:309
void ConstructQuery(const QueryPtr &subQuery, Collection< ValueSourceQueryPtr > valSrcQueries)
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
CustomScoreQuery(const QueryPtr &subQuery)
Create a CustomScoreQuery over input subQuery.
virtual double customScore(int32_t doc, double subQueryScore, Collection< double > valSrcScores)
Compute a custom score by the subQuery score and a number of ValueSourceQuery scores.
virtual CustomScoreProviderPtr getCustomScoreProvider(const IndexReaderPtr &reader)
Returns a CustomScoreProvider that calculates the custom scores for the given {}. The default impleme...
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
virtual ExplanationPtr customExplain(int32_t doc, const ExplanationPtr &subQueryExpl, const ExplanationPtr &valSrcExpl)
Explain the custom score.
Collection< ValueSourceQueryPtr > valSrcQueries
Definition: CustomScoreQuery.h:47
virtual bool isStrict()
Checks if this is strict custom scoring. In strict custom scoring, the ValueSource part does not part...
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into ...
CustomScoreQuery(const QueryPtr &subQuery, Collection< ValueSourceQueryPtr > valSrcQueries)
Create a CustomScoreQuery over input subQuery and a ValueSourceQuery.
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
boost::shared_ptr< ValueSourceQuery > ValueSourceQueryPtr
Definition: LuceneTypes.h:477
virtual WeightPtr createWeight(const SearcherPtr &searcher)
Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries...
CustomScoreQuery(const QueryPtr &subQuery, const ValueSourceQueryPtr &valSrcQuery)
Create a CustomScoreQuery over input subQuery and a ValueSourceQuery.
virtual ExplanationPtr customExplain(int32_t doc, const ExplanationPtr &subQueryExpl, Collection< ExplanationPtr > valSrcExpls)
Explain the custom score.
Query that sets document score as a programmatic function of several (sub) scores:
Definition: CustomScoreQuery.h:21
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
The abstract base class for queries.
Definition: Query.h:31
virtual ~CustomScoreQuery()
bool strict
Definition: CustomScoreQuery.h:48
virtual double customScore(int32_t doc, double subQueryScore, double valSrcScore)
Compute a custom score by the subQuery score and the ValueSourceQuery score.
virtual String toString(const String &field)
Prints a query to a string, with field assumed to be the default field and omitted.
virtual void setStrict(bool strict)
Set the strict mode of this query.
boost::shared_ptr< Explanation > ExplanationPtr
Definition: LuceneTypes.h:333
QueryPtr subQuery
Definition: CustomScoreQuery.h:43
virtual void extractTerms(SetTerm terms)
Adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten...
virtual String toString()
Prints a query to a string.
boost::shared_ptr< Searcher > SearcherPtr
Definition: LuceneTypes.h:434
clucene.sourceforge.net