aboutsummaryrefslogtreecommitdiffstats
path: root/streamingvisitors/src/vespa/vsm/searcher/geo_pos_field_searcher.h
blob: 17c9f23fefbb88fa067001a5d4c9bce13a2f37e2 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "fieldsearcher.h"
#include <vespa/searchlib/common/geo_location.h>

namespace vsm {

class GeoPosFieldSearcher : public FieldSearcher {
public:
    GeoPosFieldSearcher(FieldIdT fId);
    ~GeoPosFieldSearcher() override;
    void prepare(search::streaming::QueryTermList& qtl,
                 const SharedSearcherBuf& buf,
                 const vsm::FieldPathMapT& field_paths,
                 search::fef::IQueryEnvironment& query_env) override;
    void onValue(const document::FieldValue & fv) override;
    void onStructValue(const document::StructFieldValue & fv) override;
    std::unique_ptr<FieldSearcher> duplicate() const override;
protected:
    using GeoLocation = search::common::GeoLocation;
    class GeoPosInfo : public GeoLocation {
    public:
        explicit GeoPosInfo (GeoLocation loc) noexcept : GeoLocation(std::move(loc)) {}
        bool cmp(const document::StructFieldValue & fv) const;
    };
    using GeoPosInfoListT = std::vector<GeoPosInfo>;
    GeoPosInfoListT _geoPosTerm;
};

}