Multi-index Elasticsearch query fails (sometimes silently) when field is present in only one index
Hibernate Search 6.0.1.Final, JDK 8.0.282, macOS 10.14.6, Elasticsearch 7.10.2
Here, we just merged a fix in branches 6.0 and master.
Tests now cover:
Missing fields on any predicate (match, range, …)
Missing field on explicit nested predicate
Missing field on sort
Missing field on projection
And with the latest fix, missing field on implicit nested predicate
Hopefully that’s the end of it…
In any case, your test now works as expected with the latest master. It still fails, but the failure seems caused by incorrect assertions (expecting hits in a certain order, but they end up in another order; I’d say you need a sort).
Request/response for future reference:
More like it’s me not being thorough enough with my testing… There’s still a failure when running your tests, but it's a silent one. It seems related to implicit nesting. I’ll have a closer look.
So I built Hibernate Search from master and tried it out. The error I got before is indeed gone, but the result set is different with the elasticsearch backend than with lucene, so the test fails with elasticsearch (there’s only one result instead of the expected three).
Is this just a difference between the backends that we have to live with?