Getting all documents in Elastic Search Shard

I am trying to get all documents in a shard.

When creating the index, I used the query:

PUT mortgages-stage
  "mappings": {
    "_routing": {
      "required": true

When adding documents to the index, I used the user's id as the routing parameter. I can see that the documents in elasticsearch have the _routing parameter set for all documents and it has been correctly set as the user's id.

Example of a document:

  "_index" : "mortgages-stage",
  "_type" : "_doc",
  "_id" : "841966e1-ef66-4e19-8d8a-1e0f6b075aa2-CLFFI-3451",
  "_score" : 1.0,
  "_routing" : "841966e1-ef66-4e19-8d8a-1e0f6b075aa2",
  "_source" : {
      "LastModifiedOn" : "2020-11-08T11:05:21Z-0800",
       "ID" : "841966e1-ef66-4e19-8d8a-1e0f6b075aa2-CLFFI-3451",
      "UserID" : "841966e1-ef66-4e19-8d8a-1e0f6b075aa2",

I am trying to fetch all documents in a shard using the query:
GET /mortgages-stage/_search?routing=254b2796-9be4-4704-b756-6fe2e3e80f36

However, this query returns all the documents in the index rather than the documents in the shard id: 254b2796-9be4-4704-b756-6fe2e3e80f36. How do I figure out what's wrong?

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