documentdb-full-text-search
Installation
SKILL.md
Full-Text Search — Azure DocumentDB ($search + createSearchIndexes)
Azure DocumentDB's full-text search is driven by search indexes built with the createSearchIndexes database command and queried through the $search aggregation stage. Scoring is BM25, exposed via $meta: "searchScore". The community $text operator and { field: "text" } index type are not the DocumentDB search path.
Key syntax points that differ from many blog posts and older docs:
- Index command is
createSearchIndexes(notcreateIndexes) — each index has anameand adefinition.mappings.fieldsblock;dynamic: falseis the safe default. - Custom analyzers live inside
definition.analyzersand are referenced per-field viaanalyzer/searchAnalyzer. $searchtargets an index by name viaindex: "<name>"— the engine does not auto-pick when multiple exist.- No
countfield inside$search— use a downstream{ $limit: N }stage. - No
compoundoperator yet — query one field at a time and merge in the application (seefts-multifield-index).