bug 2098: do not apply stemming if search term has digits
authorGalen Charlton <galen.charlton@liblime.com>
Mon, 9 Jun 2008 16:33:04 +0000 (11:33 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 10 Jun 2008 13:22:18 +0000 (08:22 -0500)
commit233a40f1d194060da2f47afbfec1dda4120fff34
tree826b9984a7c7be04d35d35ad8918838c59bae040
parent5b7d3624720fa74e74b12f41c774329342f1b5c6
bug 2098: do not apply stemming if search term has digits

If a search contains a digit, it is almost certainly an identifier, and should
not be stemmed.  This is particularly relevant for ISBNs and ISSNs, which
can contain the letter "X" - for example, C4::Search::_build_stemmend_operand
would reduce "014100018X" to "x ", which for a MARC21 database would bring
up irrelevant results (e.g., "23 x 29 cm." from the 300$c).

With this patch, supplying a search term that contains one or more digits
followed by "X" will no longer retrieve irrelevant results.  This applies
to catalogs using Zebra and query stemming.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Search.pm