1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-22 18:00:06 +01:00

search fix

This commit is contained in:
Matthias Kretschmann 2018-10-14 00:16:15 +02:00
parent fc38c6b889
commit af60744e9e
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -91,22 +91,18 @@ module.exports = {
// Attributes for custom indexing logic. See https://lunrjs.com/docs/lunr.Builder.html for details
fields: [
{ name: 'title', store: true, attributes: { boost: 20 } },
{ name: 'content' },
{ name: 'excerpt', attributes: { boost: 10 } },
{ name: 'category', store: true, attributes: { boost: 5 } },
{ name: 'tags', store: true },
{ name: 'url', store: true }
{ name: 'tags', store: true, attributes: { boost: 5 } },
{ name: 'content' }
],
// How to resolve each field's value for a supported node type
resolvers: {
// For any node of type MarkdownRemark, list how to resolve the fields' values
MarkdownRemark: {
title: node => node.frontmatter.title,
content: node => node.rawMarkdownBody,
excerpt: node => node.frontmatter.excerpt,
category: node => node.frontmatter.category,
excerpt: node => node.excerpt,
tags: node => node.frontmatter.tags,
url: node => node.fields.slug
content: node => node.rawMarkdownBody
}
}
}