1.0.2 • Published 6 years ago

algolia-combinatory-match v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Algolia Combinatory Match

An Algolia tool to match and get known entities in your query

Installation

  • > npm install -S algolia-combinatory-match OR
  • > yarn add algolia-combinatory-match

Usage

import AlgoliaCombinatoryMatch from 'algolia-combinatory-match';

const algoliaCombinatoryMatch = new AlgoliaCombinatoryMatch(
  'APP_ID',
  'API_KEY',
  [
    { name: 'indexName1', attribute: 'attributeName1' },
    { name: 'indexName2', attribute: 'attributeName2' },
  ]
);

async function main() {
  const result = await algoliaCombinatoryMatch.run(
    'find an american restaurant in manhattan'
  );
}

The result will be an object of this format:

{
  results: [ [], [] ],
  matches: [
    { hit: [Object], index: 'cuisines', matchedWords: 'american' },
    { hit: [Object], index: 'boroughs', matchedWords: 'manhattan' }
  ]
}

With

  • results the search results of indexName1 and indexName2
  • matches the detect entities in the query
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago