Hi
I am trying to make a search of movie titles using fuzzy search but I am not understanding well how it works. I tried with the "fuzzy query", "math" and "query_string" but I am not getting the results that I would like to get .
Basically, I would like to show the results with their scores (in percentage preferably), and I would like to use a minimum percent that it should match . So far, I am getting results only if the strings are very similar.
For example, if there is a title called "Kill Bill: Vol. 1" and I search:
- "Kill Bill: Vol. 2" It finds the title "Kill Bill: Vol. 1", so it is OK
- "K9ill Bill: Vol. 2" It doesn't find anything,
there are only 2 letters of difference, could I set up the fuzzy to get more results please?
I inserted the following data:
curl -XPUT "http://localhost:9200/movies/movie/5" -d'
{
"title": "Kill Bill: Vol. 1",
"director": "Quentin Tarantino",
"year": 2003,
"genres": ["Action", "Crime", "Thriller"]
}'
If I search "Kill Bill: Vol. 2" I get results, and that is ok.
GET /_search
{
"query":{
"query_string" : {
"default_field" : "content",
"fields" : ["title"],
"query" : "Kill Bill: Vol. 3",
"minimum_should_match" : "10%"
}
}
}
but I would like to get results even if they do a mistake a write "Ki9ll Bill: Vol. 2"
GET /_search
{
"query":{
"query_string" : {
"default_field" : "content",
"fields" : ["title"],
"query" : "K2ill Bill: Vol. 3",
"minimum_should_match" : "10%"
}
}
}
could you guide me please? Thanks