Adding fuzzy search to Feathers NeDB

Out of the box Feathers NeDB does not support fuzzy search. There is a hook that provides this functionality: feathers-nedb-fuzzy-search. It is really simple and straitforward to install and use.

  • Install
    npm install feathers-nedb-fuzzy-search --save
  • Configure
    Enable it for specifc services or alternatively enable it for all services in app.hooks.

    const search = require('feathers-nedb-fuzzy-search') 
    messages.hooks({
      before: {
        find: search()
      }
    })
  • Usage
    const messages = app.service('messages')
    messages.find({
      query: {
        $search: 'some string to search for'
      }
    })

    or

    http://mydomain.com/api/?search=Hello

Happy coding.

Leave a comment