feat(search): improve search index by chunked separated by h2 and h3 (#290)

This commit is contained in:
Dillon
2020-04-30 03:22:52 +08:00
committed by GitHub
parent 108679e137
commit 3096ff6235
8 changed files with 32 additions and 25 deletions

View File

@@ -237,7 +237,7 @@ class Theme {
this._algoliaIndex
.search(query, {
offset: 0,
length: searchConfig.maxResultLength * 3,
length: searchConfig.maxResultLength * 10,
attributesToHighlight: ['title'],
attributesToSnippet: ['content:30'],
highlightPreTag: `<${searchConfig.highlightTag}>`,