Skip to content

_id collision when indexing with Genkit #1

Description

@dancarvajc

Hi there — I’m seeing this error when indexing with Genkit:

Document already exists with the given _id.

Looking at commit 3ad7b4f, I noticed you originally changed the behavior to avoid collisions (which makes sense), but then reverted it. As far as I can tell, the document _id is currently derived from the document content.

 _id: Md5.hashStr(JSON.stringify(embeddingDocs[j])),

Would it be possible to leave _id empty and let AstraDB generate a unique ID by default? In my use case, duplicate documents are likely to appear, and that’s fine for now — I’d just prefer not to fail on insert due to _id collisions.

Could you advise on how to enable auto-generated IDs with AstraDB in this flow, or enable the upset optionally to avoid these collisions?

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions