I am working on search functionality using the Elasticsearch, I need to show result in dropdown if string or substring is match.
right now query result be like
if I type in input box test
so result is
test-load-1
test-load-2
test-load-3
test-load-4
test-load-5
test-load-6
but if I type load
in that case I am getting no results
my ES query ls like below
{
"aggregations": {
"myagg": {
"aggregations": {
"mymaxscore": {
"max": {
"script": {
"source": "_score"
}
}
}
},
"terms": {
"field": "name",
"order": [
{
"mymaxscore": "desc"
}
],
"size": 100
}
}
},
"query": {
"bool": {
"filter": {
"bool": {
"should": {
"terms": {
"exists": [
"true"
]
}
}
}
},
"must": {
"match": {
"name.engram": {
"operator": "or",
"query": "load"
}
}
},
"should": [
{
"match": {
"name.engram": {
"operator": "and",
"query": "load"
}
}
},
{
"term": {
"name.lower": {
"boost": 100,
"value": "load"
}
}
},
{
"prefix": {
"name.lower": {
"boost": 100,
"value": "load"
}
}
}
]
}
},
"size": 100
}