Reputation: 3033
I made elasticsearch(version 5.1) query from java.
It just tried to find document that maching with field string.
boolQuery.filter(QueryBuilders.termQuery("field", "test"));
When being converted as es json query, it added extra things.
'boost', 'disable_coord', 'adjust_pure_negative'
"query" : {
"bool" : {
"filter" : [
{
"term" : {
"field" : {
"value" : "test",
"boost" : 1.0
}
}
}
],
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
}
}
Do I need boost event if I'm not going to use score information? What are rest of tham and how to take them out from query?
Upvotes: 2
Views: 755
Reputation: 52368
Those are the defaults for those attributes anyway. And Elasticsearch client is adding them by default.
Relevant references: https://github.com/elastic/elasticsearch/blob/v5.1.1/core/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java#L51-L52 https://github.com/elastic/elasticsearch/blob/v5.1.1/core/src/main/java/org/elasticsearch/index/query/AbstractQueryBuilder.java#L53
Upvotes: 1