Another approach is to use the stopwords and an appropriate analyzer chain. Then both the & and "and" would be removed from the indexing stream and the query process and it would "just work"..
Best Erick On Thu, Jan 19, 2012 at 8:09 AM, Gora Mohanty <g...@mimirtech.com> wrote: > On Thu, Jan 19, 2012 at 7:48 PM, Nicholas Fellows <n...@djdownload.com> wrote: >> I have some data in solr >> >> where the text string could potentially be >> >> "Vic & Bobs greatest hits" >> >> how can i ensure that when a user query is made >> for "Vic and Bobs greatest hits" , a match is made? >> >> this also needs to work the other way round. >> >> i've not found any useful information about this scenario > > Haven't tried this particular case, and it is possible that > there might be a need to escape & as & but in > general, Solr synonyms should address this kind of a > need. Please see: > http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory > and the setup in the default schema.xml. > > Regards, > Gora