Skip to content

Kalasearch/kalasearch-javascript-sdk

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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