I would like to use the Fuzzy Search Feature of Solr. In my dataset, I have one record that looks like this:
{
"lastName": "John Doe"
}
I would like to perform multiple fuzzy searcheas with the following strings:
- John D
- John Do
- John Doe
- John Deo
- John Xeo
I perform the query like this:
- lastName:"John D"~
- lastName:"John Do"~
- lastName:"John Doe"~
- lastName:"John Deo"~
- lastName:"John Xeo"~
I expect, that query 1, 2, 3 and 4 return the record. Unfortunately, only query 3 returns it. As I understand from the documentation, it would be possible to specify the maximum number of edits allowed, when I don't specify something, the edit distance of 2 is used. I think I'm using the syntax incorrectly because if I take a look at my query it looks a lot like a Proximity Search.
But how can I fuzzy search for a string that contains spaces without using a proximity search?
My problem seems to be, that I indeed executed a Proximity Search.
works exactly like I intend. I have to make sure, all the special characters listed here https://lucene.apache.org/solr/guide/7_3/the-standard-query-parser.html are escaped properly.