New version of search-index out

Espen Klem
norch
Published in
2 min readMar 18, 2019

Great news, a new version of search-index is out! The previous version was based on callbacks and streams, but streams are a bit hard to figure out, the support wasn’t that good in the browsers. And, well, callbacks are callbacks…

That’s why we now base the API on Promises. Yay!

The future is bright, fun, promise based and simple =) As of now, v.1.0.5 is the latest.

Main changes

Switch to promise based API

Async is now supported through a promise based API.

// search for terms without specifing any fields
db.SEARCH('SCOTLAND', 'GREEN').then(result)

Flexible AND, OR and NOT-queries

The query API are a lot less opinionated and AND, OR and NOT-queries can be nested just as you want it to.

Works with Node.js, the browser, … or something else

Node.js and browser support continues, but we’ve made it a bit simpler to bundle with other stuff as well. Browserify as bundler is replaced with Webpack.

New browser demo

We got a better and simpler example of search-index running in the browser.

The demo!

And there will be a lot more coming, slowly but surely, so stay tuned =) Shout out if you have any problems or questions!

Happy searching!

--

--

Espen Klem
norch
Editor for

Designing - Creating - Dismantling - Socialising - Nerding. Interaction Designer at Knowit. Tinkering with search when I can.