If the query provided is using query logical operators, it would be nice that the attribute key is also included in the matching object (like it is when we don't use logical operators), in order to identify which of the conditions are found for a given match.
{ $or: [{ "brand.name": query }, { "name": query }] }
Describe the solution you'd like
The desired solution is having the key in each match object.
{ $or: [{ "brand.name": query }, { "name": query }] }
I get that the same key could be repeated in the logical operations
{ $or: [{ "name": '=query' }, { "name": '^query' }] } but it would be fine not knowing which of those "two" are matched
Describe alternatives you've considered
The alternative is creating several intances of the fuse search with each one key, in order to stablish which match comes from where.
Description
If the query provided is using query logical operators, it would be nice that the attribute
key
is also included in the matching object (like it is when we don't use logical operators), in order to identify which of the conditions are found for a given match.{ $or: [{ "brand.name": query }, { "name": query }] }
Describe the solution you'd like
The desired solution is having the
key
in each match object.{ $or: [{ "brand.name": query }, { "name": query }] }
I get that the same key could be repeated in the logical operations{ $or: [{ "name": '=query' }, { "name": '^query' }] }
but it would be fine not knowing which of those "two" are matchedDescribe alternatives you've considered
The alternative is creating several intances of the fuse search with each one key, in order to stablish which match comes from where.