This is the javascript wrapper to the meili API Meili provides a instant search engine as a service, you can register on meilisearch.com to get your credentials. You can also try it on your own by installing MeiliDB on your computer.
π·πΎββοΈThis is a work in progress, if you need more information on the meili API, you should visit the API documentation
- Search documents in meili API
- Index documents in meili API
npm install @meilisearch/meili-api
yarn add @meilisearch/meili-api
Here is a quickstart for a search request
var Meili = require('@meilisearch/meili-api')
// Get your applicationId and apiKey on meilisearch.com
var config = {
applicationId: 'applicationUid',
apiKey: 'apiKey',
}
var meili = new Meili(config)
meili
.Index('indexUid')
.search(
{ q: 'batman' }
)
.then((response) => {
console.log(response.hits)
})
Go checkout examples !
Example:
meili
.Index('xxx')
.search({
q: 'batman',
})
.then((response) => {
console.log(response.hits)
})
This methods list all indexes of a database
Example:
meili.listIndexes().then((indexes) => {
console.log(indexes) // ["movies"]
})
This methods create a new index
Example:
meili.createIndex('movies', {
id: ['identifier', 'indexed', 'displayed'],
title: ['displayed', 'indexed'],
poster: ['indexed', 'displayed'],
})
Browse is a method to get defaults documents without search. This method is usually used to display results when you have no input in the search bar.
Example:
meili
.Index('xxx')
.browse()
.then((response) => {
console.log(response)
})
Index(indexId: string).Documents().batchWrite(documentsToInsert: object[], documentsToDelete: object[]): Promise<object>
How to do Foo
Today we're gonna build Foo....MIT as always