Upgrade to Pro — share decks privately, control downloads, hide ads and more …

An Introduction to search-index

An Introduction to search-index

Avatar for Mats Julian Olsen

Mats Julian Olsen

September 19, 2015
Tweet

Other Decks in Programming

Transcript

  1. Underlying technology of Norch, a search server (like Elasticsearch or

    Solr) that you can install with npm. About search-index
  2. Features • Search • Facets • Filters • Matcher •

    Stopwords • Snapshots • Replication • Weighting • Del/Update
  3. “Node.js project that aims to provide a common, portable interface

    to a multitude of LevelDB forks.” — leveldb.org LevelUP
  4. { title: 'Indian banks provide record low interest rates', body:

    '...', topics: [ 'banking' ], country: ['India'], id: 0 }
  5. // Search for India and bank in all fields {'query':

    {'*': ['India', 'bank']}} // Search for India and bank in title field {'query': {'title': ['India', 'bank']}} // search for India in title and bank in body {'query': {'title': ['India'], 'body': ['bank']}}
  6. // Search for bank in all fields // Show facets

    on country field { 'query': { '*': ['bank'] }, 'facets': { 'country': {} } } // {India: 6, USA: 2, Norway: 1} //
  7. // Search for bank in all fields // Filter on

    country='India' { 'query': { '*': ['bank'] }, 'filters': { 'country': [['India', 'India']] } }
  8. // Filter on country=‘India' or // country=‘Norway’ { 'query': {

    '*': ['bank'] }, 'filters': { 'country': [ ['India', 'India'], ['Norway', 'Norway'] ] } }
  9. Get involved Make apps, submit PRs, issues or bring it

    to new platforms. github.com/fergiemcdowall/search-index