gatsby-plugin-elasticlunr-search icon indicating copy to clipboard operation
gatsby-plugin-elasticlunr-search copied to clipboard

Filtering And Relational lookups

Open tsimons opened this issue 6 years ago • 3 comments

This was branched of the filter PR I opened earlier this week since I need both. You can try this out by installing @tsimons/gatsby-plugin-elasticlunr-search. I'll obviously take that down if we can get this merged. I just needed it asap.

I got around to implementing search for my blog today and noticed one other thing. In some source plugins (Wordpress in my case) there are relationships between nodes that are not resolved at the time that this plugin is ran. I passed the getNode function to the resolvers to allow it to lookup props from other nodes that relate to the current.

One example of this is a post and its taxonomy. In Wordpress, a post doesn't know what categories it's part of, there's a separate entity that maps posts to categories/tags/authors. This means that without having the ability to lookup other nodes, there's no way to search for a post by its category.

I'll update the readme with an example using both new pluginOptions

tsimons avatar Jun 15 '18 20:06 tsimons

Exactly what I needed to do with this plugin, will use your branch while this PR is not merged.

The change is really small so this should be merged soon

clementai avatar Jun 22 '18 09:06 clementai

Trying to clean up my open PRs. Have you had time to check this out? We used it successfully for quite a while but we ended up having to switch frameworks.

tsimons avatar Dec 18 '18 15:12 tsimons

@tsimons Yes you can close it, thanks for your work 👍

clementai avatar Dec 18 '18 15:12 clementai