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

Display results that contain a string #24

Open
marco910 opened this issue Aug 31, 2021 · 1 comment
Open

Display results that contain a string #24

marco910 opened this issue Aug 31, 2021 · 1 comment

Comments

@marco910
Copy link

marco910 commented Aug 31, 2021

Hello,

Is it possible to return from useFlexSearch some search results that contain a specific string?

For example, if I have an input field on my page and the user enters "lorem" into it, I want FlexSearch to search for all elements that contain this string.

@kyuumeitai
Copy link

Hi @marco910
You have to define this option in your flexsearch instance, in my case, I used the gatsby-plugin-local-search plugin for GatsbyJS, in this plugin, the options are in the gatsby-config.js under the engineOptions option.

Either way, you have to add tokenizer option and use "strict"

https://github.com/nextapps-de/flexsearch#tokenizer

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