Search 6 groundwork - Inject the SessionContext in the Lucene predicate builder contribute()

Description

This would be useful for the Lucene NestedPredicateBuilderImpl as we could restrict the parent query to the documents of the tenant.

See SearchQueryWrappingDefinitionResultContextImpl

Environment

None

Activity

Show:
Yoann Rodière
April 12, 2018, 11:30 AM

Why not if it's really necessary, but let's check that it would be really useful first.

If it's only about performance, let's check that it really boosts performance.
If it's about avoiding an edge case where the results would be affected by another tenant, let's devise a test first.

Yoann Rodière
February 14, 2019, 9:18 AM

I just checked, it would be possible in the current codebase. Actually we do just that on the Elasticsearch side; see {‌{org.hibernate.search.backend.elasticsearch.search.predicate.impl.ElasticsearchSearchPredicateContext}‌}.

The question remains: is this really useful? Performance-wise I would expect the ToParentBlockJoinQuery to already filter by the parent ID, and therefore to not benefit from any additional filter such as the tenant ID…

Yoann Rodière
November 4, 2019, 9:36 AM

No compelling reason to do this. Let's open a ticket with a use case once we find a reason.

Assignee

Yoann Rodière

Reporter

Guillaume Smet

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Priority

Major
Configure