The OPACNoResultsFound sys pref allows for the use of a the {QUERY_KW} placeholder but it doesn't always work right when commas are used in the search string. To recreate: Set up the OPACNoResultsFound with the {QUERY_KW} placeholder. Do a search with a comma that will return no results. Like "King, Martin Luther". If the returns results add some additional characters to the search until no results are returns. Look at the #noresultsfound HTML element. Anything before (or after) the comma is omitted. So the placeholder looks something like 'Martin Luther' instead of 'King, Martin Luther'. The regular expression in opac-search.pl can be tweaked to allow the content before or after commas to display.
Created attachment 120247 [details] [review] Bug 28241: Fix regex to allow for content before and after comma 1. Set up the OPACNoResultsFound with the {QUERY_KW} placeholder. 2.Do a search with a comma that will return no results. Like "King, Martin Luther". If the returns results add some additional characters to the search until no results are returns. 3. Look at the #noresultsfound HTML element. Anything before (or after) the comma is omitted. So the placeholder looks something like 'Martin Luther' instead of 'King, Martin Luther'. 4. Apply patch 5. Try the search again, you should see the content before and after a comma
(In reply to Lucas Gass from comment #1) > 5. Try the search again, you should see the content before and after a comma Instead of "searchterm1,searchterm2" I see "searchterm1+searchterm2" Is that to be expected?
Created attachment 120319 [details] [review] Bug 28241: Fix regex to allow for content before and after comma 1. Set up the OPACNoResultsFound with the {QUERY_KW} placeholder. 2.Do a search with a comma that will return no results. Like "King, Martin Luther". If the returns results add some additional characters to the search until no results are returns. 3. Look at the #noresultsfound HTML element. Anything before (or after) the comma is omitted. So the placeholder looks something like 'Martin Luther' instead of 'King, Martin Luther'. 4. Apply patch 5. Try the search again, you should see the content before and after a comma Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
I've got an example subject of: 600_aKing, Martin Luther, _cJr., _d1929-1968 _vJuvenile literature. Without the patch, I get: (Martin+AND+Juvenile+literature+AND+Jr+AND+1929-1968) With the patch I get: (King+Martin+Luther+AND+Juvenile+literature+AND+Jr+AND+1929-1968) That looks correct to me.
On second thought, "consistent" would be a better word than "correct." I wouldn't have any complaint about ditching the + signs and putting in commas and spaces, but this patch hasn't made a change there.
Created attachment 120712 [details] [review] Bug 28241: Fix regex to allow for content before and after comma 1. Set up the OPACNoResultsFound with the {QUERY_KW} placeholder. 2.Do a search with a comma that will return no results. Like "King, Martin Luther". If the returns results add some additional characters to the search until no results are returns. 3. Look at the #noresultsfound HTML element. Anything before (or after) the comma is omitted. So the placeholder looks something like 'Martin Luther' instead of 'King, Martin Luther'. 4. Apply patch 5. Try the search again, you should see the content before and after a comma Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.06
Pushed to 20.05.x for 20.05.12
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.