Closed ashtraysoap closed 3 months ago
Could you give an example list and search query to show the above? Ultimately the way logical operators work is by operating on a single list item, so the item itself would have to be match both patterns in the AND
query. Perhaps I am not fully understanding the feature ask, so an example would help. Thanks! :)
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days
Thanks for the reply, and my apologies for my delay.
Given the input data:
[ { name: "Albert", city: "London", }, { name: "Albert", city: "Paris", }, { name: "Arnold", city: "Paris" }, ]
I want to achieve the following filter: match all items with Albert
in name and Paris
in any other field.
I would expect the query { $and: [{ name: "Albert"}, "Paris"]}
to achieve this, however it does not work.
Thanks!
Is there an existing issue or pull request for this?
Feature description
Is there a way to perform a logical query containing a simple pattern without key speciication (e.g.
{ $and: [{ key1: "abc"}, "xyz"]}
).Trying the pattern from the example yields no matches even though there should be some.
Is there an altenative way to achieve this query in Fuse, or is it not supported?
Desired solution
Ideally, the pattern exemplified in
{ $and: [{ key1: "abc"}, "xyz"]}
would work so that it would return results containing a match for "abc" in the keykey1
and simultaneously a match for inxyz
in any of the indexed fields (similarly tofuse.search("xyz")
).Alternatives considered
I've found no way to achieve given query in Fuse.The query pattern seems relatively orthodox (at least in my usecase), it would be helpful, if it was supported by the library.
Additional context
No response