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 only when first letter match query #1363

Open
f-liva opened this issue Aug 22, 2015 · 5 comments
Open

Suggestion only when first letter match query #1363

f-liva opened this issue Aug 22, 2015 · 5 comments

Comments

@f-liva
Copy link

f-liva commented Aug 22, 2015

Since today I've used Typeahead + Bloodhound 0.10.5 and writing al in the search box returned me the California and Alabama suggestions.

Now with Typeahead + Bloodhound 0.11.1 writing al returns me only Alabama. It seams the search is working only when the query match a result from the first letter and not also from the middle.

@mindmelting
Copy link

I am also seeing this...

@garncarz
Copy link

garncarz commented Nov 6, 2015

It seems Bloodhound shifted from searching for substrings to matching "tokens"... too bad.

@app
Copy link

app commented Apr 29, 2016

Any ideas how to revert this?

@f-liva
Copy link
Author

f-liva commented Apr 30, 2016

Have you tried these options for your Bloodhound instance?

datumTokenizer: Bloodhound.tokenizers.obj.nonword('text'),
queryTokenizer: Bloodhound.tokenizers.nonword

@landy2005
Copy link

I get same issue with local datum:

var suggest_autodiscovery__ip_nets = new Bloodhound({
 queryTokenizer: Bloodhound.tokenizers.whitespace,
 datumTokenizer: Bloodhound.tokenizers.whitespace,
 local: ['127.0.0.0/8','192.168.0.0/16','10.0.0.0/8','172.16.0.0/12']
});
$('#autodiscovery__ip_nets').typeahead({
 hint: false,
 highlight: true,
 minLength: 1
},
{ name: "suggest",
 limit: 16,
 source: suggest_autodiscovery__ip_nets
});

if I type '1', '12', '19' - results found,
but if I type '8', '0', etc - nothing

when I change (as suggested in comments) to

datumTokenizer: Bloodhound.tokenizers.nonword,
queryTokenizer: Bloodhound.tokenizers.nonword

search is better, but anyway strange behavior:
'8' and '0' - now found,
but '6' or '68' - still NOT FOUND.

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

No branches or pull requests

5 participants