I have a classifieds website, and users may for example search for cars.
When searching for a car, there are a number of endings in their names as you all probably know.
For example lets say Bmw 330ci (ending beeing ‘ci’), but there is also Bmw 330i, or Bmw 330di etc etc.
How can I make SOLR “understand” this, so if users search for 330 SOLR will return results containing 330ci/330i/330di etc.
Also, it shoul NOT return results if a user specifically inputs Bmw 330ci, then it should ONLY return Bmw 330ci and NOT Bmw 330i/di etc…
I am new to SOLR, but I am starting to understand how to get it to work. Need a little guidance on this one though!
How would you have done it?
Thanks
You’d probably want to analyze the field using the WordDelimiterFilterFactory, set up to split on numeric transitions. That will allow a query of 330 to match 330anything.
I believe that, by default, when you also do this at query time, it will create a phrase query from 330di -> “330 di”, which should only match if both parts are present in the index.
See http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters for more details.