[PR #26042] feat: add search input for Knowledge Retrieval dataset selector #31321

Open
opened 2026-02-21 20:49:14 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/26042

State: open
Merged: No


Important

Please make sure you have read our contribution guidelines
Be sure to check existing issues to avoid duplicates

Summary

I’d like to propose a new feature: add a search input for the document selector in the Knowledge Retrieval node. This will allow users to type keywords to filter the list of available documents (by name, metadata, etc.) rather than scrolling through a long dropdown/list.

Motivation & Context

  • When a knowledge base has many documents, picking the right one manually is tedious.
  • Search will improve user experience, making workflows faster and more intuitive.
  • This aligns with existing metadata filtering, but adds another dimension for usability.

Description of the Proposed Change

  • Add a search box in frontend component for document selector under Knowledge Retrieval node.
  • When user types into search, frontend calls a backend API to fetch matching documents.
  • Display filtered list of documents accordingly.
  • Maintain compatibility with existing filters and metadata-based selection.

Example API Usage

Here is an example of how the frontend might call the backend API for document listing + search:
curl --request GET
--url 'https://your-dify-domain/v1/datasets?page=1&limit=20&keyword=abc'
--header 'Authorization: Bearer YOUR_TOKEN_HERE'
page: pagination page
limit: number of items per page
keyword: search term entered by user to filter dataset/document names
Acceptance Criteria
User can type keyword(s) into search field.
Matching documents are fetched and displayed in the selector.
Result updates as user types (with debounce or similar mechanism).
If no keyword, show full list (or reasonable default subset).
Behavior works correctly in combination with metadata filters.
UI is responsive, no breaking layout or performance issues.

Ảnh màn hình 2025-09-22 lúc 15 10 10
**Original Pull Request:** https://github.com/langgenius/dify/pull/26042 **State:** open **Merged:** No --- > [!IMPORTANT] > Please make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > Be sure to check existing issues to avoid duplicates ### Summary I’d like to propose a new feature: add a **search input** for the document selector in the **Knowledge Retrieval node**. This will allow users to type keywords to filter the list of available documents (by name, metadata, etc.) rather than scrolling through a long dropdown/list. ### Motivation & Context - When a knowledge base has many documents, picking the right one manually is tedious. - Search will improve user experience, making workflows faster and more intuitive. - This aligns with existing metadata filtering, but adds another dimension for usability. ### Description of the Proposed Change - Add a search box in frontend component for document selector under Knowledge Retrieval node. - When user types into search, frontend calls a backend API to fetch matching documents. - Display filtered list of documents accordingly. - Maintain compatibility with existing filters and metadata-based selection. ### Example API Usage Here is an example of how the frontend might call the backend API for document listing + search: curl --request GET \ --url 'https://your-dify-domain/v1/datasets?page=1&limit=20&keyword=abc' \ --header 'Authorization: Bearer YOUR_TOKEN_HERE' page: pagination page limit: number of items per page keyword: search term entered by user to filter dataset/document names Acceptance Criteria User can type keyword(s) into search field. Matching documents are fetched and displayed in the selector. Result updates as user types (with debounce or similar mechanism). If no keyword, show full list (or reasonable default subset). Behavior works correctly in combination with metadata filters. UI is responsive, no breaking layout or performance issues. <img width="1918" height="904" alt="Ảnh màn hình 2025-09-22 lúc 15 10 10" src="https://github.com/user-attachments/assets/1c1cc648-b7b7-4479-85f5-b47576846fb8" />
yindo added the pull-request label 2026-02-21 20:49:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#31321