const people = [
{ firstName: "John", lastName: "Doe", job: "Example-Hero" },
{ firstName: "Peter", lastName: "Dinklage", job: "Actor", },
{ firstName: "Pooh", lastName: "The Bear!": "Well, A Bear! S#!T" },
];
const fuse = new Fuse(people, {
keys: ["firstName", "lastName"],
threshold: 0,
});
const result = fuse.search("Pet");
When the firstName caused the match, I want to display Peter Dinklage in my auto-completion, but if the lastName caused the match, I want to show Dinklage, Peter.
It would be great if each item in result could tell me what caused the match, just like refIndex does.
Or do you have any other idea how to get that information?
When the
firstName
caused the match, I want to displayPeter Dinklage
in my auto-completion, but if thelastName
caused the match, I want to showDinklage, Peter
.It would be great if each item in
result
could tell me what caused the match, just likerefIndex
does.Or do you have any other idea how to get that information?