Ineffective Metadata Filters with Full-Text Search Mode in Tencent Cloud Vector Database #15965

Closed
opened 2026-02-21 19:24:09 -05:00 by yindo · 1 comment
Owner

Originally created by @dlmu-lq on GitHub (Aug 7, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.7.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Use Tencent Cloud Vector Database.
  2. Add a manual metadata filter on the knowledge base (e.g., filtering by document_name).
  3. Set the retrieval mode to full-text search.
  4. Observe that the filter conditions are not being applied.

✔️ Expected Behavior

The manual metadata filter should work correctly and apply the specified conditions during retrieval, even in full-text search mode.

Actual Behavior

The filter conditions are not being applied when the full-text search mode is selected for retrieval.

Originally created by @dlmu-lq on GitHub (Aug 7, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.7.1 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce 1. Use Tencent Cloud Vector Database. 2. Add a manual metadata filter on the knowledge base (e.g., filtering by document_name). 3. Set the retrieval mode to full-text search. 4. Observe that the filter conditions are not being applied. ### ✔️ Expected Behavior The manual metadata filter should work correctly and apply the specified conditions during retrieval, even in full-text search mode. ### ❌ Actual Behavior The filter conditions are not being applied when the full-text search mode is selected for retrieval.
yindo added the 👻 feat:rag label 2026-02-21 19:24:09 -05:00
yindo closed this issue 2026-02-21 19:24:09 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 7, 2025):

This is a known limitation in Dify: metadata filters are not applied when using full-text search mode with Tencent Cloud Vector Database. The technical reason is that the search_by_full_text method in the TencentVector class does not accept or apply any metadata filter parameter, unlike the vector search method which does support filters. As a result, any metadata filtering logic is ignored during full-text search, which matches your observation see code reference.

If you need metadata filtering, you’ll need to use vector search mode for now. There’s no evidence in the latest code or recent pull requests that this gap has been addressed for full-text search mode with Tencent Cloud Vector Database. You may want to monitor future releases or consider contributing a feature request if this is critical for your use case.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 7, 2025): <!-- Answer --> This is a known limitation in Dify: metadata filters are not applied when using full-text search mode with Tencent Cloud Vector Database. The technical reason is that the `search_by_full_text` method in the TencentVector class does not accept or apply any metadata filter parameter, unlike the vector search method which does support filters. As a result, any metadata filtering logic is ignored during full-text search, which matches your observation [see code reference](https://github.com/langgenius/dify/blob/305ea0a2d5b67fc993082952178ecaa09b518c20/api/core/rag/datasource/vdb/tencent/tencent_vector.py). If you need metadata filtering, you’ll need to use vector search mode for now. There’s no evidence in the latest code or recent pull requests that this gap has been addressed for full-text search mode with Tencent Cloud Vector Database. You may want to monitor future releases or consider contributing a feature request if this is critical for your use case. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/c131482a-f4da-40d6-8c58-18fdf4436299?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c131482a-f4da-40d6-8c58-18fdf4436299?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c131482a-f4da-40d6-8c58-18fdf4436299?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c131482a-f4da-40d6-8c58-18fdf4436299?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c131482a-f4da-40d6-8c58-18fdf4436299?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c131482a-f4da-40d6-8c58-18fdf4436299?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c131482a-f4da-40d6-8c58-18fdf4436299?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/23563)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15965