"order" question

Hello. I would like to ask you something about the text on the official website below.

GET /my-index-000001/_search
  "sort" : [
    { "post_date" : {"order" : "asc", "format": "strict_date_optional_time_nanos"}},
    { "name" : "desc" },
    { "age" : "desc" },
  "query" : {
    "term" : { "user" : "kimchy" }

If "user" is left alone in this document, will it become "desc"? or will it be "asc"?
Does "order" in "post_date" make "user" decide?"
Please tell me the reason.

Also, I know that you can use "mode", "missing", and "unmapped_type" in addition to "order". Is there anything else?

Please let me know if there is anything other than "order".

Hi @kimjinyoung

The order defaults to descwhen sorting on the_score, and defaults to asc when sorting on anything else.

Does that mean that the current "user" is not specified, so it will be desc?

will be asc.

Is "asc" because "user" is not specified?
Does that mean that "user" becomes "desc" when {"user":{"order"}}?

because order not specific.

and defaults to asc when sorting on anything else

just like that { "user": { "order": "desc" } }

1 Like

Thank you. It's solved!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.