nextapps-de / flexsearch

Next-Generation full text search library for Browser and Node.js
Apache License 2.0
12.53k stars 491 forks source link

null pointer exception if field value to index is undefined or null #231

Closed develar closed 3 years ago

develar commented 3 years ago

Here https://github.com/nextapps-de/flexsearch/blob/08c5baf832738d5fa218b2edccb504789f4497ad/src/document.js#L249 we don't check that value is null or undefined, but is_array method expects not-null value.

I suggest to use Array.isArray instead of own util method. This standard method is widely supported.

Thanks a lot for the amazing lib! I stumbled upon the fact that every other lib produces incorrect (prefix search) and not expected (too many results) results, but flexsearch result set is what logically expected.

ts-thomas commented 3 years ago

Thanks for the report, it is fixed in v0.7.11