mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature, Perf ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description ### Introduce new field "**exact**" in vector search spec to specify whether to run ENN or ANN search. [exact field spec](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/#fields) ### Value can be one of the following, defaults to false. - false - to run ANN search - true - to run ENN search ### Example `{ "k": 1, "path": "vect", "filter": {"attr": {"$eq":1}}, "exact": true, "efSearch": 40 }` ---- #### AI description (iteration 1) #### PR Classification Code enhancement for filter selectivity in vector search queries. #### PR Summary This pull request enhances the filter selectivity mechanism in vector search queries by adding new functions and improving existing ones. - `bson_aggregation_vector_search.c`: Added functions to calculate filter selectivity and handle vector search options, including `AddEmptySearchParamFunctionToQuery` and `GetFilterSelectivity`. - `index_support.c`: Added logic to identify vector search queries in the planner. - `system_configs.c`: Introduced new configuration variables for maximum filter selectivity and document count. - `documents_planner.c`: Enhanced planner to handle vector search queries based on selectivity. - `vector_common.h`: Declared new configuration variables for vector filter runtime sort selectivity and document count. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->