feat: Add declarative API for vector and full-text indexes#109
Merged
Conversation
Member
|
Two ideas. 1 It may be better to be: self.client.db_engine.create_vector_index("vec_idx_on_text_vec", Chunk.text_vec)2 Normally it is better to only have one way (or try best to have minimal ways) to achieve one thing, instead of several ways to achieve the same thing. Because the later one leads user to think, to choose, to learn difference, to have "best practice", which is a waste of time. (BTW this is the philosophy Golang follows). For this reason, possibly we only need two examples for now: A. Define a vector field (with vector index) using I do think it may be useful to create index lazily over an existing data. However we need to carefully think about under what scenario we can bring this feature to users. Needs some more work. The rest LGTM. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
close #89
close #103
Features
Declarative API:
VectorField.FullTextField.VectorIndex/FullTextIndexobjects in the__table_args__field of the TableModel to define indexes.Command API:
VectorIndex("vec_idx", table.text_vec).create(db_engine)Breaking changes
ADD_COLUMNAR_REPLICA_ON_DEMAND, it may not work properly with the OP version, which does not support theADD_COLUMNAR_REPLICA_ON_DEMANDsyntax.Example code
Define vector index via
VectorField(best practice)Manual create vector index
Define vector index via FullTextField (best practice)