Skip to content

Multi search support? #80

@jacobcarpenter

Description

@jacobcarpenter

It's entirely possible I'm reaching for the wrong tool for this task...

I'm working on a purely client-side SPA. I have a master list of items and user input that is a comma separated list of item-like strings, and I want to filter the master list to the matching user items (while being tolerant of small misspellings/typos/casing)...

That is, given:

const allFruits = [
  "Apple",
  "Banana",
  "Cherry",
  "Grape",
  "Kiwi",
  "Mango",
  "Orange",
  "Peach",
  "Pineapple",
  "Strawberry"
];

const myFruits = "apple, orange, cherry";

I want to filter allFruits to ["Apple", "Cherry", "Orange"] (yes, I need to remember to set interLft=2 to avoid including "Pineapple").

I certainly can handle running n searches, and unioning the results. Will that be less than optimally performant (having to re-perform a lot search prep)? Would it ever make sense for uFuzzy to offer a multi filter API that accepted an array of "needles"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions