Giter Club home page Giter Club logo

gatsby-plugin-meilisearch's Introduction

MeiliSearch Gatsby

Gatsby plugin MeiliSearch ⚠ WIP ⚠️

Bors enabled Tests License


A plugin to index your Gatsby content to MeiliSearch based on graphQL queries

This is still a work-in-progress. Thereby, PRs and bug issues are welcome, but please do not submit any new feature requests 🙏


Table of Contents

📖 Documentation

To understand MeiliSearch and how it works, see the MeiliSearch's documentation.

To understand Gatsby and how it works, see Gatsby's documentation.

🔧 Installation

Inside your Gatsby app, add the package:

With npm:

npm install gatsby-plugin-meilisearch

With yarn:

yarn add gatsby-plugin-meilisearch

🏃‍♀️ Run MeiliSearch

There are many easy ways to download and run a MeiliSearch instance.

For example, if you use Docker:

docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey

🎬 Usage

Basic

gatsby-config.js

{
  resolve: 'gatsby-plugin-meilisearch',
  options: {
    // Host on which your MeiliSearch instance is running
    host: 'http://localhost:7700',
    queries: {
      // Index in which the content will be added
      indexUid: `my_blog`,
      // Function that transforms the fetched data before sending it to MeiliSearch
      transformer: data => data.allMdx.edges.map(({ node }) => node),
      // graphQL query that fetches the data to index in MeiliSearch
      query: `
        query MyQuery {
          allMdx {
            edges {
              node {
                id
                slug
                frontmatter {
                  title
                  cover
                }
                tableOfContents
              }
            }
          }
        }
      `,
    },
  },
}

Customization

The plugin accepts the following options for further customization :

{
  resolve: 'gatsby-plugin-meilisearch',
  options: {
    // API key if the MeiliSearch instance is password protected
    apiKey: "masterKey",
    skipIndexing: true, // Run script without indexing to MeiliSearch. Default to false
  },
}

🤖 Compatibility with MeiliSearch and Gatsby

⚙️ Development Workflow and Contributing

Any new contribution is more than welcome in this project!

If you want to know more about the development workflow or want to contribute, please visit our contributing guidelines for detailed instructions!

gatsby-plugin-meilisearch's People

Contributors

bidoubiwa avatar bors[bot] avatar curquiza avatar mdubus avatar meili-bot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.