I am trying to fetch data from index using java API to generate a report using jasper reports.
I have added the maven dependency and able to make connection to ES.
While trying to fetch the data corresponding to the particular index, I am able to get the response when i pass the Index value, _type and _id in the request.
But I need to get all the data pertaining to that idex, so I am passing the Index value alone in the request, but I getting the below error:
Exception in thread "main" org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: id is missing;
at org.elasticsearch.action.ValidateActions.addValidationError(ValidateActions.java:26)
at org.elasticsearch.action.get.GetRequest.validate(GetRequest.java:133)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1420)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1394)
at org.elasticsearch.client.RestHighLevelClient.get(RestHighLevelClient.java:714)
Thanks for the wonderful information, I am able to get the response based on the index as required using the search API.
But the thing is if I pass the index value along with a querystringquery in the request for a particular timestamp, it always provides the response with only 10 hits. please find the code below:
This query will always return me results with timestamp pertaining to 2020-05-25T13:25:33.566Z with slight variation in the seconds. So i could see only 10 records returned in the response.
Do I need to add any kind of filter or any such parameters in the request to actually get the filedname as per my requirement?
the size and from parameters to display by default up to 10000 records to your users. If you want to change this limit, you can change index.max_result_window setting but be aware of the consequences (ie memory).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.