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

Suggestion and tokenize "forward" #411

Open
Grafikart opened this issue Dec 7, 2023 · 0 comments
Open

Suggestion and tokenize "forward" #411

Grafikart opened this issue Dec 7, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Grafikart
Copy link

Grafikart commented Dec 7, 2023

I want to allow partial results while allowing multiple words. I noticed this issue #327 about suggestion. It works as expected with full words but seems to fail with partial matching.

const index = new Flexsearch.Index({ tokenize: 'forward' });

index.add(1, 'some words');
index.add(2, 'words variant');
index.add(3, 'this is a variant');
index.add(4, 'nothing');

console.clear();
console.log(index.search('word varia')); // -> [2]
console.log(index.search('word varia', { suggest: true })); // -> [ 2 ]

I would expect the last search to match 1 and 3 too (sorted it would give 2 first since it match both words).
Is there an option I missed or do the algorithm used by flexsearch does not allow this kind of matching ?

@ts-thomas ts-thomas self-assigned this Jan 6, 2024
@ts-thomas ts-thomas added the bug Something isn't working label Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants