Lucene.Net - How to treat a space-seperated phrase as a single token?
- by Gareth D
I've implemented a search facility using Lucene.Net. The index includes UK academic qualifications, including "A Level".
I'd like the users to be able to search using the phrase "A Level", but using the Standrad Analyser the "A" is stripped out as a stop-word and therefore only "Level" is indexed/searched.
What's my best option to work around this? I'm guessing I need to somehow tokenise "A Level" to "A-Level" or similar by creating a custom analyser.
Is this the best approach?
Note that I want don't want the whole search to be a phrase query. i.e. in my search box I want the user to be able to enter <"A Level" AND English Maths Physics and this would return any with "A Level" and either of English MAths or Physics. Question updated to reflect this.