Missing sort values in response (PIT + search_after)

Hello again,

When using PIT with a sort clause, the response does not include the sort array in hits. Because of this, we cannot retrieve the last sort value to use in search_after.

Sample:

POST /siren/post/_pit?keep_alive=10m

POST /siren/post/_search
{
  "_source": ["user_id", "created_at"],
  "size": 2,
  "track_total_hits": false,
  "pit": {
    "id": "THE_PIT_ID"
  },
  "query": {
    "bool": {
      "filter": [
        { "term": { "user_id": "123" } },
        {
          "join": {
            "indices": ["comment"],
            "on": ["comment.id", "id"],
            "request": { "query": { "match_all": {} } }
          }
        }
      ]
    }
  },
  "sort": [
    { "_id": "asc" }
  ]
}

Read and tried things in this documentation link

Thanks

Hello,

Try the endpoint /siren/_search instead. The indices are saved in the PIT id that is retrieved before with the siren/<...>/_pit endpoint.

tried, did not work!

Do you get any error message, either in the response or in the logs ?

sorry @Stephane_Campinas
i had the wrong response it works with /siren/_search
thenks for helping me, thanks a lot

2 Likes