【发布时间】:2021-02-11 11:33:21
【问题描述】:
我正在尝试使用 elasticlunr 实现站点搜索,并按照 gatsby-plugin-elasticlunr-search 的说明进行操作。我一直在尝试建立搜索索引,因为我无法提出包含我的任何内容的 graphql 查询。
我找到的每个示例都显示了如何编辑 gatsby-config.js 以使用 markdown 内容填充 graphql:
resolvers: {
// For any node of type MarkdownRemark, list how to resolve the fields` values
MarkdownRemark: {
title: node => node.frontmatter.title,
tags: node => node.frontmatter.tags,
path: node => node.frontmatter.path,
},
},
我没有任何降价,我的内容完全是 HTML 和一些 JSON 文件。有什么方法可以将 HTML 内容提取到 graphql 中,以便将其包含在搜索索引中?
我是不是走错了路?
【问题讨论】: