Hi @magnusbaeck,
TanQ for ur quickly reply. Can u plz let me know the issue in my below query. Title "SAME OLD SONG AND DANCE" should be the first result set. But it is showing as second result with the score less than the first result.
Query :
POST /titles/title/_search
{
"query" : {
"bool" : {
"should" : [
{
"fuzzy" : {
"title" : {
"boost" : 100,
"value" : "same old song and dance"
}
}
},
{
"fuzzy" : {
"title" : {
"boost" : 50,
"value" : "same",
"fuzziness": 0.8
}
}
},
{
"fuzzy" : {
"title" : {
"boost" : 10,
"value" : "song",
"fuzziness": 0.5
}
}
}
]
}
}
}
Output:
{
"took": 125,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 4,
"max_score": 0.39223227,
"hits": [
{
"_index": "titles",
"_type": "title",
"_id": "4",
"_score": 0.39223227,
"_source": {
"title": "MY SAME SONG",
"composer": "pery"
}
},
{
"_index": "titles",
"_type": "title",
"_id": "1",
"_score": 0.34320325,
"_source": {
"title": "SAME OLD SONG AND DANCE",
"composer": "perry"
}
},
{
"_index": "titles",
"_type": "title",
"_id": "3",
"_score": 0.16666667,
"_source": {
"title": "SONG AND DANCE",
"composer": "perry/tallarico"
}
},
{
"_index": "titles",
"_type": "title",
"_id": "5",
"_score": 0.051142137,
"_source": {
"title": "DANCE AND SONG",
"composer": "SE"
}
}
]
}
}