algolia-index-transform

1.0.6 • Public • Published

Algolia Index Transform

A selection of methods to transform an index using map, reduce or filter. and push to a brand new index.

Install

Node Using NPM

npm install algolia-index-transform

Node Using yarn

yarn add algolia-index-transform

Set Up

Once installed, you will need to initalize the Algolia Index Transform as below. Each property is required.

const AlgoliaIndexTransform = require('algolia-index-transform');
 
const algoliaIndexTransform = new AlgoliaIndexTransform({
  sourceApplicationID: 'xxxxxxxxxx',
  sourceApiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  sourceIndexName: 'an existing index',
  destinationApplicationID: 'xxxxxxxxxx',
  destinationApiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  destinationIndexName: 'a new index',
  limit: 20000,
  requestOptions: {
    attributesToRetrieve: ['*']
  },
  copySettings: false
});

Setting properties

Paramater Type Description
sourceApplicationID String The Application ID where the current index resides
sourceApiKey String The API Key for the app where the current index resides
sourceIndexName String The index name of the current index
destinationApplicationID String The Application ID of where you would like to add the index
destinationApiKey String The API Key for the new index
destinationIndexName String The new index name
limit (Optional) Number Optional: Limit the amount of records to transfer
requestOptions (Optional) Object Optional: Object containing request options for browseAll
copySettings (Optional) Boolean Optional: Copy destination settings with the transformation

Usage

Copy

algoliaIndexTransform.copy();

Map

algoliaIndexTransform.map(item => ({
  id: item.id
}));

Filter

algoliaIndexTransform.filter(item => item.popular === true);

Reduce

algoliaIndexTransform.reduce((acc, cur) => acc + cur);

Readme

Keywords

none

Package Sidebar

Install

npm i algolia-index-transform

Weekly Downloads

45

Version

1.0.6

License

ISC

Last publish

Collaborators

  • wwalser
  • jkaho
  • mprevell97
  • louishousiaux
  • antoine.gilles
  • eventexperiences_algolia
  • jsok_algolia
  • bhinchley-algolia
  • hugowit
  • alg-admin
  • aymeric.giraudet
  • gavinwade12
  • bhcastle
  • rishi_algolia
  • jasonberry
  • scyganek-algolia
  • drodriguln
  • abodelot
  • leviwhalen
  • sfaiqh
  • valentindotxyz
  • fluf
  • instantsearch-bot
  • taylorcjohnson_algolia
  • pjankowski5312
  • raed-algolia
  • dylantientcheu
  • catalgolia
  • morgan-algolia
  • algabet
  • andy_ds
  • bengreenbank
  • alg-bgastinne
  • daltondickalgolia
  • jcohonner-algolia
  • robertmogos
  • mariaalungu
  • emmanuel.fortin
  • ejaldorau
  • dhaya.b
  • lukyvj
  • marielaure
  • haroenv
  • rayrutjes
  • jerska
  • ronanlevesque
  • samouss
  • therealwebby
  • francoischalifour
  • jonmontane
  • tkrugg
  • seafoox
  • sylvainh
  • clemfromspace
  • lorrissaintgenez
  • broujo
  • e-krebs
  • kombucha
  • sylvain
  • crawler-team
  • amcdaid106
  • devinalgolia
  • jvenezia
  • otomatik
  • sophiem03
  • sarahdayan
  • dcoates
  • maximehuang
  • guitek
  • matthewbond
  • cyril.descossy
  • tatsuro
  • danajeremy
  • mathougui
  • xavdh
  • agdavid
  • rasemotte
  • plnech
  • shortcuts
  • praagyajoshi
  • loicsay
  • svensoldin
  • alphonseb
  • leodau
  • fabienmotte
  • sarahfranc
  • millotp