HibernateSearch 6: fetch limit > 250 produces inconsistent result


In our environment with ES 7 with default settings if I submit a Hibernate Search query with fetch limit set to something bigger than 250 (e.g. 1000) I get quite strange result: total hits count is 250 (which is wrong - there are more actually), hits.size is 250 too instead of asked 1000. When using fetch limit <= 250 everything is fine. This breaks the paging completely.

We use SearchFetchable#fetch(java.lang.Integer, java.lang.Integer) to fetch the results. Is it a Hibernate Search problem or some Elastic Search bug or setting?

We use HS 6 Beta 4.

Best regards,

This definitely doesn’t look normal.

Can you try with Hibernate Search 6.0.0.Beta6, to rule out some bug that we may have solved in the meantime?

If you get the same behavior with Beta6, another possible explanation could be a timeout on the Elasticsearch side. Especially if you are requesting the whole source and your documents are large.

Can you post your logs after you enabled the TRACE level for logger org.hibernate.search.elasticsearch.request? You should see the exact requests sent by Hibernate Search to Elasticsearch and the exact response. Make sure to remove sensitive data if necessary :slight_smile:

Hi Yoann,

everything is fine. It was our fault. Sorry.

Best regard,

No problem. Thanks for the update!