Overview
Kala Search JavaScript SDK is a client for Kala Search written in JavaScript. User can use their API Key and application ID acquried from Kala Search Dashboard to perform various operations to customize their search engine needs.
Kala Search offers powerful, fast, easy to use and deploy in-app search engine. Without spending extra time in developing their own search engine, users can simply set up their search feature within minutes with the help of Kala Search API and SDK.
Main Features
- Basic search
- Custom search
- Create new index
- Add new documentation to a index
- Delete documentation from a index
Examples
Import Kala Search JavaScript SDK and provide appId and apiKey to set up a new client:
import KalaSearch from 'kalasearch-javascript-sdk'
const client = new KalaSearch({
apiKey: 'your-apiKey',
appId: 'your-appId'
})
const index = client.getIndex('your-index-id')To do a basic search:
;(async () => {
try {
let response = await index.search('bill'); console.log(response) // => see search result
} catch(err) {
console.log(err) // => catch error
}
})()To do a custom search with highlighted fields:
;(async () => {
try {
let response = await index.search(
'bill',
highlightFields: ['name','story'] )
console.log(response) // => see search result with highlight
} catch(err) {
console.log(err) // => catch error
}
})()