mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-12 10:04:14 -05:00
[PR #14907] [CLOSED] feat: Advanced search filters (before/after date based search, multiple tags) #10436
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/14907
Author: @Classic298
Created: 6/11/2025
Status: ❌ Closed
Base:
dev← Head:before-after-search-filter📝 Commits (3)
24de507merge (#10)b35f358Update chats.pydd688d5Update SearchModal.svelte📊 Changes
5 files changed (+272 additions, -178 deletions)
View changed files
📝
backend/open_webui/models/chats.py(+80 -120)📝
backend/open_webui/routers/chats.py(+29 -15)📝
src/lib/apis/chats/index.ts(+21 -2)📝
src/lib/components/layout/SearchModal.svelte(+49 -12)📝
src/lib/components/layout/Sidebar/SearchInput.svelte(+93 -29)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch. (Assumingdevbased on common practice)Changelog Entry
Description
This pull request enhances the chat search functionality in Open WebUI by
before:YYYY-MM-DDandafter:YYYY-MM-DDparameters.The implementation spans frontend UI components, API communication layers, and backend database query logic. Several minor bug fixes identified during development were also addressed.
Added
before:YYYY-MM-DDandafter:YYYY-MM-DDsyntax.tag:<tag_id>parameters can now be used simultaneously to find chats matching all specified tags.tag:withbefore:like so:tag:general before:2025-06-11)SearchInput.sveltenow suggestsbefore:andafter:parameters with descriptions.SearchModal.svelteparses these new parameters from the query string./api/v1/chats/search) updated to accepttags,before_date, andafter_datequery parameters.models/chats.pyupdated to filter chats based onupdated_attimestamps and multiple tags.Changed
SearchModal.svelte'sparseSearchQueryfunction updated to extract structured search terms (text, tags, before date, after date) from your input string.before: YYYY-MM-DDwere reverted to maintain stability, so no space is currently supported after the colon).apis/chats/index.ts):getChatListBySearchTextnow sends a structured object containing parsed search parameters to the backend.routers/chats.py):search_user_chatsendpoint signature changed to accept distinct query parameters for text, tags, before date, and after date.models/chats.py):get_chats_by_user_id_and_search_textmethod signature changed to accept distinct search parameters.updated_atfield.before:DATEincludesDATE(until 23:59:59 UTC), andafter:DATEincludesDATE(from 00:00:00 UTC).Additional Information
before:DATEandafter:DATEfilters operate on the chat'supdated_attimestamp. (This is the most logical approach in my opinion and is also logical from the added descriptive text for the two new parameters)Screenshots or Videos
(this is correct because the cutoff for the dates is always at midnight - searching "before:2025-06-11" would yield all chats updated BEFORE 2025-06-11 at 23:59 for example, and searching for "after:2025-06-11" will yield all chats updated AFTER 2025-06-11 00:01 for example)
Combining different search parameters for a more detailed search!
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.