Lucene++ - a full-featured, c++ search engine
API Documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
include
PayloadNearQuery.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 PAYLOADNEARQUERY_H
8
#define PAYLOADNEARQUERY_H
9
10
#include "
SpanNearQuery.h
"
11
#include "
SpanWeight.h
"
12
#include "
SpanScorer.h
"
13
14
namespace
Lucene {
15
25
class
LPPAPI
PayloadNearQuery
:
public
SpanNearQuery
{
26
public
:
27
PayloadNearQuery
(
Collection<SpanQueryPtr>
clauses, int32_t slop,
bool
inOrder);
28
PayloadNearQuery
(
Collection<SpanQueryPtr>
clauses, int32_t slop,
bool
inOrder,
const
PayloadFunctionPtr
&
function
);
29
30
virtual
~
PayloadNearQuery
();
31
32
LUCENE_CLASS
(
PayloadNearQuery
);
33
34
protected
:
35
String fieldName;
36
PayloadFunctionPtr
function
;
37
38
public
:
39
using
SpanNearQuery::toString
;
40
41
virtual
WeightPtr
createWeight(
const
SearcherPtr
& searcher);
42
43
virtual
LuceneObjectPtr
clone(
const
LuceneObjectPtr
& other =
LuceneObjectPtr
());
44
virtual
String toString(
const
String& field);
45
virtual
bool
equals(
const
LuceneObjectPtr
& other);
46
virtual
int32_t hashCode();
47
48
friend
class
PayloadNearSpanWeight
;
49
friend
class
PayloadNearSpanScorer
;
50
};
51
52
class
LPPAPI
PayloadNearSpanWeight
:
public
SpanWeight
{
53
public
:
54
PayloadNearSpanWeight
(
const
SpanQueryPtr
& query,
const
SearcherPtr
& searcher);
55
virtual
~
PayloadNearSpanWeight
();
56
57
LUCENE_CLASS
(
PayloadNearSpanWeight
);
58
59
public
:
60
virtual
ScorerPtr
scorer(
const
IndexReaderPtr
& reader,
bool
scoreDocsInOrder,
bool
topScorer);
61
};
62
63
class
LPPAPI
PayloadNearSpanScorer
:
public
SpanScorer
{
64
public
:
65
PayloadNearSpanScorer
(
const
SpansPtr
& spans,
const
WeightPtr
& weight,
const
SimilarityPtr
& similarity, ByteArray norms);
66
virtual
~
PayloadNearSpanScorer
();
67
68
LUCENE_CLASS
(
PayloadNearSpanScorer
);
69
70
public
:
71
SpansPtr
spans
;
72
SimilarityPtr
similarity
;
73
74
protected
:
75
double
payloadScore
;
76
int32_t
payloadsSeen
;
77
78
public
:
80
void
getPayloads(
Collection<SpansPtr>
subSpans);
81
82
virtual
double
score();
83
84
protected
:
91
void
processPayloads(
Collection<ByteArray>
payLoads, int32_t start, int32_t end);
92
93
virtual
bool
setFreqCurrentDoc();
94
virtual
ExplanationPtr
explain(int32_t doc);
95
};
96
97
}
98
99
#endif
clucene.sourceforge.net