Unwanted string normalization in the new search system #1816

Closed
opened 2026-10-05 00:57:43 +02:00 by adam · 3 comments
Owner

I use numeric codes in album descriptions to identify specific datasets. They look like that:

10001567_000_001

If I search for this string the new search system removes the underscores resulting in a large number and expectedly the search doesn't find anything.

The same behaviour occurs even if I wrap the whole string in quotes , which is surprising because the search should look for the exact string (at least according to the current search instructions on Piwigo).

I use numeric codes in album descriptions to identify specific datasets. They look like that: 10001567_000_001 If I search for this string the new search system removes the underscores resulting in a large number and expectedly the search doesn't find anything. The same behaviour occurs even if I wrap the whole string in quotes , which is surprising because the search should look for the exact string (at least according to the current search instructions on Piwigo). <!-- github-sync-id:2090418240 -->
adam closed this issue 2026-10-05 00:57:43 +02:00
Author
Owner

I agree that _ should not used as a word separator. I'm going to check this.

according to the current search instructions on Piwigo

Can you tell us where you find these instructions?

I agree that `_` should not used as a word separator. I'm going to check this. > according to the current search instructions on Piwigo Can you tell us where you find these instructions? <!-- github-comment-id:1900302766 -->
Author
Owner

I think the issue stems from split_allwords() as it drops all special characters from the search terms.

Can you tell us where you find these instructions?

Of course, it is in the administration panel -> Photos -> Batch manager -> Add Filter -> Search -> Search tips. So it is a little bit buried! I did actually want to ask about these search suggestions.

I successfully manage to search using this example grouping:

(mother OR father) AND (daugther OR son)

However, I can't seem to do it the other way around with the conditions swapped, that is:

(mother AND father) OR (daugther AND son)

I am asking because I thought about writing a custom search function for my gallery where a user can select various strings and then those strings are passed to the search function, and having the latter condition would have been useful for me. It doesn't matter that much anymore because I can just tag things and that allows for these AND OR AND conditions (but I still ended up editing some piwigo functions...).

I think the issue stems from `split_allwords()` as it drops all special characters from the search terms. > Can you tell us where you find these instructions? Of course, it is in the administration panel -> Photos -> Batch manager -> Add Filter -> Search -> Search tips. So it is a little bit buried! I did actually want to ask about these search suggestions. I successfully manage to search using this example grouping: `(mother OR father) AND (daugther OR son)` However, I can't seem to do it the other way around with the conditions swapped, that is: `(mother AND father) OR (daugther AND son)` I am asking because I thought about writing a custom search function for my gallery where a user can select various strings and then those strings are passed to the search function, and having the latter condition would have been useful for me. It doesn't matter that much anymore because I can just tag things and that allows for these AND OR AND conditions (but I still ended up editing some piwigo functions...). <!-- github-comment-id:1900310265 -->
Author
Owner

The search in the batch manager is not the same as the search in the gallery. There is no "instructions" for the search in the gallery. That's a change in Piwigo 14. The "quicksearch" algorithm was removed from the gallery, but kept in API method pwg.images.search and in the administration Batch Manager.

The search in the batch manager is not the same as the search in the gallery. There is no "instructions" for the search in the gallery. That's a change in Piwigo 14. The "quicksearch" algorithm was removed from the gallery, but kept in API method `pwg.images.search` and in the administration Batch Manager. <!-- github-comment-id:1900314270 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1816