Unable to create index sorting

Hi,

I want to create index sorting for my documents by default on date. In the mappings i have another field which is nested array.

In documentation i have read that we cannot create index sorting if index contains nested fields(cannot have nested fields when index sort is activated).

Is their any alternate for this.

 "mappings" : {
      "judgements_v2" : {
        "_all" : {
          "enabled" : true
        },
        "properties" : {
 "date" : {
            "type" : "date",
            "format" : "dd-MM-yyyy"
          },
"categories" : {
            "type" : "nested",
            "include_in_parent" : true,
            "properties" : {
              "value" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 150,
                    "normalizer" : "my_normalizer"
                  }
                },
                "analyzer" : "autocomplete"
              }
            }
          },
}
}
}

Sorry, there is no alternative to it. nested documents create multiple Lucene documents under the hood which have to be colocated with their parent document. Using index sorting would break this structure.

1 Like

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