Open simonquest opened 6 years ago
This should be fixed by #159, if someone can merge it in.
Note to anyone else encountering this: the workaround for us was to coerce the IDs to a string. Something like this:
var engine = new Bloodhound({
identify: function(datum) {
return datum.id + "";
},
});
This will make the >
and <
comparisons in getIntersection()
consistent with the Array#sort()
ordering.
? :)
There is a small bug in the getIntersection function used for filtering results: the two input arrays don't get sorted correctly if arrays contain numeric values as javascript sort function sorts alphabetically. This will affect searches involving multiple tokens.
I suggest sorting array like this
.sort((a, b) => (a - b));