Adding a new searchableAttribute
should not re-index all the attributes
#4492
Labels
performance
Related to the performance in term of search/indexation speed or RAM/CPU/Disk consumption
settings diff-indexing
Issues related to settings diff-indexing
Related product team resources: PRD (internal only)
Summary
This issue is a subset of the work implementing the settings diff-indexing enhancement.
When adding a new
searchableAttribute
in the settings, Meilisearch re-indexes all thesearchableAttributes
as they were all new. This is mandatory because theword-pair-proximity-docids
,word-position-docids
, andword-docids
databases are field agnostic and compile the data of all the searchable fields, forcing Meilisearch to recompute all databases completely. Moreover,word-docids
andword-position-docids
have prefix databases that need to be updated:prefix-position-docids
, andprefix-docs
.word-pair-proximity-docids
Adding one or several
searchableAttributes
could be indexed by extracting the data from the additional attributes only.Then, when the data is written in the database for a specific word pair, all the proximities should be fetched, then:
See below a code sample explaining the idea:
word-position-docids
The
word-position-docids
database is additive when adding a searchable attribute, which means that processing only the additional attributes and making a union between the database data and the extracted data is valid.word-docids
As
word-position-docids
, theword-docids
database is additive, the same process is valid when adding one or several attributes to thesearchableAttributes
list.Prefix databases
As their non-prefix version, the prefix databases are additive, the same process is valid when adding one or several attributes to the
searchableAttributes
list.Related Benchmarks:
settings-proximity-precision.json
settings-remove-add-swap-searchable.json
settings-typo.json
TODO
Transform
filter the additional attributes when creating the flattened OBKV documentsword-pair-proximity-docids
word-position-docids
word-docids
The text was updated successfully, but these errors were encountered: