feat(query): Inverted index support set filters and index record options #15254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
estimated memory
display format inexplain memo
, so that we don't need to change the test result when thePushDownInfo
struct changes.Filters
the tokenizer can add several types of filters
english_stop
: removes English stop words, likea
,an
,the
, etc.english_stemmer
: maps different forms of the same word to a common word, for example,walking
andwalked
will be mapped towalk
.chinese_stop
: remove the Chinese stop word, which currently only supports Chinese punctuations, like,
,。
, etc.In addition to these optional filters, the tokenizer adds the
lowercase
filter by default, converting all terms to lowercase so that the search can match all the rows regardless of whether it is uppercase or lowercase.Users can set filters as required. and multiple filters need to be separated by commas
,
.Filters can make search match the data to be queried more accurately, but setting more filters can also make index refresh a little slower.
Index record
There are three types of index records that support different needs.
basic
: only storesDocId
, takes up minimal space, but can't search for phrase terms, like"quick brown fox"
.freq
: storeDocId
and term frequency, takes up medium space, and also can't search for phrase terms, but can give better scoring.position
: storeDocId
, term frequency, and positions, take up most space, have better scoring, and can search for phrase terms.To support more sophisticated queries, the index record uses
position
by default. Users who want to reduce the size of the index file and do not need to search for phrase terms can choosefreq
. And if the user is not very concerned about the match score of the search term, can choosebasic
.for example
part of #14825
Tests
Type of change
This change is