You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have problem with this https://jsfiddle.net/gguhuu33/ code.
If I type "siemens s" results are shown. But if I type "siemens sx" no results found.
Can someone tell me where is problem?
@rulka Interesting. It seems to be a bug, as far as I can tell. Your code looks good to me.
Odd that it works for some test cases, but not others. For example, a search string of 'Siemens Xel' returns the expected 4 results. However, searching on 'Siemens S' return zero results instead of the expected three ("ST60", "SX1", "SXG75").
I've been experiencing the same issue, and did some debugging: from what I can tell, the issue arises when you return an integer (instead of a string) from the identify function.
Take a look at this updated fiddle: https://jsfiddle.net/gguhuu33/5/ The only difference is that obj.id is now cast to string in the identify function, and the search works perfectly.
Activity
jlbooker commentedon Jan 3, 2017
@rulka Interesting. It seems to be a bug, as far as I can tell. Your code looks good to me.
Odd that it works for some test cases, but not others. For example, a search string of 'Siemens Xel' returns the expected 4 results. However, searching on 'Siemens S' return zero results instead of the expected three ("ST60", "SX1", "SXG75").
Confirming this a bug for now.
clamburger commentedon Feb 3, 2017
I've been experiencing the same issue, and did some debugging: from what I can tell, the issue arises when you return an integer (instead of a string) from the
identifyfunction.Take a look at this updated fiddle: https://jsfiddle.net/gguhuu33/5/ The only difference is that
obj.idis now cast to string in theidentifyfunction, and the search works perfectly.clamburger commentedon Feb 3, 2017
After some investigating, I've determined that the root cause is that getIntersection sometimes behaves incorrectly if the arrays contain integers.
Example:
I noticed that somebody has opened a pull request to replace this function (#121), and their changes appear to fix this problem.
Issue corejavascript#105
Bloodhound: Replace getIntersection method. corejavascript#121
Bloodhound: Replace getIntersection method. corejavascript#121