blob: e779e41bb90b529d534ed872bad68e7a0cfacf01 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <memory>
namespace search {
namespace queryeval { class SearchIterator; }
namespace fef { class TermFieldMatchData; }
namespace attribute {
/**
* Interface for search context helper classes to create attribute
* search iterators based on posting lists and using dictionary
* information to better estimate number of hits. Also used for
* enumerated attributes without posting lists to eliminate brute
* force searches for nonexisting values.
*/
class IPostingListSearchContext
{
protected:
IPostingListSearchContext() { }
virtual ~IPostingListSearchContext() { }
public:
virtual void fetchPostings(bool strict) = 0;
virtual std::unique_ptr<queryeval::SearchIterator> createPostingIterator(fef::TermFieldMatchData *matchData, bool strict) = 0;
virtual unsigned int approximateHits() const = 0;
};
} // namespace attribute
} // namespace search
|