Skip to content
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

feat: Support MetadataFilters for Milvus and SimpleVectorStore #1033

Merged

Conversation

thucpn
Copy link
Collaborator

@thucpn thucpn commented Jul 11, 2024

  • Mark ExactMatchFilter as deprecated and use MetadataFilter with many supported operations
  • Support OR and AND condition
  • Support new operators: EQ, IN
  • Add filtering for MilvusVectorStore first
  • Support more operators
  • Add tests and examples with all operators for SimpleVectorStore and Milvus

Sample filter:

const queryEngineOR = index.asQueryEngine({
    preFilters: {
      filters: [
        {
          key: "private",
          value: "false",
          operator: "==",
        },
        {
          key: "dogId",
          value: ["1", "3"],
          operator: "in",
        },
      ],
      condition: "or",
    }
  });

Copy link

vercel bot commented Jul 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
llama-index-ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2024 6:43am

Copy link

changeset-bot bot commented Jul 11, 2024

🦋 Changeset detected

Latest commit: 03b0bae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
llamaindex Patch
@llamaindex/llamaindex-test Patch
docs Patch
@llamaindex/experimental Patch
@llamaindex/cloudflare-worker-agent-test Patch
@llamaindex/next-agent-test Patch
@llamaindex/nextjs-edge-runtime-test Patch
@llamaindex/next-node-runtime-test Patch
@llamaindex/waku-query-engine-test Patch
@llamaindex/autotool-02-next-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@thucpn thucpn marked this pull request as ready for review July 11, 2024 08:22
@thucpn thucpn marked this pull request as draft July 11, 2024 08:23
Copy link

pkg-pr-new bot commented Jul 11, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

commit: 03b0bae

@llamaindex/autotool

npm i https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/autotool@1033

@llamaindex/cloud

npm i https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/cloud@1033

@llamaindex/community

npm i https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/community@1033

@llamaindex/core

npm i https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/core@1033

@llamaindex/env

npm i https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/env@1033

@llamaindex/experimental

npm i https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/experimental@1033

llamaindex

npm i https://pkg.pr.new/run-llama/LlamaIndexTS/llamaindex@1033

@llamaindex/wasm-tools

npm i https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/wasm-tools@1033


templates

@@ -20,19 +20,51 @@ export enum VectorStoreQueryMode {
MMR = "mmr",
}

/**
* @deprecated Use MetadataFilter with operator EQ instead
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if deprecated, must be supported by VectorStoreQuerySpec

@marcusschiesser marcusschiesser changed the title feat: support filter for vectordbs feat: Support MetadataFilters for Milvus and SimpleVectorStore Jul 15, 2024
@marcusschiesser marcusschiesser merged commit 496051a into feat/enhance-filter-for-query Jul 17, 2024
4 checks passed
@marcusschiesser marcusschiesser deleted the feat/support-filter-for-vectordb branch July 17, 2024 08:39
marcusschiesser added a commit that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants