Code Monkey home page Code Monkey logo

Comments (7)

bidoubiwa avatar bidoubiwa commented on June 26, 2024 1

Hey @Ln11211 i will be specifying more every pr on this repo but will do probably do it on Sunday! I will ping you here once it is done :)

from gatsby-plugin-meilisearch.

bidoubiwa avatar bidoubiwa commented on June 26, 2024 1

Hey! For the explaination here we go :)

To configurate the plugin you provide config in gatsby-config.js

Example:

options: {
host: process.env.GATSBY_MEILI_HTTP_ADDR || 'http://localhost:7700',
apiKey: process.env.GATSBY_MEILI_MASTER_KEY || 'masterKey',
// skipIndexing: true,
queries: {
indexUid: process.env.GATSBY_MEILI_INDEX_NAME || 'my_blog',
transformer: data => data.allMdx.edges.map(({ node }) => node),
query: `
query MyQuery {
allMdx {
edges {
node {
id
slug
frontmatter {
title
cover
}
tableOfContents
}
}
}
}
`,
},
},

In these options we do not provide the possibility to pass settings.

By providing the settings option to a query object it gives the possibility to the user to add MeiliSearch Settings to the index.

Example:

      options: {
        host: 'http://localhost:7700',
        apiKey: 'masterKey',
        queries: {
          indexUid: 'my_blog',
          settings: { // here
            filterableAttributes: ["tags"],
            searchableAttributes: ["title", "body"]
          },
          transformer: data => data.allMdx.edges.map(({ node }) => node),
          query: `
            ...
          `,
        },
      },

Adding settings should be done before adding documents as best practice.

Thus in the code it would add an additional step before adding documents:

const index = client.index(queries.indexUid)

// Add settings to Index
const { updateId } = await index.addSettings(queries.settings)

// wait for settings to be processed

// Index data to Index
const { updateId } = await index.addDocuments(transformedData)

from gatsby-plugin-meilisearch.

Ln11211 avatar Ln11211 commented on June 26, 2024 1

@bidoubiwa , I am unable to understand the assignment and I apologize for wasting your time.

from gatsby-plugin-meilisearch.

Ln11211 avatar Ln11211 commented on June 26, 2024

@mdubus, hello, what exactly should we be doing ?

from gatsby-plugin-meilisearch.

Ln11211 avatar Ln11211 commented on June 26, 2024

@bidoubiwa ok ?

from gatsby-plugin-meilisearch.

abhilashkpy avatar abhilashkpy commented on June 26, 2024

Kindly assign a good first issue.

from gatsby-plugin-meilisearch.

manavmodi22 avatar manavmodi22 commented on June 26, 2024

Commenting to keep myself updated on the issue.

from gatsby-plugin-meilisearch.

Related Issues (20)

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.