Elasticsearch function_score with nested_objects


(Fabian Köstring) #1

I have a problem with a query.I used a query for boosting documents with no
nested_objects. Now i use nested_objects and changed the query to use a
nested filter but nothing is boosted. I get the documents i expected but
with no _score changes.

Am i doing something wrong?

GET index/type/_search
{
"query": {
"function_score": {
"filter": {
"bool": {
"must": [
{
"term": {
"parent.child": "test"
}
}
]
}
},
"functions": [
{
"boost_factor": "100",
"filter": {
"nested": {
"path": "parent",
"filter": {
"bool": {
"must": [
{
"term": {
"child": "test"
}
}
]
}
}
}
}
}
],
"score_mode": "sum"
}
},
"sort": "_score",
"from": 0,
"size": 320
}

Or is it because of

A nested filter behaves much like a nested query, except that it doesn’t

accept the score_mode parameter. It can only be used in “filter context” —
such as inside a filtered query — and it behaves like any other filter: it
includes or excludes, but it doesn’t score.

While the results of the nested filter itself are not cached, the usual
caching rules apply to the filter inside the nested filter.

http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/nested-query.html

Thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e7eae68f-c8ba-4763-b564-3b530d088033%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2