-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Search: Omit full text index if query is too short #1517
Comments
Stopwords, one or two letter Latin "words" and purely numeric values will be ignored when searching because they are not indexed (for the obvious reason). So it's not known if there are results for those or not. Any specific reason you search for zz01? |
Could you please explain the obvious reason? Why ignore the numbers?
I restarted the indexing to detect faces, I noticed a filename with only numbers in the logs, so I wanted to see that file, so I searched it. The tests with |
Because it's a FULL TEXT index, we index words, not numbers. You can find single letters or numbers in almost any file, so it's not useful for filtering / searching and blows up your index / database on top of it, leading to bad performance. If you search for specific fields like the file name, this does not apply. |
We could in fact automatically do a filename wildcard search for queries like |
We can already use the I rephrased my request: As an end user, if I search something and it doesn't match with photos (because of the way the database is indexed), I expect to see a message like “No results” and/or a message that explain why it's invalid. |
We don't know if it matches because there is no index. Compare to MySQL:
|
In fact we had a "query too short" error, but the limitation specifically applies to Latin characters: There is no length limitation for Chinese etc |
I think that there's still an issue for end users: is a string with 5 characters treated differently? |
True, because zzz is long enough to be a word, but it's on our stoplist as it's not a word - so the index couldn't contain it, even when it exists. We could also detect this special case and look in file names only in a future release. |
Thanks for your answer, |
Default to photo name when search term is too short or on the stop list. Search full text index otherwise, which now include names of people (requires reindexing).
Started a new Development Preview build including the following changes:
|
Examples:
01234
: https://demo.photoprism.org/browse?view=cards&order=added&q=01234&public=true&quality=3zz01
: https://demo.photoprism.org/browse?view=cards&order=added&q=zz01&public=true&quality=3zzz01
: https://demo.photoprism.org/browse?view=cards&order=added&q=zzz01&public=true&quality=3But
zzzz01
returns 0 result: https://demo.photoprism.org/browse?view=cards&order=added&q=zzzz01&public=true&quality=3The text was updated successfully, but these errors were encountered: