Is attribute Sort special?

I'm previewing AppSearch engine based on existing Elasticsearch indices, got a weird value in sort field in search result.
The way to reproduce it:

  1. Put some docs into the index
POST search-books/_doc
{
  "name": "Elasticsearch Guide",
  "sort": 9,
  "version": 8.2,
  "price": 49
}

POST search-books/_doc
{
  "name": "Kubernetes in Action",
  "sort": 4,
  "version": 1.24,
  "price": 99
}
  1. Create a AppSearch engine (based on Elasticsearch v8.2.3) named books-engine by choosing existing index search-books

  2. Browse the documents via your Kibana panel (/app/enterprise_search/app_search/engines/books-engine/documents)
    or via API

POST /api/as/v1/engines/books-engine/search
{"query": ""}

The return result is

{
   "meta" : {
      "engine" : {
         "name" : "books-engine",
      },
      "page" : {
           // omit some fields ...
      },
      "request_id" : "fJidGnLUQuCUKbFePr7qOQ"
   },
   "results" : [
      {
         "id" : {
            "raw" : "Ghbh24EBlMLi8pstBRpx"
         },
         "name" : {
            "raw" : "Kubernetes in Action"
         },
         "price" : {
            "raw" : 99
         },
         "version" : {
            "raw" : 1.24
         },
         "sort" : {
            "raw" : [
               1,
               1
            ]
         }
      },
      {
         "id" : {
            "raw" : "n9Lg24EBzZcm6zCt_OEm"
         },
         "name" : {
            "raw" : "Elasticsearch Guide"
         },
         "version" : {
            "raw" : 8.2
         },
         "price" : {
            "raw" : 49
         },
         "sort" : {
            "raw" : [
               1,
               0
            ]
         }
      }
   ]
}

As you can see, the sort.raw value is an array instead of a number.
Can someone explain why this happened and how to avoid it?

Hi Nevill,

Thank you for reporting this issue - we managed to replicate it.
The Elasticsearch index engines feature is under technical preview, issue reports like this one help us make it better.
Unfortunately there is no workaround for it in the current released version which at the moment is 8.3.
I would advise that for now, to use a different field name instead of sort.

Thanks for your reply Ioana, wish this can be fixed soon.
I am about to avoid using sort to skip the issue.

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