Hi,

Are you sure that escaping "\&" wasn't translated into '&' before sending it to query parser?

Please try "R\\&D".


In addition to this you need special analyzer to consider R&D as one word (default analyzer translates it into phrase "r d").

Take a look on Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive class and Zend_Search_Lucene_Analysis_Analyzer::setDefault() method.
http://framework.zend.com/manual/en/zend.search.extending.html#zend.search.extending.analysis


With best regards,
   Alexander Veremyev.



Partout wrote:
Hi All, I am using Zend_Search, and glad to see many new enhancements were added. Many thanks to all of you. But still a question, that is, I need to search some words just like "R&D", "J2EE" .... Who can tell me how to get it? I have used "R\&D", but it throw exception below: /Fatal error: Uncaught exception 'Zend_Search_Lucene_Search_QueryParserException' with message 'Two chars lexeme expected. Position is 4.' in /opt/system/Zend/Search/Lucene/Search/QueryLexer.php:397 Stack trace: #0 /opt/system/Zend/Search/Lucene/FSMAction.php(62): Zend_Search_Lucene_Search_QueryLexer->addQuerySyntaxLexeme() ...../ Thanks in advance. David
------------------------------------------------------------------------
View this message in context: How could Zend_Search be used to search word like "R&D"? <http://www.nabble.com/How-could-Zend_Search-be-used-to-search-word-like-%22R-D%22--tf3734766s16154.html#a10454147> Sent from the Zend Framework mailing list archive <http://www.nabble.com/Zend-Framework-f15440.html> at Nabble.com.

Reply via email to