ZF-7738: Adding multi-token awareness to rewrite() in Query_Preprozessing_... and Query_Phrase (patch)
class Zend_Search_Lucene_Search_Query_Preprocessing_Term had a couple of @todo lines (and thrown exceptions) regarding handling of term text when it was parsed as multiple tokens, either due to a stemming or synonym analyzer, or due to space interpreted characters in the term (like underscore)
The same with Zend_Search_Lucene_Search_Query_Preprocessing_Fuzzy
This patch adds awareness to both types of multi-tokens, and rewrites such queries (even when including wildcards) as Zend_Search_Lucene_Search_Query_Phrase
(instead of Query_MultiToken as before)
thereby handling $token->getPositionIncrement() to find out wether a token is to be handled as an alternative (0) or part of a "phrase" (>0) and setting the correct position within the phrase.
This patch works standalone for searching, however in order to have highlighting working correctly, it needs the Temp-Index highlighting patch ( ZF-7736 ).
PS: this extends the patches attached to ZF-7688, supposedly fixing that bug