-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance MilvusVectorStore with flexible index management (#15058)
- Loading branch information
1 parent
a93c1b6
commit 734e657
Showing
4 changed files
with
164 additions
and
73 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...-index-integrations/vector_stores/llama-index-vector-stores-milvus/CHANGELOG.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Changelog | ||
|
||
## [v0.1.22] | ||
|
||
### Added | ||
|
||
- Introduced a new `IndexManagement` enum to control index creation behavior: | ||
- `NO_VALIDATION`: Skips index validation and creation. | ||
- `CREATE_IF_NOT_EXISTS`: Creates the index only if it doesn't exist (default behavior). | ||
- Added a new `index_management` parameter to the `MilvusVectorStore` constructor, allowing users to specify the desired index management strategy. | ||
|
||
### Changed | ||
|
||
- Updated the collection creation and index management logic in `_create_hybrid_index` to ensure proper sequence of operations. | ||
- Refactored index creation logic to respect the new `index_management` setting. | ||
|
||
### Fixed | ||
|
||
- Resolved an issue where the collection object was potentially being recreated after index creation, which could lead to inconsistencies. | ||
- Ensured that the collection is created before any index operations are attempted in hybrid mode. | ||
|
||
### Improved | ||
|
||
- Streamlined the process of collection creation and index management for hybrid (dense and sparse) vector operations. | ||
- Provided more control over index creation behavior through the `index_management` parameter. | ||
|
||
### Developer Notes | ||
|
||
- The `_create_index_if_required` method now checks the `index_management` setting before proceeding with index creation or validation. | ||
- The `_create_index_if_required` method now passes `self.collection_name` to `_create_hybrid_index` when in sparse mode. | ||
- No changes to the existing public API of `MilvusVectorStore` were made; the `index_management` parameter is an addition to the constructor. | ||
|
||
### Upgrade Notes | ||
|
||
- This change is backwards compatible. Existing code using `MilvusVectorStore` without specifying `index_management` will default to the previous behavior (`CREATE_IF_NOT_EXISTS`). | ||
- Users can now optionally specify an `index_management` strategy when initializing `MilvusVectorStore` to control index creation behavior. |
4 changes: 2 additions & 2 deletions
4
...ctor_stores/llama-index-vector-stores-milvus/llama_index/vector_stores/milvus/__init__.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from llama_index.vector_stores.milvus.base import MilvusVectorStore | ||
from llama_index.vector_stores.milvus.base import MilvusVectorStore, IndexManagement | ||
|
||
__all__ = ["MilvusVectorStore"] | ||
__all__ = ["MilvusVectorStore", "IndexManagement"] |
This file contains 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
This file contains 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