Reputation: 1
I am using solr-4.5.1. I need to make fuzzy search and it is hapening by using appending '~' at the end of word. Now i need to make fuzzy matching with out space. For example i need to search "Bill Gates" by "BillGates". Can any one help.
Upvotes: 0
Views: 879
Reputation: 1787
Can you please describe your problem a bit more? What is your query? What are possible hits you want that query to match?
By the way "A B"~ is not a fuzzy query it is proximity query. Example "batman movie"~100 is to find all documents where "batman" occurs within 100 words of "movie" .
To do a fuzzy search use the tilde, "~", symbol at the end of a Single word Term. For example to search for a term similar in spelling to "roam" use the fuzzy search:
roam~
So there is a huge difference.
More here: http://lucene.apache.org/core/2_9_4/queryparsersyntax.html
Edit:
This is what you need to do: Use text_en_splitting for your field type , example:
<field name="names" type="text_en_splitting" indexed="true" stored="true"/>
And re-index your data ,this will match your queries. No need to do fuzzy matched for this. Play with it and see how your queries work. The magic is done by tokenizers , in this importantly by solr.WordDelimiterFilterFactory.
You can read more about tokenizers here:
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
Upvotes: 1