0

I insert multi objects in my index and when I immediately get query from index after inserting data my my output is null but after almost 8 hour when I retry that query my result have some content

my query is :

GET myIndex/_search
{
  "size": 1, 
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "identifier": {
              "value": "597713-2"
            }
          }
        },
        {
          "term": {
            "organizationUnitCode": {
              "value": "00001"
            }
          }
        }
      ]
    }
  }
}

this is my index setting:

{
  "myIndex" : {
    "settings" : {
      "index" : {
        "creation_date" : "1633957331203",
        "number_of_shards" : "1",
        "number_of_replicas" : "1",
        "uuid" : "V_MtNZ57S4CFmlKwS_0wyA",
        "version" : {
          "created" : "7020099"
        },
        "provided_name" : "myIndex"
      }
    }
  }
}
3
  • please share myIndex/_setting?pretty response Commented Oct 11, 2021 at 13:43
  • @hamidbayat I update my question and add settings Commented Oct 11, 2021 at 14:05
  • the document would be searchable after refresh process happen. the default setting sets to 1 seconds. obviously you didn't change the default setting. but to be sure set index.refresh_interval to 1s Commented Oct 12, 2021 at 6:10

1 Answer 1

1

Elasticsearch is near a real-time engine, which means that if you index and immediately try to query, it will not work (it could take at least one second to make the content searchable, but the accurate time depends on your environment and configuration).

For more information: Elasticsearch docs

Sign up to request clarification or add additional context in comments.

1 Comment

I try for qurying after refresh interval but i don't get proper result

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.