0

I want to sort objects in ascending order but the sort doesn't work.

Here is a sort query below.

"sort":[
{
    "category.position": {
        "order":"asc",
        "mode":"min",
        "nested": {
            "path": "category",
            "filter": {
                "term": {"category_category_id":42} }
        }
    }
}]

And here are the objects below.

"name": "Yeti",
"category": [
        {
        "category_id": 42,
        "name": "Raamiga",
        "position": 3
        },
    ],
"name": "Venus",
"category": [
        {
        "category_id": 42,
        "name": "Raamiga",
        "position": 4
        }
    ],

Please, help! Many thanks in advance!

1 Answer 1

1

Solved. There was a typo… Must be "category.category_id" indtead of "category_category_id".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.