Skip to content

Conversation

@barnuri
Copy link

@barnuri barnuri commented Nov 19, 2025

This pull request adds support for passing additional vector index options to the vector search index definition and related functions in pymongo_search_utils/index.py. This enhancement makes it easier to customize vector index creation and updates with extra parameters.

Vector index customization

  • Added a new vector_index_options parameter to the vector_search_index_definition, create_vector_search_index, and update_vector_search_index functions to allow passing extra options for vector index configuration. [1] [2] [3]
  • Updated the construction of the vector index definition to include any provided options from vector_index_options, enabling more flexible index setup.
  • Ensured that the new vector_index_options parameter is properly forwarded when creating or updating vector search indexes, maintaining consistency and ease of use. [1] [2]

@blink1073
Copy link
Member

Thanks again for the PR! Can you please add a test to https://github.com/mongodb-labs/pymongo-search-utils/blob/main/tests/test_index.py?

@barnuri
Copy link
Author

barnuri commented Nov 20, 2025

@blink1073 done

@blink1073 blink1073 changed the title vector_index_options INTPYTHON-834 Allow additional arguments to vector_search_index_definition Nov 20, 2025
@blink1073
Copy link
Member

We're getting one failure:

FAILED tests/test_index.py::test_create_fulltext_search_index_multiple_fields - AssertionError: assert {'indexOption...pe': 'string'} == [{'type': 'string'}]
  
  Full diff:
  - [
  -     {
  + {
  +     'indexOptions': 'offsets',
  +     'norms': 'include',
  +     'store': True,
  -         'type': 'string',
  ? ----
  +     'type': 'string',
  + }
  -     },
  - ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants