Skip to content

Feat: Is there a way to perform complex queries in metadata filter ? #17150

Open
@hsiong

Description

@hsiong

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

We have encountered a limitation in metadata filtering during actual use. Suppose the metadata includes fields such as area and text.
Our intended logic is:
"(area contains 1,2,3 OR area IS NULL) and (text contains 4,5,6 OR text IS NULL)"
However, Dify currently only supports the following patterns:

  • OR logic across conditions:
    area contains 1,2,3 OR area IS NULL OR text contains 4,5,6 OR text IS NULL
  • AND login across conditions:
    area contains 1,2,3 AND area IS NULL AND text contains 4,5,6 AND text IS NULL

These patterns are not flexible enough to express the desired complex logic.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions