I am working on a task in which I have to search a large number of documents in ElasticSearch using Nest client. I implemented ScrollAPI that works fine but need to use SearchAPI with SearchAfter and PointInTime as recommended. I followed the answer from @stevejgordon but I am not able to open PointInTime manually. There is always this exception in response
"message": "- Failed to make call to Elastic Search. Request failed to execute. Call: Status code 400 from: POST /IndexName/_pit. ServerError: Type: parse_exception Reason: "request body is required""
I have tried the code in the answer above and then I changed my code to create an OpenPointInTimeRequest also but got the same result.
Indices indices1 = Indices.Parse(strIndices); IOpenPointInTimeRequest pitRequest = new OpenPointInTimeRequest(indices1); OpenPointInTimeResponse pitResponse = await elasticClient.OpenPointInTimeAsync(pitRequest);
Am I doing something wrong.
One thing which I noticed that OpenPointInTimeAsync is submitting a Post request and therefore the server is complaining about the request body. Well that's my thinking someone can throw light on this.