-
Notifications
You must be signed in to change notification settings - Fork 238
feat: milvus document store #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
114 commits
Select commit
Hold shift + click to select a range
9226633
fix(plot): be robust against non-existing subindices
JohannesMessner 173c85c
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 499ac9a
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 61c4a95
chore: add file structure
JohannesMessner ef8dc0a
feat: first draft of backend implementation
JohannesMessner 4b1049e
feat: docarray can now connect to running milvus database
JohannesMessner 14d23d1
feat: implement basics of getsetdel and seqlike
JohannesMessner a7e4555
fix: type hint
JohannesMessner 5ce0bfd
fix: saving and loading offset2ids
JohannesMessner 74db70c
feat: first implementation of vector search
JohannesMessner b1e3bce
refactor: declare static methods
JohannesMessner 1a481af
feat: add consistency level as a configuration parameter
JohannesMessner ee50e51
feat: change default consistency to session
JohannesMessner 0ca783b
refactor: in clear_storage, drop and re-create collection
JohannesMessner f4a2eb0
feat: implement filter and hybrid search
JohannesMessner 7d7d9fb
feat: implement columns feature
JohannesMessner 69f589b
feat: allow consistency level to be passed to extend, append, insert
JohannesMessner 73cf538
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 8a75dce
fix: fix columns feature in milvus
JohannesMessner 76cc4b1
test: add test for milvus columns feature
JohannesMessner f3a5881
Merge branch 'main' into feat-milvus
JohannesMessner fb3f0b1
Merge remote-tracking branch 'origin/feat-milvus' into feat-milvus
JohannesMessner 6e35dcf
fix: import types for type hints
JohannesMessner 9abf9f5
fix: add pymilvus requirement
JohannesMessner 95529c3
test: fix docker compose for milvus
JohannesMessner 51dbbfe
Merge branch 'main' into feat-milvus
JohannesMessner fdab6e7
test: add milvus to test construct
JohannesMessner c000a90
fix: backend naming
JohannesMessner 0c1be5b
fix: sort returned docs when accessing by id
JohannesMessner 435e19d
test: add milvus to sequence tests
JohannesMessner 5a9fde6
Merge remote-tracking branch 'origin/feat-milvus' into feat-milvus
JohannesMessner 94e4a65
fix: raise keyerror on non existing id
JohannesMessner 061e01c
refactor: use context managar to laod and release collections
JohannesMessner c5e6b7e
fix: map embeddings to np before inserting
JohannesMessner f61dfda
test: add milvus to advanced indexing tests
JohannesMessner e9671ee
test: add milvus to test pull out
JohannesMessner ee8f40b
fix: deleting to size zero
JohannesMessner b1c6a88
fix: when accessing with no ids, return empty da instead of rasing
JohannesMessner 4a4d1c8
test: add milvus to content tests
JohannesMessner 479d0f7
test: add milvus to del tests
JohannesMessner a71cab2
test: add milvus to embed tests
JohannesMessner d16468a
test: add milvus to test empty
JohannesMessner ec10d41
test: add milvus to test eval class
JohannesMessner f7d0a3b
test: add milvus to test find
JohannesMessner 7aa6895
test: add milvus to getset tests
JohannesMessner 85513b8
test: add milvus to all remaining tests
JohannesMessner 20b19a9
feat: load and release collection in context manager
JohannesMessner c735702
test: use context manager to speed up milvus tests
JohannesMessner d5c0221
test: add milvus to test plot
JohannesMessner bb4185a
Merge branch 'main' into feat-milvus
JohannesMessner eefbe31
test: fix plot tests for milvus
JohannesMessner 5bd9211
test: fix multimodal find test
JohannesMessner 0cab46d
test: fix test embed
JohannesMessner d4a5f36
test: use context manager to speed up milvus
JohannesMessner 363bc08
fix: implement state methods to enable pickling
JohannesMessner 161dc1f
test: fix more tests
JohannesMessner 7831b77
feat: add overloaded milvus init
JohannesMessner 21126da
test: fix even more tests
JohannesMessner f0832db
refactor: remove some comments
JohannesMessner ee310da
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 29d22e7
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 28e371c
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 84f4bb0
test: use context manager even more
JohannesMessner 3bdfbb4
test: moar context manager usage
JohannesMessner 752eb7e
test: fix test fixture input
JohannesMessner 8b7b9a4
test: remove milvus from test that it can't handle
JohannesMessner 8f15868
test: remove milvus from one more test
JohannesMessner 4f97db9
refactor: better mechanism for automatic collection loading
JohannesMessner c4fcf4c
docs: add docs section for milvus
JohannesMessner 7569c6d
chore: remove comment
JohannesMessner b44c326
fix: enforce limit for filter only queries
JohannesMessner 6496a4c
docs: fix typo
JohannesMessner 83d8ba0
docs: add milvus to comparison and add docstring
JohannesMessner e003618
feat: bulk extend
JohannesMessner fa4c070
docs: document advanced milvus options
JohannesMessner 9dd3b74
feat: allo passing of kwargs to insert
JohannesMessner 20da30b
chore: remove comment
JohannesMessner 6d9dfe5
chore: update accepted array types
JohannesMessner 0b659c8
test: add milvus specific tests
JohannesMessner 3bf691f
docs: apply changes from code review
JohannesMessner 6ba7fac
docs: update docs/advanced/document-store/milvus.md
JohannesMessner e021866
refactor: update type hint
JohannesMessner 50752ce
refactor: apply suggestions from code review
JohannesMessner 1c20cee
Merge remote-tracking branch 'origin/feat-milvus' into feat-milvus
JohannesMessner 4c7df10
docs: clarify docstring
JohannesMessner af8dddd
docs: fix fautly docstring
JohannesMessner fea7c28
Merge branch 'main' into feat-milvus
JohannesMessner 686fef0
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 91ec3bb
refactor: another round of review changes
JohannesMessner 5c026d7
Merge remote-tracking branch 'origin/feat-milvus' into feat-milvus
JohannesMessner 4920635
fix: set consistency level for offset id loading
JohannesMessner cb4a39c
fix: set stricter defaut consistency level
JohannesMessner a103eae
Merge branch 'main' into feat-milvus
JohannesMessner 30bd965
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 9b47d2c
Merge branch 'main' into feat-milvus
JohannesMessner 4b9e473
perf: optimize sorting of retrieved documents
JohannesMessner 70828e4
docs: document loading context manager
JohannesMessner d672398
refactor: find unboxing done by base class
JohannesMessner 00b4de4
feat: add batching
JohannesMessner b45d214
test: add test for batch size
JohannesMessner e75c57f
Merge remote-tracking branch 'origin/main' into main
JohannesMessner c1b09ab
Merge branch 'main' into feat-milvus
JohannesMessner 3055e63
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 697e513
Merge remote-tracking branch 'origin/main' into main
JohannesMessner 26df898
Merge branch 'main' into feat-milvus
JohannesMessner 005b2e5
test: restart milvus if it breaks
JohannesMessner 012d01d
test: dont remove-orphans where it is not needed
JohannesMessner 412d79e
feat: add ability to disble list like behaviour
JohannesMessner acf832a
Merge branch 'main' into feat-milvus
JohannesMessner 528035e
Merge branch 'main' into feat-milvus
JohannesMessner dcad639
ci: increase timeout to see how long it really takes
JohannesMessner 3aecd6b
docs: apply suggestions from code review
JohannesMessner 14c4a8f
ci: change timeouts
JohannesMessner 83aebca
Merge branch 'main' into feat-milvus
JohannesMessner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| from .document import DocumentArray | ||
|
|
||
| from .storage.milvus import StorageMixins, MilvusConfig | ||
|
|
||
| __all__ = ['MilvusConfig', 'DocumentArrayMilvus'] | ||
|
|
||
|
|
||
| class DocumentArrayMilvus(StorageMixins, DocumentArray): | ||
| """ | ||
| DocumentArray that stores Documents in a `Milvus <https://milvus.io//>`_ vector search engine. | ||
|
|
||
| .. note:: | ||
| This DocumentArray requires `pymilvus`. You can install it via `pip install "docarray[milvus]"`. | ||
|
|
||
| To use Milvus as storage backend, a Milvus service needs to be running on your machine. | ||
|
|
||
| With this implementation, :meth:`match` and :meth:`find` perform fast (approximate) vector search. | ||
| Additionally, search with filters is supported. | ||
|
|
||
| Example usage: | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| from docarray import DocumentArray | ||
|
|
||
| # connect to running Milvus service with default configuration (address: http://localhost:19530) | ||
| da = DocumentArray(storage='milvus', config={'n_dim': 10}) | ||
|
|
||
| # connect to a previously persisted DocumentArrayMilvus by specifying collection_name, host, and port | ||
| da = DocumentArray( | ||
| storage='milvus', | ||
| config={ | ||
| 'collection_name': 'persisted', | ||
| 'host': 'localhost', | ||
| 'port': '19530', | ||
| 'n_dim': 10, | ||
| }, | ||
| ) | ||
|
|
||
|
|
||
| .. seealso:: | ||
| For further details, see our :ref:`user guide <milvus>`. | ||
| """ | ||
|
|
||
| def __new__(cls, *args, **kwargs): | ||
| return super().__new__(cls) |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from abc import ABC | ||
|
|
||
| from .backend import BackendMixin, MilvusConfig | ||
| from .find import FindMixin | ||
| from .getsetdel import GetSetDelMixin | ||
| from .seqlike import SequenceLikeMixin | ||
|
|
||
| __all__ = ['StorageMixins', 'MilvusConfig'] | ||
|
|
||
|
|
||
| class StorageMixins(FindMixin, BackendMixin, GetSetDelMixin, SequenceLikeMixin, ABC): | ||
| ... |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.