Home

Awesome

xlanex6/nuxt-meilisearch

<p align='center'>

Latest Stable Version License Twitter Follow

</p>

Nuxt Meilisearch

Integrate Meilisearch fast and hyper-relevant search engine in your Nuxt application.

Read Nuxt Meilisearch documentation.

Features

Installation

Add nuxt-meilisearch using the Nuxt CLI to your project

npx nuxi@latest module add nuxt-meilisearch

or add nuxt-meilisearch using your dependency manager

# with npm
npm install nuxt-meilisearch

# with yarn
yarn add nuxt-meilisearch

# with pnpm
pnpm add nuxt-meilisearch

and then to the modules section of nuxt.config.ts:

// nuxt.config.ts
export default defineNuxtConfig({
 modules: [
   'nuxt-meilisearch'
 ],
 meilisearch: {
   hostUrl:  '<your_meilisearch_host>', //required
   searchApiKey: '<public_search_api_key>', // required
   adminApiKey: '<admin_api_key>', // optional
   serverSideUsage: true // default: false
})

That's it! 🎉

Usage

This example performs a search in the books index:

<script setup>
const { search, result } = useMeiliSearch('books')

onMounted(async () => {
  await search('harry');
})
</script>

<template>
  <div>
    {{ result }}
  </div>
</template>

Learn more in the Nuxt Meilisearch documentation.

Contributing

Issues and pull requests are welcome. 🫶

Local development

Licence

MIT Licence

<!-- Badges --> <!-- [npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/partytown/latest.svg [npm-version-href]: https://npmjs.com/package/@nuxtjs/partytown [npm-downloads-src]: https://img.shields.io/npm/dm/@nuxtjs/partytown.svg [npm-downloads-href]: https://npmjs.com/package/@nuxtjs/partytown [github-actions-ci-src]: https://github.com/nuxt-community/partytown-module/workflows/ci/badge.svg [github-actions-ci-href]: https://github.com/nuxt-community/partytown-module/actions?query=workflow%3Aci [codecov-src]: https://img.shields.io/codecov/c/github/nuxt-community/partytown-module.svg [codecov-href]: https://codecov.io/gh/nuxt-community/partytown-module [license-src]: https://img.shields.io/npm/l/@nuxtjs/partytown.svg [license-href]: https://npmjs.com/package/@nuxtjs/partytown --> <!-- For Meilisearch DEmo exemple valid MASTER_KEY `PZKj1rFXYBnjLzEIxXRRaEz3gNDWTG3JoW6ZDzd6-mo` ```bash docker run -it --rm \ -p 7700:7700 \ -e MEILI_MASTER_KEY='PZKj1rFXYBnjLzEIxXRRaEz3gNDWTG3JoW6ZDzd6-mo'\ -v $(pwd)/meili_data:/meili_data \ getmeili/meilisearch:v1.5 ``` -->