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

Loading...
Searching...
No Matches
DisjunctionMaxQuery.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 DISJUNCTIONMAXQUERY_H
8#define DISJUNCTIONMAXQUERY_H
9
10#include "Query.h"
11
12 namespace Lucene {
13
27 class LPPAPI DisjunctionMaxQuery : public Query {
28 public:
35 DisjunctionMaxQuery(double tieBreakerMultiplier = 0.0);
36
40 DisjunctionMaxQuery(Collection<QueryPtr> disjuncts, double tieBreakerMultiplier);
41
42 virtual ~DisjunctionMaxQuery();
43
44 LUCENE_CLASS(DisjunctionMaxQuery);
45
46 protected:
48 Collection<QueryPtr> disjuncts;
49
51 double tieBreakerMultiplier;
52
53 public:
54 using Query::toString;
55
58 void add(const QueryPtr& query);
59
61 void add(Collection<QueryPtr> disjuncts);
62
64 Collection<QueryPtr>::iterator begin();
65 Collection<QueryPtr>::iterator end();
66
68 virtual WeightPtr createWeight(const SearcherPtr& searcher);
69
73 virtual QueryPtr rewrite(const IndexReaderPtr& reader);
74
77 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
78
80 virtual void extractTerms(SetTerm terms);
81
85 virtual String toString(const String& field);
86
89 virtual bool equals(const LuceneObjectPtr& other);
90
91 virtual int32_t hashCode();
92
93 friend class DisjunctionMaxWeight;
94};
95
96}
97
98#endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Query.h
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::Collection::iterator
collection_type::iterator iterator
Definition Collection.h:22
Lucene::DisjunctionMaxQuery
A query that generates the union of documents produced by its subqueries, and that scores each docume...
Definition DisjunctionMaxQuery.h:27
Lucene::DisjunctionMaxQuery::end
Collection< QueryPtr >::iterator end()
Lucene::DisjunctionMaxQuery::createWeight
virtual WeightPtr createWeight(const SearcherPtr &searcher)
Create the Weight used to score us.
Lucene::DisjunctionMaxQuery::tieBreakerMultiplier
double tieBreakerMultiplier
Multiple of the non-max disjunct scores added into our final score. Non-zero values support tie-break...
Definition DisjunctionMaxQuery.h:51
Lucene::DisjunctionMaxQuery::~DisjunctionMaxQuery
virtual ~DisjunctionMaxQuery()
Lucene::DisjunctionMaxQuery::add
void add(const QueryPtr &query)
Add a subquery to this disjunction.
Lucene::DisjunctionMaxQuery::begin
Collection< QueryPtr >::iterator begin()
An iterator over the disjuncts.
Lucene::DisjunctionMaxQuery::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::DisjunctionMaxQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Lucene::DisjunctionMaxQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Create a shallow copy of us - used in rewriting if necessary.
Lucene::DisjunctionMaxQuery::rewrite
virtual QueryPtr rewrite(const IndexReaderPtr &reader)
Optimize our representation and our subqueries representations.
Lucene::DisjunctionMaxQuery::DisjunctionMaxQuery
DisjunctionMaxQuery(Collection< QueryPtr > disjuncts, double tieBreakerMultiplier)
Creates a new DisjunctionMaxQuery.
Lucene::DisjunctionMaxQuery::disjuncts
Collection< QueryPtr > disjuncts
The subqueries.
Definition DisjunctionMaxQuery.h:48
Lucene::DisjunctionMaxQuery::add
void add(Collection< QueryPtr > disjuncts)
Add a collection of disjuncts to this disjunction.
Lucene::DisjunctionMaxQuery::extractTerms
virtual void extractTerms(SetTerm terms)
Adds all terms occurring in this query to the terms set.
Lucene::DisjunctionMaxQuery::toString
virtual String toString(const String &field)
Pretty print us.
Lucene::DisjunctionMaxQuery::DisjunctionMaxQuery
DisjunctionMaxQuery(double tieBreakerMultiplier=0.0)
Creates a new empty DisjunctionMaxQuery. Use add() to add the subqueries.
Lucene::Query
The abstract base class for queries.
Definition Query.h:31
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
Lucene::QueryPtr
boost::shared_ptr< Query > QueryPtr
Definition LuceneTypes.h:420
Lucene::SearcherPtr
boost::shared_ptr< Searcher > SearcherPtr
Definition LuceneTypes.h:434
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition LuceneTypes.h:157
Lucene::WeightPtr
boost::shared_ptr< Weight > WeightPtr
Definition LuceneTypes.h:480

clucene.sourceforge.net