Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple search terms #17

Open
IoanaAlexandru opened this issue Sep 19, 2021 · 1 comment
Open

Support for multiple search terms #17

IoanaAlexandru opened this issue Sep 19, 2021 · 1 comment

Comments

@IoanaAlexandru
Copy link

Hello. For my use case, I'm looking up names in a list. Therefore, my search term can be multiple words matched to the list in any order.

In other words, if the user searches for "Doe John" and my list contains "John Doe", both "John" and "Doe" should be highlighted as that list item is matched.

Would it be possible for the API to take a list of search terms?

@lrsvmb
Copy link

lrsvmb commented Jul 23, 2022

You could split your search terms by space and use that list in the terms argument

An example here:

SubstringHighlight(
  text: "John Doe",
  terms: userInput.split(" "),
)

where userInput is the search term

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants