Skip to content

Commit

Permalink
fix(search): fixes the search by prefix docs paths
Browse files Browse the repository at this point in the history
  • Loading branch information
claymcleod committed Feb 5, 2021
1 parent ef0c0ed commit 5079535
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/utils/algolia-queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@ const pageQuery = `{
}
}
}`
function pageToAlgoliaRecord({ node: { id, frontmatter, fields, ...rest } }) {

function pageToAlgoliaRecord({
node: {
id,
frontmatter,
fields: { slug },
...rest
},
}) {
return {
objectID: id,
...frontmatter,
...fields,
slug: "/docs" + slug,
...rest,
}
}

const queries = [
{
query: pageQuery,
Expand All @@ -36,4 +45,5 @@ const queries = [
settings: { attributesToSnippet: [`excerpt:20`] },
},
]

module.exports = queries

1 comment on commit 5079535

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.