Support Array of Objects as list and keys to search against
Currently, only an array of strings is accepted as a list. Let's allow an array of objects instead when initializing the fuzzify library.
Additinally keys should be passed to search API
const list = [{"name": "Joe", "age": "20", "designation": "Frontend Engineer"},
{"name": "Alice": "age": 25, "designation": "Backend Engineer"},
{"name": "Jack", "age": 21, "designation": "Customer Success"},
{"name": "Bob", "age": 35, "designation": "Engineering Manager"}];
const keys = ["name", "age"];
const fuzzy = new Fuzzy(list);
const result = fuzzy.search(query, keys);
Hello @ad1992,could you explain me if we allow array of object then user can search any of the key value?
Hello @ad1992,could you explain me if we allow array of object then user can search any of the key value?
Hi @jatingodnani yes thats the goal. Basically with objects you can pass the keys you want to search for as shown in the example
Ok, so if any one search joe,ten we need to show all whole object or just name?
@jatingodnani we render the whole object. Let me know if you are interested in working on this issue
Yes,i am interested
@ad1992, I have a query: Should we remove the array of strings, or should we support both arrays of strings and arrays of objects?
@jatingodnani we should be supporting both array of strings and array of objects as most of the time the array of strings would suffice.