Hi,
I have a problem with the score in a search.
I have two elements, for example: "London Barking" and "Derry / Londonderry".
When I execute this query:
"query": {
"match": {
"name": {
"query": "london"
}
}
}
I get the same score for "London Barking" and "Derry / Londonderry", but I want a different score, higher for "London Barking" because has an exact word and "Derry / Londonderry" hasn't.
For analysis I use ngram_filter. This is my complete mapping:
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1,
"analysis": {
"filter": {
"ngram_filter": {
"type": "ngram",
"min_gram": 3,
"max_gram": 100
}
},
"analyzer": {
"ngram_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"ngram_filter"
]
}
}
}
},
"mappings": {
"hotel": {
"properties": {
"name": {
"type": "text",
"analyzer": "ngram_analyzer",
"search_analyzer": "standard"
}
}
}
}
}
Can I give more score to elements with an exact word?
Thanks