New Elasticsearch Java API: Source is null when search is execute

Hi,

I'm thinking your problem is around the use of Void.class. The intention of that parameter is so you can hydrate a POJO with the data from your search. That said, I tried a tweaked version of your example with my codebase and it doesn't compile. It expects List<Hit> listSearchHit.

If I change to List<Hit> and look at the returned value, there are no fields with any data populated.

Try creating a simple class with just your time field and replace Void.class with MyClass.class and see what happens.

1 Like