0.44.1 • Published 8 months ago

@dedel.alex/adonis5-meilisearch v0.44.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Install MeiliSearch Provider in Adonis

Install dependency

npm i @dedel.alex/adonis5-meilisearch

Run command

node ace configure @dedel.alex/adonis5-meilisearch

Configure MeiliSearch

# MeiliSearch HOST
MEILISEARCH_HOST=http://127.0.0.1:7700

# MeiliSearch API Key
MEILISEARCH_API_KEY="masterKey"

# MeiliSearch options
MEILISEARCH_OPTIONS=""

Usage

Here is an example of how to use the MeiliSearch Provider:

import client from "@ioc:Adonis/Addons/MeiliSearch";

// Get index - where the documents are stored.
const index = client.index("movies");

const documents = [
  { id: 1, title: "Carol", genres: ["Romance", "Drama"] },
  { id: 2, title: "Wonder Woman", genres: ["Action", "Adventure"] },
  { id: 3, title: "Life of Pi", genres: ["Adventure", "Drama"] },
  {
    id: 4,
    title: "Mad Max: Fury Road",
    genres: ["Adventure", "Science Fiction"],
  },
  { id: 5, title: "Moana", genres: ["Fantasy", "Action"] },
  { id: 6, title: "Philadelphia", genres: ["Drama"] },
];

const response = await index.addDocuments(documents);

console.log(response); // => { "uid": 0 }

For more information about MeiliSearch, check the offical website

Github project

https://github.com/aDedel/adonis5-meilisearch

0.44.1

8 months ago

0.42.0

8 months ago

0.43.0

8 months ago

0.44.0

8 months ago

0.41.0

10 months ago

0.39.0

1 year ago

0.38.0

1 year ago

0.37.0

1 year ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago