Default value for "minimumShouldMatch" is different between Elasticsearch and Lucene

Description

Let say we have following entity

Query constructed in following way

for given data set:

returns different results (0 documents) if
hibernate.search.default.indexmanager=elasticsearch
and different result (1 document) if
hibernate.search.default.indexmanager=directory-based

If you use HSEARCH-3534_lucene.patch against https://github.com/hibernate/hibernate-test-case-templates/tree/master/search/hibernate-search-lucene, noneOfShouldMatchedWithinBooleanQueryInsideFilter_differentResults_directoryBasedVSElasticsearch test will pass, but
when you use HSEARCH-3534_elasticsearch.patch against https://github.com/hibernate/hibernate-test-case-templates/tree/master/search/hibernate-search-elasticsearch/hibernate-search-elasticsearch-5
the same test will fail.

Maybe using should and must in filters like siblings does not make much sense, because should (in directory-based) clause will be ignored, because document must fulfill must criterias and therefor should is ignored, and makes more sense in queries while scoring the search, however I ran into the issue while migrating huge project where such cases appear time to time, due to dynamic queries creation.

Environment

None

Assignee

Fabio Massimo Ercoli

Reporter

Goran Jaric

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Fix versions

Affects versions

Priority

Major
Configure