Skip to content

Kalasearch/kalasearch-javascript-sdk

Repository files navigation

kalasearch-javascript-sdk

KalaSearch JavaScript is a client for KalaSearch written in JavaScript. KalaSearch is a powerful, fast, open-source, easy to use and deploy search engine. Both searching and indexing are highly customizable.

🔧 Installation

Installing with npm:

npm install kalasearch-javascript-sdk

Installing with yarn:

yarn add kalasearch-javascript-sdk

🚀 Getting started

Here is a quickstart for a search request:

import { KalaSearch } from 'kalasearch-javascript-sdk'

const client = new KalaSearch({
  apiKey: 'your-apiKey',
  appId: 'your-appId'
})

async function f() {
  try {
    let response = await client.search('bill','some-index-id');
    console.log(response) // => see output below
  } catch(err) {
    console.log(err) // => catch error 
  }
}

f();

Output:

{
  "hits": [
    {
      "_id": "bxhrKnIBUGhMMzxQmktg",
      "_source": { "name": "bill" }
    }
    {
      "_id": "lp8gLnIB2RA_SQyqB57i",
      "_source": { "name": "bill gates" }
    }
  ],
  "queryTimeUsed": 1,
  "totoalHits":2
}

🎬 Examples

About

Javascript SDK - 卡拉搜索

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •