# Unable to fetch Data from ElasticSearch

**URL:** <https://discourse.hibernate.org/t/unable-to-fetch-data-from-elasticsearch/4700>\
**Category:** Hibernate Search\
**Created:** [October 28, 2020, 9:38am UTC](https://discourse.hibernate.org/t/unable-to-fetch-data-from-elasticsearch/4700 "2020-10-28T09:38:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![schoppara](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@schoppara](https://discourse.hibernate.org/u/schoppara)\
**Post date:** [October 28, 2020, 9:38am UTC](https://discourse.hibernate.org/t/unable-to-fetch-data-from-elasticsearch/4700/1 "2020-10-28T09:38:20Z")

</div>

I had written a spring boot application to connect and fetch data from Elastic Search. I see no error while executing the rest api, but there is no data. The project is hosted in github ( [https://github.com/srikanthchoppara/nosqlES](https://github.com/srikanthchoppara/nosqlES) ).

The URL used in postman is [http://localhost:8080/v1.0/fmdb/events/allEvents](http://localhost:8080/v1.0/fmdb/events/allEvents) on GET

When queried on kidana for the records on active\_events table then I could see one record. The response for  
GET active\_events/\_search  
{  
“query”: {  
“match\_all”: {}  
}  
}

is as follows

{  
“took” : 2,  
“timed\_out” : false,  
“\_shards” : {  
“total” : 1,  
“successful” : 1,  
“skipped” : 0,  
“failed” : 0  
},  
“hits” : {  
“total” : {  
“value” : 1,  
“relation” : “eq”  
},  
“max\_score” : 1.0,  
“hits” : [  
{  
“\_index” : “active\_events”,  
“\_type” : “\_doc”,  
“\_id” : “DeLPTnUBhgpevyvGkWM5”,  
“\_score” : 1.0,  
“\_source” : {  
“eventID” : “11011”,  
“ack” : false,  
“cancelledBy” : “NA”,  
“type” : 1,  
“sequenceId” : null,  
“deviceName” : “Chennai”,  
“spec” : “NA”,  
“varBind” : “”"{“EventDescription”:“Application ssa exits; process ID:31222”}""",  
“varbindList” : “{EventDescription}”,  
“protocol” : null,  
“lastOccurrence” : 1591949876,  
“eventTime” : “1591949876”,  
“oidVarBinds” : “”"{“1.3.6.1.4.1.2879.2.1.5.2.1.10”:OidType{oid=‘1.3.6.1.4.1.2879.2.1.5.2.1.10’, value=‘07:e4:06:0c:0d:2f:38:00:2b:00:00’, type=‘OctetString’}}""",  
“additionalInfo” : “NA”,  
“primaryIP” : null,  
“eventName” : “HostApplicationExitNotification”,  
“eventGroup” : “HostApplicationNotification”,  
“deviceType” : “Paradise”,  
“summary” : “Application ssa exits; process ID:31222”,  
“severity” : 1,  
“ackedBy” : null,  
“eventClass” : null,  
“ackTimestamp” : null,  
“timeToCancel” : 0,  
“count” : 1,  
“cancelledTimestamp” : null,  
“eventSourceIP” : “10.54.8.145”,  
“version” : 3,  
“deviceID” : “10011”,  
“eventKey” : “HostApplicationNotification”,  
“firstOccurrence” : 1591949876  
}  
}  
]  
}  
}

I am not sure what I did wrong in the configuration. I had googled and could able to provide all the configs as required. Is there a way where we can see what DSL query is sent to fetch data. Your support is highly appriciated.

Thanks,  
Srikanth C

---

<div class="post-metadata">

**Author:** ![yrodiere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yrodiere/32/1760_2.png) [@yrodiere](https://discourse.hibernate.org/u/yrodiere)\
**Post date:** [October 28, 2020, 9:55am UTC](https://discourse.hibernate.org/t/unable-to-fetch-data-from-elasticsearch/4700/2 "2020-10-28T09:55:54Z")

</div>

To display all requests sent to Elasticsearch by Hibernate Search, set the log level of logger `org.hibernate.search.elasticsearch.request` to `TRACE`.

Something that could potentially explain your problem (though I really don’t have enough information to tell for sure): Elasticsearch is a near-real-time platform. When you index a document, it won’t show up in search results immediately, but after approximately one second.

Also, [your configuration](https://github.com/srikanthchoppara/nosqlES/blob/master/src/main/resources/application.properties) looks incorrect:

- `spring.jpa.properties.hibernate,search.default.elasticsearch.index_schema_management_strategy` should be `spring.jpa.properties.hibernate,search.backends.elasticsearch.index_schema_management_strategy`
- `spring.jpa.properties.hibernate,search.default.elasticsearch.index_management_wait_timeout` should be `spring.jpa.properties.hibernate,search.backends.elasticsearch.index_management_wait_timeoutegy`
