gatsby-plugin-elasticlunr-search | Gatsby search plugin via elastic lunr | Plugin library
kandi X-RAY | gatsby-plugin-elasticlunr-search Summary
kandi X-RAY | gatsby-plugin-elasticlunr-search Summary
Gatsby search plugin via elastic lunr client-side search index.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gatsby-plugin-elasticlunr-search
gatsby-plugin-elasticlunr-search Key Features
gatsby-plugin-elasticlunr-search Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-plugin-elasticlunr-search
QUESTION
I'm trying to implement site search with elasticlunr and am following the instructions for gatsby-plugin-elasticlunr-search. I'm stuck trying to build a search index since I can't come up with a graphql query that includes any of my content.
Every example I find shows how to edit gatsby-config.js to populate graphql with markdown content:
...ANSWER
Answered 2020-Oct-29 at 06:29You can retrieve the JSON files/content in the same way that the guides does with markdown (as you can see in Gatsby's docs or in this article), however, you may need to create a data structure to populate your HTML since you can't fetch directly the data from an HTML file as it, since it's not inside the Gatsby filesystem, so that Gatsby doesn't know how to create nodes nor GraphQL schema from that content.
The easiest approach is to create a custom data filesystem (JSON, YAML, or markdown files) to populate your HTML and make it dynamic, not "hardcoded" as it is actually (apparently). Once you've set the filesystem and you are able to create queries to gather data and fill your pages/components, you will be able to create queries to use elasticlunr
.
Resources:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-plugin-elasticlunr-search
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page