diff options
Diffstat (limited to 'searchcommon/src')
-rw-r--r-- | searchcommon/src/vespa/searchcommon/attribute/i_search_context.h | 6 | ||||
-rw-r--r-- | searchcommon/src/vespa/searchcommon/attribute/iattributevector.h | 18 |
2 files changed, 23 insertions, 1 deletions
diff --git a/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h b/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h index f5751135ef7..eb5ba68d6ee 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h +++ b/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h @@ -17,8 +17,11 @@ class QueryTermBase; namespace attribute { +class IAttributeVector; + class ISearchContext { public: + using UP = std::unique_ptr<ISearchContext>; virtual ~ISearchContext() {} virtual unsigned int approximateHits() const = 0; @@ -59,7 +62,8 @@ public: virtual bool valid() const = 0; virtual Int64Range getAsIntegerTerm() const = 0; - virtual const QueryTermBase & queryTerm() const = 0; + virtual const QueryTermBase &queryTerm() const = 0; + virtual const IAttributeVector &attribute() const = 0; }; diff --git a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h index 8e17e697d0e..edc71591175 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h +++ b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h @@ -10,8 +10,14 @@ #include <vespa/searchcommon/attribute/basictype.h> namespace search { + +class QueryTermSimple; + namespace attribute { +class ISearchContext; +class SearchContextParams; + /** * This class is used to store a value and a weight. * It is used when getting content from a weighted set attribute vector. @@ -236,6 +242,18 @@ public: **/ virtual bool findEnum(const char * value, EnumHandle & e) const = 0; + + /** + * Creates a context for searching this attribute with the given term. + * The search context is used to create the actual search iterator. + * + * @param term the term to search for. + * @param params optional bitvector and diversity settings for the search. + * @return the search context. + **/ + virtual std::unique_ptr<ISearchContext> createSearchContext(std::unique_ptr<QueryTermSimple> term, + const SearchContextParams ¶ms) const = 0; + /** * Returns the basic type of this attribute vector. * |