Skip to content

Conversation

@barnuri
Copy link
Contributor

@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?

Copilot AI and others added 3 commits November 20, 2025 07:24
Co-authored-by: barnuri <13019522+barnuri@users.noreply.github.com>
Add tests for new index.py functionality
@barnuri
Copy link
Contributor 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',
  + }
  -     },
  - ]

@barnuri
Copy link
Contributor Author

barnuri commented Nov 23, 2025

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',
  + }
  -     },
  - ]

fixed

@blink1073 blink1073 closed this Nov 24, 2025
@blink1073 blink1073 reopened this Nov 24, 2025
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@blink1073 blink1073 merged commit c7e1488 into mongodb-labs:main Nov 24, 2025
14 checks passed
@barnuri barnuri deleted the patch-1 branch November 24, 2025 13:41
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