Using ElasticSearch 2.3,
I have a query like:
{
"query" : {
"bool" : {
"should" : [{
"query_string" : {
"query" : "fullName:("guy")"
}
}, {
"query_string" : {
"query" : "nickName:("guy")"
}
}, {
"term" : {
"fullExactName" : "guy"
}
}
]
}
},
"sort" : [{
"_score" : {
"order" : "desc"
}
}, {
"fullExactName" : {
"order" : "asc"
}
}
]
}
How can I assign constant scores to records that match each of the query?
- Assign all records matching nickName query a constant _score of 1
- Assign all records matching fullName query a constant _score of 2
- Assign all records matching fullExactName query a constant _score of 3
I need the scores to be equal so I can still sort them alphabetically.
Thanks!