aboutsummaryrefslogtreecommitdiff
path: root/icing/query/query-processor.h
diff options
context:
space:
mode:
authorTim Barron <tjbarron@google.com>2022-12-12 18:03:05 -0800
committerTim Barron <tjbarron@google.com>2022-12-12 18:03:05 -0800
commit8ddc32ad433ea147de80dcfac2afe58962360f18 (patch)
tree50c30cb98396499bf1d6caf33b383f7f4bbc7e58 /icing/query/query-processor.h
parent2658f90984737e5bf6c76d82024103dccd4d51c6 (diff)
downloadicing-8ddc32ad433ea147de80dcfac2afe58962360f18.tar.gz
Sync from upstream.
Descriptions: ====================================================================== Add ScoringSpec into JoinSpec. Rename joined_document to child_document. ====================================================================== Create JoinedScoredDocumentHit class and refactor ScoredDocumentHitsRanker. ====================================================================== Implement initial Join workflow ====================================================================== Implement the Lexer for Icing Advanced Query Language ====================================================================== Create struct Options for PersistentHashMap ====================================================================== Premapping FileBackedVector ====================================================================== Create class PersistentHashMapKeyMapper ====================================================================== Add integer sections into TokenizedDocument and rename string sections ====================================================================== Create NumericIndex interface and DocHitInfoIteratorNumeric ====================================================================== Implement DummyNumericIndex and unit test ====================================================================== Change PostingListAccessor::Finalize to rvalue member function ====================================================================== Define the Abstract Syntax Tree for Icing's list_filter parser. ====================================================================== Refactor query processing and score ====================================================================== Refactor IcingSearchEngine for AppSearch Dynamite Module 0p APIs ====================================================================== Implement the Lexer for Icing Advanced Scoring Language ====================================================================== Add a common interface for IcingSearchEngine and dynamite client ====================================================================== Implement a subset of the query grammar. ====================================================================== Refactor index processor ====================================================================== Add integer index into IcingSearchEngine and IndexProcessor ====================================================================== Implement the parser for Icing Advanced Scoring Language ====================================================================== Implement IntegerIndexData and PostingListUsedIntegerIndexDataSerializer ====================================================================== Add PostingListAccessor abstract class for common components and methods ====================================================================== Implement PostingListIntegerIndexDataAccessor ====================================================================== Create PostingListIntegerIndexDataAccessorTest ====================================================================== Fix Icing Segmentation tests for word connectors that changed in ICU 72. ====================================================================== Modify the Advanced Query grammar to allow functions to accept expressions. ====================================================================== Implement QueryVisitor. ====================================================================== Enable the Advanced Query Parser to handle member functions ====================================================================== Refactor the Scorer class to support the Advanced Scoring Language ====================================================================== Integrate advanced query parser with the query processor. ====================================================================== Implement support for JoinSpec in Icing. ====================================================================== Implement the Advanced Scoring Language for basic functions and operators ====================================================================== Bug: 208654892 Bug: 249829533 Bug: 256022027 Bug: 261474063 Bug: 240333360 Bug: 193919210 Change-Id: I5f5bdc6249282ecc4b014b4fbdf8e2d1f8b20c19
Diffstat (limited to 'icing/query/query-processor.h')
-rw-r--r--icing/query/query-processor.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/icing/query/query-processor.h b/icing/query/query-processor.h
index f544a7a..a4f8973 100644
--- a/icing/query/query-processor.h
+++ b/icing/query/query-processor.h
@@ -15,12 +15,14 @@
#ifndef ICING_QUERY_QUERY_PROCESSOR_H_
#define ICING_QUERY_QUERY_PROCESSOR_H_
+#include <cstdint>
#include <memory>
#include "icing/text_classifier/lib3/utils/base/statusor.h"
#include "icing/index/index.h"
#include "icing/index/iterator/doc-hit-info-iterator-filter.h"
#include "icing/index/iterator/doc-hit-info-iterator.h"
+#include "icing/index/numeric/numeric-index.h"
#include "icing/proto/search.pb.h"
#include "icing/query/query-results.h"
#include "icing/query/query-terms.h"
@@ -45,9 +47,9 @@ class QueryProcessor {
// An QueryProcessor on success
// FAILED_PRECONDITION if any of the pointers is null.
static libtextclassifier3::StatusOr<std::unique_ptr<QueryProcessor>> Create(
- Index* index, const LanguageSegmenter* language_segmenter,
- const Normalizer* normalizer, const DocumentStore* document_store,
- const SchemaStore* schema_store);
+ Index* index, const NumericIndex<int64_t>* numeric_index,
+ const LanguageSegmenter* language_segmenter, const Normalizer* normalizer,
+ const DocumentStore* document_store, const SchemaStore* schema_store);
// Parse the search configurations (including the query, any additional
// filters, etc.) in the SearchSpecProto into one DocHitInfoIterator.
@@ -69,12 +71,23 @@ class QueryProcessor {
private:
explicit QueryProcessor(Index* index,
+ const NumericIndex<int64_t>* numeric_index,
const LanguageSegmenter* language_segmenter,
const Normalizer* normalizer,
const DocumentStore* document_store,
const SchemaStore* schema_store);
// Parse the query into a one DocHitInfoIterator that represents the root of a
+ // query tree in our new Advanced Query Language.
+ //
+ // Returns:
+ // On success,
+ // - One iterator that represents the entire query
+ // INVALID_ARGUMENT if query syntax is incorrect and cannot be tokenized
+ libtextclassifier3::StatusOr<QueryResults> ParseAdvancedQuery(
+ const SearchSpecProto& search_spec) const;
+
+ // Parse the query into a one DocHitInfoIterator that represents the root of a
// query tree.
//
// Returns:
@@ -90,6 +103,7 @@ class QueryProcessor {
// Not const because we could modify/sort the hit buffer in the lite index at
// query time.
Index& index_;
+ const NumericIndex<int64_t>& numeric_index_;
const LanguageSegmenter& language_segmenter_;
const Normalizer& normalizer_;
const DocumentStore& document_store_;