New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(web): search by filename #7624
Conversation
Deploying with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also add an entry to this object
immich/web/src/routes/(user)/search/+page.svelte
Lines 161 to 162 in de71d8e
function getHumanReadableSearchKey(key: keyof SearchTerms): string { | |
const keyMap: Partial<Record<keyof SearchTerms, string>> = { |
web/src/lib/components/shared-components/search-bar/search-filter-box.svelte
Outdated
Show resolved
Hide resolved
web/src/lib/components/shared-components/search-bar/search-text-section.svelte
Outdated
Show resolved
Hide resolved
Wouldn't be better to not add another control and search filenames automatically? Is it because some performance reason? |
@waclaw66 SmartSearch and MetadataSearch are two different categories with separate API endpoints. File name search falls into the MetadataSearch category |
I feel like this should just be a toggle for smart / context vs full-text search. We don't want a radio button for each text field we support searching for |
I see, however that control is something not interesting from user perspective, to much controls bring confusion. Please just take this as a kind reminder. |
This is probably where the hybrid search stuff would be ideal. Then we could hit the smart search endpoint and not expose a separate control for this. |
But it might have an effect on performance. |
cf37250
to
a21aaed
Compare
web/src/lib/components/shared-components/search-bar/search-text-section.svelte
Outdated
Show resolved
Hide resolved
Does sending 2 API requests one for CLIP and one for MetadataSearch sound like something possible (or does it add a lot of load to the system)? Or since a thumb file with a known extension is created for each file, maybe it can be used so that in every search it will search if there is a webp type file that matches [search] if so it will retrieve it in the search results. |
server/src/infra/infra.utils.ts
Outdated
builder.andWhere(_.omitBy(path, _.isUndefined)); | ||
|
||
if (options.originalFileName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should rename this since we search on the file path
server/src/infra/migrations/1709608140355-AddAssetOriginalPathTrigramIndex.ts
Outdated
Show resolved
Hide resolved
web/src/lib/components/shared-components/search-bar/search-text-section.svelte
Outdated
Show resolved
Hide resolved
web/src/lib/components/shared-components/search-bar/search-text-section.svelte
Outdated
Show resolved
Hide resolved
…t-section.svelte Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
web/src/lib/components/shared-components/search-bar/search-filter-box.svelte
Outdated
Show resolved
Hide resolved
web/src/lib/components/shared-components/search-bar/search-text-section.svelte
Outdated
Show resolved
Hide resolved
web/src/lib/components/shared-components/search-bar/search-text-section.svelte
Outdated
Show resolved
Hide resolved
builder.andWhere(_.omitBy(path, _.isUndefined)); | ||
|
||
if (options.originalPath) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this not support doing an exact match on original path anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine. Not a huge fan of this code change for search requiring an update to a method used for so many other features.
Does it actually replace m: or a feature in addition to it? |
It is a replacement, there is no more |
As a feature it replaces m:, but it's specifically for file names right now. |
Added radio button to search for file's name