[PR #7663] Search items: Support sql-like for each word of searchTerm #11488

Closed
opened 2026-02-07 06:39:21 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/jellyfin/jellyfin/pull/7663

State: closed
Merged: No


Introduction

Can't find Mr. Robot by searching for mr robot?
You are not the only one!
Don't worry, i made this PR also for those who don't follow the hacker's path 😄

In fact, looking at this issue ( #1674 ), I also began to notice that if the titles contain punctuation or particular characters, these must be specified in the search for it to be successful. Clearly not good!

When searching for titles that include characters like . , " In the middle (but omitting them from searchTerm), the query fails (to find).

To give some examples:

  • Searching for Mr Robot does not find Mr. Robot "
  • Searching for Flash point does not find "Flash", point ...
    and so on ( some more examples in the issue #1674 )... :)

Changes

To overcome the problem, I introduced a third and final LIKE on the items query (SqliteItemRepository.cs).
This acts, like the previous one, on the CleanName and OriginalTitle columns.

When my piece of query kicks in?

  • If the searchTerm is longer than 1
  • and if the searchTerm contains 2 or more separate words

My idea is to search with the "LIKE" but applied to each single word (both sides).

What about now?

Example
Eg. the searchTerm Mr Robot becomes %Mr%Robot%, thus correctly extracts:

  • Mr. Robot
  • Mr Robot
  • Mr - Robot
  • Mr, Robot
  • Mr "Robot"
    etc

Cool effect in the meantime
Furthermore, in this way it becomes possible to extract also by acronym ( not bad imo :) )

Eg. b b t extracts The Big Bang Theory.

Issues

fix #1674


Just my second PR on this repo 😄

I do not think that what I have done hides dark sides and I am convinced that the search experience is now simpler, intuitive and functional!

If you think it may hide any weaknesses, I would like to discuss it :)
I'm avaliable for anything!
(i'm in the chat rooms as @doc-code)

**Original Pull Request:** https://github.com/jellyfin/jellyfin/pull/7663 **State:** closed **Merged:** No --- ## Introduction Can't find `Mr. Robot` by searching for `mr robot`? You are not the only one! _Don't worry, i made this PR also for those who don't follow the hacker's path 😄_ _In fact, looking at [this issue](https://github.com/jellyfin/jellyfin/issues/1674) ( #1674 ), I also began to notice that if the titles contain punctuation or particular characters, these must be specified in the search for it to be successful._ **_Clearly not good!_** When searching for titles that include characters like `.` `,` `"` In the middle (but omitting them from searchTerm), the query fails (to find). To give some examples: - Searching for `Mr Robot` does not find `Mr. Robot` " - Searching for `Flash point` does not find `"Flash", point ...` _and so on ( some more examples in the issue #1674 )..._ :) ## Changes To overcome the problem, I introduced a third and final LIKE on the items query (`SqliteItemRepository.cs`). _This acts, like the previous one, on the CleanName and OriginalTitle columns._ When my piece of query kicks in? - If the `searchTerm` is longer than `1` - and if the `searchTerm` contains 2 or more `separate words` My idea is to search with the "**_LIKE_**" but **_applied to each single word (both sides)_**. ### What about now? **Example** Eg. the searchTerm `Mr Robot` becomes `%Mr%Robot%`, thus correctly extracts: - `Mr. Robot` - `Mr Robot` - `Mr - Robot` - `Mr, Robot` - `Mr "Robot"` _etc_ **Cool effect in the meantime** Furthermore, in this way it becomes possible to extract also by acronym ( not bad imo :) ) Eg. `b b t` extracts `The Big Bang Theory`. ## Issues fix #1674 --- Just my second PR on this repo 😄 I do not think that what I have done hides dark sides and I am convinced that the search experience is now simpler, intuitive and functional! If you think it may hide any weaknesses, I would like to discuss it :) I'm avaliable for anything! _(i'm in the chat rooms as `@doc-code`)_
OVERLORD added the pull-request label 2026-02-07 06:39:21 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#11488