[GH-ISSUE #2298] Filter by source in query language #1404

Closed
opened 2026-03-02 11:57:04 +03:00 by kerem · 2 comments
Owner

Originally created by @lmgarret on GitHub (Dec 23, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2298

Describe the feature you'd like

Hello! A nice follow up to #2036 would be to allow filtering in the smart lists by source ("api", "web", "cli", "mobile", "singlefile", "rss").
It may also make sense to add this condition to the rule engine.

Describe the benefits this would bring to existing Karakeep users

I'm looking to replace my current RSS reader with Karakeep. But I also want to keep using it for bookmark keeping.
One way to keep a segregation between links I manually saved vs rss-provided ones could be through smart lists, having a source:rss on one list to use it as my news feed and -source:rss on others for bookmark keeping

Can the goal of this request already be achieved via other means?

It could be possible to do the distinction based on the feed:<name> query qualifier, but one would have to write all the existing feeds in the filter. And adding a new feed would require updating the query

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

Additional context

I saw the related issues but thought it made sense to create a new one since the suggested solution differs:

  • #1536 : we wouldn't be using tags
  • #1535 : it would offer a possible solution to this issue, by using a feed:.* filter. But it's a way bigger scope
Originally created by @lmgarret on GitHub (Dec 23, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2298 ### Describe the feature you'd like Hello! A nice follow up to #2036 would be to allow filtering in the smart lists by source (`"api", "web", "cli", "mobile", "singlefile", "rss"`). It may also make sense to add this condition to the rule engine. ### Describe the benefits this would bring to existing Karakeep users I'm looking to replace my current RSS reader with Karakeep. But I also want to keep using it for bookmark keeping. One way to keep a segregation between links I manually saved vs rss-provided ones could be through smart lists, having a `source:rss` on one list to use it as my news feed and `-source:rss` on others for bookmark keeping ### Can the goal of this request already be achieved via other means? It could be possible to do the distinction based on the `feed:<name>` query qualifier, but one would have to write all the existing feeds in the filter. And adding a new feed would require updating the query ### Have you searched for an existing open/closed issue? - [x] I have searched for existing issues and none cover my fundamental request ### Additional context I saw the related issues but thought it made sense to create a new one since the suggested solution differs: - #1536 : we wouldn't be using tags - #1535 : it would offer a possible solution to this issue, by using a `feed:.*` filter. But it's a way bigger scope
Author
Owner

@MohamedBassem commented on GitHub (Dec 23, 2025):

Yeah, this can be useful indeed.

@claude implement this FR

<!-- gh-comment-id:3687353207 --> @MohamedBassem commented on GitHub (Dec 23, 2025): Yeah, this can be useful indeed. @claude implement this FR
Author
Owner

@claude[bot] commented on GitHub (Dec 23, 2025):

Claude finished @MohamedBassem's task in 4m 10s —— View jobclaude/issue-2298-20251223-1704Create PR ➔


Implementation Complete!

I've successfully implemented the source filter for the query language. This feature allows filtering bookmarks by their source (api, web, cli, mobile, extension, singlefile, rss, import).

Changes Made

  • Add source matcher type to search types (packages/shared/types/search.ts:91-95)
  • Add source to query parser lexer (packages/shared/searchQueryParser.ts:44)
  • Implement source case handler in parser (packages/shared/searchQueryParser.ts:227-235)
  • Add database query logic for source filtering (packages/trpc/lib/search.ts:376-387)
  • Add comprehensive tests for source filter parsing (packages/shared/searchQueryParser.test.ts:335-370)
  • Update documentation with source qualifier examples (docs/docs/04-using-karakeep/search-query-language.md:39)

Usage Examples

Users can now use queries like:

# Find bookmarks from RSS feeds
source:rss

# Find bookmarks NOT from RSS (e.g., manually saved)
-source:rss

# Find bookmarks from the web interface
source:web

# Combine with other filters
is:fav source:rss title:important

This directly addresses the use case mentioned in the issue - allowing users to segregate RSS content from manually saved bookmarks using smart lists!

Next Steps

--- |

<!-- gh-comment-id:3687354006 --> @claude[bot] commented on GitHub (Dec 23, 2025): **Claude finished @MohamedBassem's task in 4m 10s** —— [View job](https://github.com/karakeep-app/karakeep/actions/runs/20466850371) • [`claude/issue-2298-20251223-1704`](https://github.com/karakeep-app/karakeep/tree/claude/issue-2298-20251223-1704) • [Create PR ➔](https://github.com/karakeep-app/karakeep/compare/main...claude/issue-2298-20251223-1704?quick_pull=1&title=feat%3A%20add%20source%20filter%20to%20query%20language&body=Add%20support%20for%20filtering%20bookmarks%20by%20source%20in%20the%20search%20query%20language.%0A%0AUsers%20can%20now%20use%20%60source%3A%3Cvalue%3E%60%20to%20filter%20bookmarks%20by%20their%20source%20%28api%2C%20web%2C%20cli%2C%20mobile%2C%20extension%2C%20singlefile%2C%20rss%2C%20import%29.%0A%0AThis%20allows%20users%20to%20segregate%20content%2C%20for%20example%20using%20%60source%3Arss%60%20to%20create%20a%20news%20feed%20list%20and%20%60-source%3Arss%60%20to%20exclude%20RSS%20items%20from%20bookmark%20keeping%20lists.%0A%0AFixes%20%232298%0A%0A---%0A%0AGenerated%20with%20%5BClaude%20Code%5D%28https%3A%2F%2Fclaude.ai%2Fcode%29) --- ### Implementation Complete! ✅ I've successfully implemented the `source` filter for the query language. This feature allows filtering bookmarks by their source (api, web, cli, mobile, extension, singlefile, rss, import). #### Changes Made - [x] Add `source` matcher type to search types (packages/shared/types/search.ts:91-95) - [x] Add `source` to query parser lexer (packages/shared/searchQueryParser.ts:44) - [x] Implement `source` case handler in parser (packages/shared/searchQueryParser.ts:227-235) - [x] Add database query logic for source filtering (packages/trpc/lib/search.ts:376-387) - [x] Add comprehensive tests for source filter parsing (packages/shared/searchQueryParser.test.ts:335-370) - [x] Update documentation with source qualifier examples (docs/docs/04-using-karakeep/search-query-language.md:39) #### Usage Examples Users can now use queries like: ```plaintext # Find bookmarks from RSS feeds source:rss # Find bookmarks NOT from RSS (e.g., manually saved) -source:rss # Find bookmarks from the web interface source:web # Combine with other filters is:fav source:rss title:important ``` This directly addresses the use case mentioned in the issue - allowing users to segregate RSS content from manually saved bookmarks using smart lists! #### Next Steps --- |
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1404
No description provided.