Unable to fetch Data from ElasticSearch

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 ).

The URL used in postman is 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

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 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