Currently, in my application (that uses Lucene), I am using a Porter + 
StandardAnalyzer (with stop words).



I would like to do the following:

When the user performs a search, the analyzer should remove the "stopwords" 
only if the stop word is not present in quotes. If the stop word is present in 
quotes, I don't want the stop word to be removed by the analyzer.



For e.g.



"no dress code" - should not remove "no"  as it's present in quotes.



shirts with trousers - should remove "with" as a stop word.



I have been trying to do this with Lucene, but have not found a straight 
forward way of doing it. I have been digging in Lucene mail archives, but it 
seems like there is no easy way to do this apart from extending / modifying the 
QueryParser. In some sense, it is similar to the issue discussed in:



http://www.gossamer-threads.com/lists/lucene/java-user/38946



Is there any way I can avoid subclassing QueryParser ?



Thanks,

Sameer Maggon.

Reply via email to