Closed ibraheemdev closed 4 years ago
For future reference, these types of questions would be better if asked on Stack Overflow, that way everyone can benefit, but also the question is bound to get wider reach (and thus an answer from someone other than me 😄 ).
Sounds like what you could do is set the option includeMatches
to true
. This would also give you the exact item that was matched in the nested sub-array.
Oh, ok thanks, that worked perfectly! p.s: I did ask on stack overflow here but did not get any response, so I came here 😀
Guess I'll answer your Q there as well 😄
This doesn't work for the example above
I am using fuse.js to fuzzy search a json dataset that looks like this:
When I perform a search for a card title:
the list that contains the card is returned
I want the data to return the specific card that has the title "a third card". Is there any way I can do this?
I looked into the docs, and found a
getFn
option that might do the job, but I couldn't get it to work. I also know that I can achieve this by flattening my object, but I don't want to do that as it adds complexity for my use case.