Bug 26533: Fix 'is exactly' search for authorities

The exact search 6=3 is implemented, but it isn't used as expected when
you select 'is exactly' from the authorities search dropdown. This patch
remedies that.

To test:
1) Ensure you have an authority with more than one word in the name,
    i.e. Electric power production
2) Go to Authorities in the staff client.
3) Change the dropdown to 'is exactly' and search for one of the words
in your record's title, i.e. 'power' in the 'main heading' search
4) Confirm your authority shows in the results, even though it is not an
exact match.
5) Search for a biblio record and go to edit the record.
6) Go to Tab 6 and click the plugin button next to one of the 6xx$a
fields to trigger the authority finder plugin
7) Repeat Step 3 and Step 4
8) Go to the OPAC and go to Authority Search
9) Repeat Step 3 and Step 4

Apply patch

10) Repeat Steps 1 to 9, confirm that this time the record does NOT show
in search results.
11) Repeat Steps 1 to 9 but this time search for the authority record's
full title, i.e. 'Electric power production'. Confirm the record does
show in the search results because the search term now matches title exactly.

Sponsored-by: Education Services Australia SCIS

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Aleisha Amohia 2021-03-10 10:33:16 +13:00 committed by Jonathan Druart
parent da29bf48db
commit a58cf90a31
3 changed files with 26 additions and 26 deletions

View file

@ -31,10 +31,10 @@
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator_mainstr == 'is' ) %]
<option value="is" selected="selected">is exactly</option>
[% IF ( operator_mainstr == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="is">is exactly</option>
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_mainstr" style="width:400px;" type="text" name="value_mainstr" value="[% value_mainstr | html %]" />
@ -57,10 +57,10 @@
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator_main == 'is' ) %]
<option value="is" selected="selected">is exactly</option>
[% IF ( operator_main == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="is">is exactly</option>
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_main" style="width:400px;" type="text" name="value_main" value="[% value_main | html %]" />
@ -82,10 +82,10 @@
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator_match == 'is' ) %]
<option value="is" selected="selected">is exactly</option>
[% IF ( operator_match == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="is">is exactly</option>
<option value="exact">is exactly</option>
[% END %]
</select>
<input type="text" name="value_match" value="[% value_match | html %]" />
@ -106,10 +106,10 @@
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator_any == 'is' ) %]
<option value="is" selected="selected">is exactly</option>
[% IF ( operator_any == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="is">is exactly</option>
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_any" style="width:400px;" type="text" name="value_any" value="[% value_any | html %]" />

View file

@ -31,10 +31,10 @@
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator == 'is' ) %]
<option value="is" selected="selected">is exactly</option>
[% IF ( operator == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="is">is exactly</option>
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_mainentry" type="text" name="value" value="[% value | html %]" class="head-searchbox" />
@ -87,10 +87,10 @@
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator == 'is' ) %]
<option value="is" selected="selected">is exactly</option>
[% IF ( operator == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="is">is exactly</option>
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_mainheading" type="text" name="value" value="[% value | html %]" class="head-searchbox" />
@ -129,7 +129,7 @@
[% END %]
[% END %]
</select>
<input type="hidden" name="marclist" value="match" />
<input type="hidden" name="marclist" value="exact" />
<select name="operator">
[% IF ( operator == 'contains' ) %]
<option value="contains" selected="selected">contains</option>
@ -141,10 +141,10 @@
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator == 'is' ) %]
<option value="is" selected="selected">is exactly</option>
[% IF ( operator == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="is">is exactly</option>
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_matchheading" type="text" name="value" value="[% value | html %]" class="head-searchbox" />
@ -197,10 +197,10 @@
[% ELSE %]
<option value="start">starts with</option>
[% END %]
[% IF ( operator == 'is' ) %]
<option value="is" selected="selected">is exactly</option>
[% IF ( operator == 'exact' ) %]
<option value="exact" selected="selected">is exactly</option>
[% ELSE %]
<option value="is">is exactly</option>
<option value="exact">is exactly</option>
[% END %]
</select>
<input id="value_anywhere" type="text" name="value" value="[% value | html %]" class="head-searchbox" />

View file

@ -55,7 +55,7 @@
<select name="operator" id="anywhere">
<option value="contains">contains</option>
<option value="start">starts with</option>
<option value="is">is exactly</option>
<option value="exact">is exactly</option>
</select>
</li>
<li>