Skip to content

Conversation

@carylwyatt
Copy link
Member

@carylwyatt carylwyatt commented Dec 5, 2025

This work-around more or less fixes the bug that was described in the ticket, but there is more under the surface here that I don't 100% understand.

To set the scene: Looking at this form, it's visually obvious that there can be 4 keywords/fields/types and only 3 boolean operators at the maximum. @moseshll discovered that op1/[bools][0] seems to be doing nothing, and I agree, so it gets skipped in this new URL construction. All other search-related arrays are filtered against the lookFors/keyword array so that the related indexes are filtered and reassigned. In a search on prod, searching for "apples" on line 1 and "oranges" on line 4 results in a URL like q1=apples&q4=oranges&op1=AND&op4=AND. This fix changes changes the URL output to something like q1=apples&q2=oranges&op2=AND.

Some history: The version of advanced search before this searched groups of clauses, and I think there is some leftover logic for that hanging out here in a way that isn’t supported in the interface. Lianet’s full-text XML spreadsheet indicates that the param “OP3” is “the operator between second and third search fields, i.e. between groups.” In the old interface, there were two groups of inputs connected with a separate boolean, making it possible to search like (cake AND pie) OR (cake AND ice cream). The op3 param seems to be that connecting OR operator in my example. I'm not sure this makes much of a difference in search results now that I'm re-writing the placement of keywords (e.g. q1=cake&q4=pie&op1=AND&op4=AND is now q1=cake&q2=pie&op2=AND), but in prod currently, if you try to do a search on lines 2 and 3 or 3 and 4 without anything in the first line, it spits out an error about parentheses and/or booleans.
image

This fix unfortunately creates a new sporadic bug in catalog advanced search. Occasionally, the third boolean radio group will have nothing selected, just two empty radio buttons. This doesn't really affect the searching mechanism or outcome of the search since a user can just select one and move on, but it is annoying. Thankfully (?), it's pretty challenging to get to the catalog version of advanced search, so I'm inclined to ignore this problem until we get complaints about it and/or redesign search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants