-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@andrew-codes/gatsby-plugin-elasticlunr-search plugin has generated no Gatsby nodes. #11
Comments
For those that come here searching for a solution to this. It appears that a fork has been created for V2 https://github.com/gatsby-contrib/gatsby-plugin-elasticlunr-search. This fixes the issue for me. |
I'm still having the same issue @devinswett, the siteSearchIndex doesn't seem to be created. Maybe it's an issue with how the gatsby-config is set up? |
@dylanpinn Hey, can you post your gatsby-config? The nodes are not being generated for me and I'm using the forked version and Gatsby V2.
|
@seanngpack Here is our config. It works though I am still not 100% finished with it yet. {
resolve: `@gatsby-contrib/gatsby-plugin-elasticlunr-search`,
options: {
fields: ['title', 'content'],
resolvers: {
wordpress__POST: {
title: node => node.title,
link: node => node.link,
filter: () => 'page-content',
},
wordpress__PAGE: {
title: node => node.title,
content: node => {
return node;
},
link: node => node.link,
filter: () => 'page-content',
},
wordpress__wp_document: {
title: node => node.title,
link: node => node.link,
filter: () => 'document',
},
},
},
}, |
@dylanpinn OHHHHH, I was using the wrong resolvers. Thank you! |
Hi @dylanpinn @seanngpack i am facing the similar issue Actually i am dynamically creating the pages by reading the content from excel sheet using gatsby-source-filesystem and gatsby-transformer-excel and i want to use @gatsby-contrib/gatsby-plugin-elasticlunr-search for search on the nodes created from the excel data. But i am getting the error message in graphiql "Cannot query field "siteSearchIndex" on type "RootQueryType".". Need your help in understanding what i am doing wrong here. Thanks in advance. Details: Plugins:
|
@ashokballolli Sorry, I haven't seen that error before. Maybe try posting on Stack Overflow or creating a new issue. |
@dylanpinn How did you determine the resolvers (i.e. wordpress__POST, wordpress__PAGE, wordpress__wp_document)? I'm trying to implement the plugin using Drupal source data. I keep coming up with the same error @seanngpack was experiencing, "The @gatsby-contrib/gatsby-plugin-elasticlunr-search plugin has generated no Gatsby nodes." I'm thinking my issue is due to not knowing the correct resolvers in my case. Thanks. |
@dw235 I can't remember exactly but it was probably logging out all of the results from using the Easiest way I found to do this was to output the build results to a file which was easier to search through: |
@dylanpinn Very helpful! In my case, when using the gatsby-source-drupal plugin, my working gatsby-config.js looks like this:
The resolver for content is Thanks again! |
Just in case, if you are using prismic, this plugin is looking not for node.type but for node.internal.type which is different (for example "PrismicBlogPage" instead of "BlogPage") |
For anyone using the |
Hello,
I don't think this is an issue, more just my misunderstanding of how to properly integrate this plugin.
I'm having a miserable time trying to integrate this into a gatsby site that's using the gatsby-source-WordPress plugin.
I'm able to pull all of my Wordpress info, into regular templates, so that's not an issue. It's just whenever I run gatsby develop I receive the " @andrew-codes/gatsby-plugin-elasticlunr-search plugin has generated no Gatsby nodes." warning. Followed by another GraphQL warning, "GraphQL Error Unknown field
siteSearchIndex
on typeRootQueryType
."Clearning or deleting the .cache folder doesn't seem to have any effect.
It's like it's just not creating the siteSearchIndex.
Here's my gatsby-config.js file
and my gatsby-node.js
Just for clarification, when I console.log the node.internal.type it returns 'artwork' as that's my Wordpress custom post type name.
I realize that this issue encompasses way more than just the elasticlunr-search plugin. So if it's just too broad an issue, I understand. But if you have any advice, I'd really appreciate it, I've hit a brick wall.
The text was updated successfully, but these errors were encountered: