I have one of the field indexed as String of list of strings eg> "["string1", "string2","string3","string4","string5"]"
In that column I have values:
- "["string1", "string2","string3","string4","string5"]"
- "["string1", "string2","string3","string4","string5","string6","string7"]"
on this columns, lets call it "testColumn", I will pass a input as "query": "["string1", "string2","string3","string4"*" (with wildcard) I want my results to be matched with the least difference with my input string.
so I want my first output "["string1", "string2","string3","string4","string5"]" and then "["string1", "string2","string3","string4","string5","string6","string7"]" because my query string matches both the records but, the difference between the length of both string is less in first record.
I have tried using the wildcard but didn't work.
"wildcard":{
"testColumn": {
"boost": 0.0,
"value":"[\"string1\", \"string2\",\"string3\",\"string4\"*"
}
}
How about using
scriptto sort the matches by length?