mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #7663] Search items: Support sql-like for each word of searchTerm #11488
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?
Original Pull Request: https://github.com/jellyfin/jellyfin/pull/7663
State: closed
Merged: No
Introduction
Can't find
Mr. Robotby searching formr 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:
Mr Robotdoes not findMr. Robot"Flash pointdoes 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?
searchTermis longer than1searchTermcontains 2 or moreseparate wordsMy idea is to search with the "LIKE" but applied to each single word (both sides).
What about now?
Example
Eg. the searchTerm
Mr Robotbecomes%Mr%Robot%, thus correctly extracts:Mr. RobotMr RobotMr - RobotMr, RobotMr "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 textractsThe 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)