tihom88 commented on code in PR #2346: URL: https://github.com/apache/jackrabbit-oak/pull/2346#discussion_r2163273444
########## oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/ElasticRequestHandler.java: ########## @@ -1123,7 +1127,20 @@ private Query createQuery(String propertyName, Filter.PropertyRestriction pr, Pr final String field = elasticIndexDefinition.getElasticKeyword(propertyName); if (pr.isNullRestriction()) { - return Query.of(q -> q.bool(b -> b.mustNot(m -> m.exists(e -> e.field(field))))); + // nullProps check has been added since 1.4.0. Use the old strategy when version is lower + if (elasticIndexDefinition.getMappingVersion().compareTo(MINIMUM_NULL_CHECK_VERSION) < 0) { + // check if the default mapping is >= 1.5.0 + if (ElasticIndexDefinition.MAPPING_VERSION != null && + ElasticIndexDefinition.MAPPING_VERSION.compareTo(new ElasticSemVer(1, 5, 0)) >= 0) { + LOG.error("Backward compatibility for null check is not supported anymore. Query results may be incorrect. " + Review Comment: I think we should decrease logging these on each query execution., may be once every 100/1000 queries. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org