xapian-core
2.0.0
matcher
deciderpostlist.cc
Go to the documentation of this file.
1
4
/* Copyright 2017,2022 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
#include <
config.h
>
22
23
#include "
deciderpostlist.h
"
24
25
#include "
omassert.h
"
26
#include <
xapian/matchdecider.h
>
27
28
using namespace
std;
29
30
bool
31
DeciderPostList::test_doc
()
32
{
33
// We know that doc holds a ValueStreamDocument.
34
Xapian::Document::Internal
* doc_int = doc.internal.get();
35
ValueStreamDocument
* vsdoc =
static_cast<
ValueStreamDocument
*
>
(doc_int);
36
37
vsdoc->
set_shard_document
(pl->get_docid());
38
39
bool
decision = (*decider)(doc);
40
if
(decision) {
41
++accepted;
42
}
else
{
43
++rejected;
44
}
45
return
decision;
46
}
47
48
string
49
DeciderPostList::get_description
()
const
50
{
51
string
desc =
"DeciderPostList("
;
52
desc += pl->get_description();
53
desc +=
')'
;
54
return
desc;
55
}
DeciderPostList::get_description
std::string get_description() const
Return a string description of this object.
Definition:
deciderpostlist.cc:49
DeciderPostList::test_doc
bool test_doc()
Test the current with the MatchDecider.
Definition:
deciderpostlist.cc:31
ValueStreamDocument
A document which gets its values from a ValueStreamManager.
Definition:
valuestreamdocument.h:35
ValueStreamDocument::set_shard_document
void set_shard_document(Xapian::docid shard_did)
Definition:
valuestreamdocument.h:73
Xapian::Document::Internal
Abstract base class for a document.
Definition:
documentinternal.h:49
config.h
deciderpostlist.h
PostList which applies a MatchDecider.
matchdecider.h
Abstract base class for match deciders.
omassert.h
Various assertion macros.
Generated by
Doxygen 1.9.1