Fixed
Details
Assignee
Yoann RodièreYoann RodièreReporter
Yoann RodièreYoann RodièreComponents
Sprint
NoneFix versions
Priority
Major
Details
Details
Assignee
Yoann Rodière
Yoann RodièreReporter
Yoann Rodière
Yoann RodièreComponents
Sprint
None
Fix versions
Priority
Created November 19, 2018 at 12:31 PM
Updated January 31, 2019 at 3:08 PM
Resolved January 31, 2019 at 10:43 AM
The ID predicates introduced in are unlikely to work when multi-tenancy is enabled.
In particular, there will be a problem in the Elasticsearch integration: the predicate is built without any information about the current tenant (no session context), but the actual ID used in Elasticsearch depends on the current ID; it's actually a concatenation of the tenant ID and the entity ID.
One obvious solution would be to give access to the session context to the predicate builders, but that would mean that SearchPredicate objects cannot be reliably used accross different sessions, so I'd rather avoid that.
Alternatively, we could make the Elasticsearch predicate builders closer to the Lucene ones, passing context information to the
build()
method and making sure that they return a new JsonObject each time thebuild()
method is invoked. This would allow us to just hold a reference to the builder inElasticsearchSearchPredicate
, and to delay the generation of actual JSON to a time when we actually know about the current tenant ID. However, that would require a lot of changes, and could make some predicate builders much more complex, since they wouldn't be able to store their data in a JsonObject, but would have to store the information in dedicated fields, and only create (and populate) a JsonObject whenbuild()
is called.Maybe there are other solutions... TBD.