Rejected
Details
Assignee
Yoann RodièreYoann RodièreReporter
Dimitrios StamatisDimitrios StamatisLabels
Components
Priority
Major
Details
Details
Assignee
Yoann Rodière
Yoann RodièreReporter
Dimitrios Stamatis
Dimitrios StamatisLabels
Components
Priority
Created September 11, 2021 at 1:11 AM
Updated September 13, 2021 at 6:46 AM
Resolved September 13, 2021 at 6:46 AM
I’m attaching a test case that demonstrates unwanted search results.
I understand that Hibernate Search uses some tricks to support joined entities, using Apache Lucene, but I’m hoping you can suggest a solution.
I’m searching for “Foo” entities where its “Bar” children must match TWO fields:
bar_name: Bar2
AND
bar_visibility: public
I only want Foo results where a child Bar matches BOTH "Bar2" AND "public".
But, that’s not what’s happening. I’m seeing Foo results when just ONE of the two Bar fields are matched.
This apparently only happens when there are 2 (or more) Bar entities that point to the same Foo entity.
I.e., if you comment out these lines in my attached test case:
Bar bar1 = new Bar(1L, "Bar1", "public", foo1);
foo1.getBars().add(bar1);
s.persist(bar1);
it correctly returns 0 results, as I’d expect.
Please advise.