[hibernate-dev] [HSEARCH] Wrong query results when embedding *-to-many associations

Gunnar Morling gunnar at hibernate.org
Tue Aug 25 02:47:24 EDT 2015


Hi,

in the forum [1] a user runs into a variant of the old problem where
boolean searches on different fields of the elements of an embedded
association return wrong results due to hits in different elements of
the collections.

What is our recommendation/answer to this type of question? I've seen
it popping up several times, it seems to be a common trap for users.
Having an FAQ entry for this would be nice.

ES btw. nicely avoids this by storing nested objects in separate
"hidden" documents [2]. This allows to run queries without getting
results from different collection elements. It'd be a nice addition to
do something similar in HSEARCH?

Thanks,

--Gunnar

[1] https://forum.hibernate.org/viewtopic.php?f=9&t=1041259
[2] https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-nested-type.html


More information about the hibernate-dev mailing list