Bug 4397: fix scan index search results for non-latin characters
authorTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 28 Feb 2014 18:26:10 +0000 (15:26 -0300)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 5 May 2014 05:23:11 +0000 (05:23 +0000)
commit997246cf4fb1b9c040e9b18c0ff264249db55cd9
tree1321dceff398cb0eb0b697eaec3af645134ac82f
parentc251f7524081e428b24620d2755a210347da2052
Bug 4397: fix scan index search results for non-latin characters

The Zoom specification defines that a ScanSet should provide a way
to retrieve terms suitable for displaying and another one for using
on further searches [1].

The Net::Z3950::ZOOM implementation actually provides both [2] but we
were using the wrong one.

Using $scanset->display_term(...) instead of $scanset->term(...) fixes
the problem.

To test:
- Do a index scan search (advanced search > more options > check
  'index scan')
- Notice non-latin characters are replaced by one or more '@' symbols.
- Apply the patch
- Re-do the search, everything shows as it should.
- Try to follow any of the terms (clicking on them) and notice that
  it actually gives you relevant results (i.e. is not searching for
   @!!!!).

[1] http://zoom.z3950.org/api/zoom-1.4.html#3.6.3
[2] http://search.cpan.org/~mirk/Net-Z3950-ZOOM/lib/ZOOM.pod#term()_/_display_term()

Sponsored-by: Universidad Nacional de Cordoba
Followed test plan. Patch behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I reproduced the issue and I confirm this patch fixes it.
I put "Fuß" in a title, reindex the record. Launch a search on Title
checking the "scan index" checkbox. And the non-latin characters are
well displayed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Search.pm