Skip to content

Support Array of Objects as list and keys to search against #19

Description

@ad1992

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions