elastic / elastic/elasticsearch-dsl-ruby

Example request: Sorting by nested attribute value

Open
#21 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
18
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Is there a way to sort by specific nested attribute value?

[From Elastic's nested sort documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-search-results.html):

```
POST /_search
{
"query" : {
"term" : { "product" : "chocolate" }
},
"sort" : [
{
"offer.price" : {
"mode" : "avg",
"order" : "asc",
"nested": {
"path": "offer",
"filter": {
"term" : { "offer.color" : "blue" }
}
}
}
}
]
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.