ndx icon indicating copy to clipboard operation
ndx copied to clipboard

Using custom filter

Open VillePakarinen opened this issue 6 years ago • 1 comments

I was looking into why weren't Scandinavian letters such as Ä and Ö being taken into account when performing searches with this brilliant library. It would seem that the DEFAULT_FILTER is removing all non-english characters from the end and the beginning of the search word.

After that I went to read the documentation and tried to apply my own filtering logic for the search words. However filter function passed along with DocumentIndex options was not getting applied.

I assume the previous issue is happening because in the DocumentIndex constructor, the filter option is never being applied to the the DocumentIndex class. It will always uses the default filtering.

if (options.filter !== undefined) { this._filter; }

This is issue is happening in ndx 0.3.0 which is the most recent version available from npm

Edit: Seems like the issue has been fixed in 0.4.0 if (options.filter !== undefined) { this._filter = options.filter; }

Could you update the npm version as well. Thanks!

VillePakarinen avatar May 13 '18 12:05 VillePakarinen

Thanks, uploaded 0.4.1 to the npm.

localvoid avatar May 13 '18 15:05 localvoid