Filter per item properties in a nested array #675
Replies: 5 comments 1 reply
-
I agree with @gmourier , Infact in my use case, I run a global e commerce website where I have different prices for each country. An exmaple of that is below:
Toda, if I add a filter to find a document with country DZ and price 11.30, meilisearch will return all documents that has DZ as a country and at the same time there is any country having a price 11.30 Rather I want just to match values within the same object. Having facets on this will be a great thing as well. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm facing the same problem.
If I filter on "appointments.doctor = Jester Lavorre and appointments.date = 2019-01-01", it will return the document but it should not because Jester Lavorre appointment is for the date 2022-01-01. I had the same problem with another index but filterable attributes are only ids so i got around the problem by concatenating the ids into a single string. Example:
I wanted to filter by leagues played and seasons so i concatenated league id and season id but it only work if it's ids and if there aren't many items. |
Beta Was this translation helpful? Give feedback.
-
@gmourier Thanks for your return. I'm making it actually :) |
Beta Was this translation helpful? Give feedback.
-
Hi all, My documents.
|
Beta Was this translation helpful? Give feedback.
-
Facing the same issue when trying to implement filter on products list by min and max price per distributor, when product have different prices for each distributor, meilisearch gives result that did not actually match filter.. |
Beta Was this translation helpful? Give feedback.
-
Today filters are applied to the whole document, so if I want to filter for a document that contains a specific nested item, I am forced to denormalize my data to perform it, which is a tedious workaround and only sometimes possible.
Example
I want a way to retrieve only the documents where an experience object match
experiences.name CONTAINS 'Airbus' AND experiences.ongoing = 1
; in that case, the document1083
. Meilisearch returns both today.Workaround
I could inverse the way the relationship is mapped in the document. Each experience is a document; I duplicate the person's information in all related experiences.
It could be great to have a way to express a filter that is applied per nested item to match a document.
Mentioned by @Nakusu here
Beta Was this translation helpful? Give feedback.
All reactions