blob: be315b05a69cd2abe08b2046e28fc65315bedd9d (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "enumstore.h"
#include "postinglisttraits.h"
#include "ipostinglistsearchcontext.h"
#include <vespa/searchlib/queryeval/searchiterator.h>
namespace search
{
namespace attribute
{
/**
* Search context helper for enumerated attributes, used to eliminate
* searches for values that are not present at all.
*/
class EnumHintSearchContext : public IPostingListSearchContext
{
const EnumStoreDictBase &_dictionary;
const btree::BTreeNode::Ref _frozenRootRef;
uint32_t _uniqueValues;
uint32_t _docIdLimit;
uint64_t _numValues; // attr.getStatus().getNumValues();
protected:
EnumHintSearchContext(const EnumStoreDictBase &dictionary,
uint32_t docIdLimit,
uint64_t numValues);
~EnumHintSearchContext();
void lookupTerm(const EnumStoreComparator &comp);
void lookupRange(const EnumStoreComparator &low, const EnumStoreComparator &high);
queryeval::SearchIterator::UP
createPostingIterator(fef::TermFieldMatchData *matchData, bool strict) override;
void fetchPostings(bool strict) override;
unsigned int approximateHits() const override;
};
} // namespace attribute
} // namespace search
|