blob: 3fe004cd3d6e2c02a6a55289a1e075f270a8a749 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/juniper/query.h>
#include <vespa/vespalib/stllike/string.h>
namespace search { class SimpleQueryStackDumpIterator; }
namespace search::fef { class Properties; }
namespace search::docsummary {
class IQueryTermFilter;
/*
* Class implementing an adapter used by juniper to examine the current
* query.
*/
class JuniperQueryAdapter : public juniper::IQuery
{
private:
const IQueryTermFilter *_query_term_filter;
const vespalib::stringref _buf;
const search::fef::Properties *_highlightTerms;
public:
JuniperQueryAdapter(const JuniperQueryAdapter&) = delete;
JuniperQueryAdapter operator= (const JuniperQueryAdapter&) = delete;
JuniperQueryAdapter(const IQueryTermFilter *query_term_filter, vespalib::stringref buf,
const search::fef::Properties *highlightTerms = nullptr);
~JuniperQueryAdapter() override;
bool skipItem(search::SimpleQueryStackDumpIterator *iterator) const;
bool Traverse(juniper::IQueryVisitor *v) const override;
bool UsefulIndex(const juniper::QueryItem* item) const override;
};
}
|