FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: support update for inmemory index · Issue #1725 · docarray/docarray · GitHub

feat: support update for inmemory index #1725

Description

InMemoryExactNNIndex does not support update

from docarray.index import InMemoryExactNNIndex
from docarray import BaseDoc

class MyDoc(BaseDoc):
    text: str


data = [MyDoc(text=f'text {i}') for i in range(10)]
doc_index = InMemoryExactNNIndex[MyDoc]()
doc_index.index(data)

assert doc_index.num_docs() == 10

for doc in data:
    doc.text = doc.text + 'smth'

doc_index.index(data)

assert doc_index.num_docs() == 10

Instead of updating the same 10 docs, it would extend existing docs with the same 10 docs.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL