Bug 13064 - Indexing problem with ICU on control characters
authorFridolin Somers <fridolin.somers@biblibre.com>
Fri, 10 Oct 2014 13:06:45 +0000 (15:06 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 14 Nov 2014 15:03:12 +0000 (12:03 -0300)
commit9220482cd351c818cb6aeb88c13f0734024635cb
tree2fd4b72698edf392c76d3d8dc837552dfaaba574
parent59b7744e1c14da3e9fcd662fd128957ac0d2bf13
Bug 13064 - Indexing problem with ICU on control characters

The ICU configuration files contains a rule to remove control characters :
  <transform rule="[:Control:] Any-Remove"/>
This rule is before tokenization.

The problem is that "[:Control:]" regex contains line feed, carriage return and tab. See http://www.regular-expressions.info/posixbrackets.html.
So when several lines are indexed, last word of line is joined with first line of next line. Thoses words are then not searchable.

For example :
  First line
  Second line
This will become "First lineSecond line", tokenized as "First", "lineSecond" and "line".

Test plan :
- Use ICU in Zebra configuration
- Choose an indexed field, like 300$a
- Create a new record
- Enter several lines in choosen field, like :
  First line
  Second line
- Index this record
=> Without patch the search on "Second" does not return the record
=> With patch the search on "Second" returns the record
- Same tests with tab and carriage return instead of line feed

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
etc/zebradb/etc/phrases-icu.xml
etc/zebradb/etc/words-icu.xml