-
Notifications
You must be signed in to change notification settings - Fork 188
Description
The current implementation of search aliases using SearchFieldTransformer only remaps the field name (e.g. cds:12345 → metadata.identifiers.identifier:12345) without preserving the relationship between the identifier scheme and its value.
After transformation, the query is converted back into a flat query_string, rather than a nested query. As a result, even if both scheme and identifier conditions are present, they are applied at the record level and not constrained to the same identifier entry.
For example, given a record with:
{scheme: "cds", identifier: "2633033"}
{scheme: "inspire", identifier: "12345"}
A query like cds:12345 (or an equivalent combination of scheme and identifier conditions) can incorrectly match this record. This happens because the query effectively checks for:
any identifier with scheme = cds, and
any identifier with identifier = 12345
without ensuring that both conditions apply to the same identifier object.