fergiemcdowall / search-index

A persistent, network resilient, full text search library for the browser and Node.js
MIT License
1.39k stars 149 forks source link

Can save numbers as numbers in index #546

Closed fergiemcdowall closed 2 years ago

fergiemcdowall commented 3 years ago

At the moment search-index holds radically to the doctrine that "everything is a string". This means that numbers are stored as strings, and therefore sorted alphabetically. Some users are confused when using numbers, particularly with aggregations.

Using charwise, it should be possible to incorporate numbers into the index keys in such a way that they sort numerically.

fergiemcdowall commented 2 years ago

numbers are now stored numerically and are therefore numerically sortable.