xapian-core
2.0.0
matcher
extraweightpostlist.h
Go to the documentation of this file.
1
4
/* Copyright 2017 Olly Betts
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation; either version 2 of the
9
* License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, see
18
* <https://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef XAPIAN_INCLUDED_EXTRAWEIGHTPOSTLIST_H
22
#define XAPIAN_INCLUDED_EXTRAWEIGHTPOSTLIST_H
23
24
#include "
wrapperpostlist.h
"
25
26
namespace
Xapian
{
27
class
Weight;
28
}
29
30
class
PostListTree
;
31
33
class
ExtraWeightPostList
:
public
WrapperPostList
{
35
void
operator=
(
const
ExtraWeightPostList
&) =
delete
;
36
38
ExtraWeightPostList
(
const
ExtraWeightPostList
&) =
delete
;
39
40
Xapian::Weight
*
weight
;
41
42
PostListTree
*
pltree
;
43
44
double
max_extra
;
45
46
public
:
47
ExtraWeightPostList
(
PostList
* pl_,
48
Xapian::Weight
* weight_,
49
PostListTree
* pltree_)
50
:
WrapperPostList
(pl_),
51
weight
(weight_),
52
pltree
(pltree_),
53
max_extra
(
weight
->get_maxextra()) {}
54
55
~ExtraWeightPostList
() {
56
delete
weight
;
57
}
58
59
double
get_weight
(
Xapian::termcount
doclen,
60
Xapian::termcount
unique_terms,
61
Xapian::termcount
wdfdocmax)
const
;
62
63
double
recalc_maxweight
();
64
65
PostList
*
next
(
double
w_min);
66
67
PostList
*
skip_to
(
Xapian::docid
,
double
w_min);
68
69
std::string
get_description
()
const
;
70
};
71
72
#endif
// XAPIAN_INCLUDED_EXTRAWEIGHTPOSTLIST_H
ExtraWeightPostList
PostList which adds on a term-independent weight contribution.
Definition:
extraweightpostlist.h:33
ExtraWeightPostList::pltree
PostListTree * pltree
Definition:
extraweightpostlist.h:42
ExtraWeightPostList::weight
Xapian::Weight * weight
Definition:
extraweightpostlist.h:40
ExtraWeightPostList::skip_to
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
Definition:
extraweightpostlist.cc:67
ExtraWeightPostList::get_description
std::string get_description() const
Return a string description of this object.
Definition:
extraweightpostlist.cc:76
ExtraWeightPostList::get_weight
double get_weight(Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const
Return the weight contribution for the current position.
Definition:
extraweightpostlist.cc:32
ExtraWeightPostList::~ExtraWeightPostList
~ExtraWeightPostList()
Definition:
extraweightpostlist.h:55
ExtraWeightPostList::ExtraWeightPostList
ExtraWeightPostList(PostList *pl_, Xapian::Weight *weight_, PostListTree *pltree_)
Definition:
extraweightpostlist.h:47
ExtraWeightPostList::operator=
void operator=(const ExtraWeightPostList &)=delete
Don't allow assignment.
ExtraWeightPostList::ExtraWeightPostList
ExtraWeightPostList(const ExtraWeightPostList &)=delete
Don't allow copying.
ExtraWeightPostList::recalc_maxweight
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
Definition:
extraweightpostlist.cc:49
ExtraWeightPostList::max_extra
double max_extra
Definition:
extraweightpostlist.h:44
PostListTree
Definition:
postlisttree.h:28
WrapperPostList
Base class for a PostList which wraps another PostList.
Definition:
wrapperpostlist.h:32
Xapian::Internal::PostList
Abstract base class for postlists.
Definition:
postlist.h:40
Xapian::Internal::PostList::next
PostList * next()
Advance the current position to the next document in the postlist.
Definition:
postlist.h:168
Xapian::Weight
Abstract base class for weighting schemes.
Definition:
weight.h:38
Xapian
The Xapian namespace contains public interfaces for the Xapian library.
Definition:
compactor.cc:82
Xapian::termcount
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition:
types.h:64
Xapian::docid
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition:
types.h:51
wrapperpostlist.h
Base class for a PostList which wraps another PostList.
Generated by
Doxygen 1.9.1