Reputation: 5084
I can send boost value with query like
{
"query": {
"bool": {
"should": [
{
"match": {
"title": {
"query": "quick brown fox",
"boost": 2
}
}
}
]
}
}
}
but I can also set boost value in mapping
{
"properties": {
"title": {
"type": "string",
"boost": 2
},
"tags": {
"type": "string"
}
}
}
And my question is. Which of this is faster while executing queries, to have boost in mapping or setting boost in query, or is it equaly fast.
Upvotes: 0
Views: 1244
Reputation: 613
Index-time boosting is unrecommended by Elastic itself for multiple reasons :
See https://www.elastic.co/guide/en/elasticsearch/guide/current/practical-scoring-function.html for more details.
As for speed, I don't think it changes much at all, so you should probably stick to Query-time boosting which is the norm.
Upvotes: 1