v6: Create vector index Vectorizer-first style #406
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Users are more likely to select a vectorizer on collection creation and postpone vector index configuration until some later point in time. Our goal then is to surface vectorizer configuration and push vector index config a level deeper in the configuration so as to avoid information overload.
The new API becomes very expressive:
with a possibility to configure a different vector index by passing a
.vectorIndex()parameter.Vectorizersis a separate class which holds static constructors for all available vectorizers, similarly to howIteratorshelps createIteratorinstances.Vectorizers.none()returns aMap.Entry<String, Vectorizer>to allow creating named vectors without storing the name in the vectorizer object itself. Hopefully that's not too awkward.CollectionConfig.Builderalso has a method which accepts aMap<String, Vectorizer>in case a user needs to pass them all at once.Finally, I had to update some test cases in
JSONTestto reflect that fact that each vectorizer now inevitably carries the vector index config.The default vector index type is HNSW and the default name is 'default'.