dillonzq / LoveIt

❤️A clean, elegant but advanced blog theme for Hugo 一个简洁、优雅且高效的 Hugo 主题
https://hugoloveit.com
MIT License
3.42k stars 1.08k forks source link

[BUG] Search function error with Lunr and Algolia #502

Open vutruong99 opened 4 years ago

vutruong99 commented 4 years ago

image image

Hey guys I have just uploaded my LoveIt to 0.2.10 to implement the search function. The Search with Lunr Only gives result if I type the whole exact phrase, plus it doesnt implement full text search, and the Algolia one doesn't work at all. Default language = en. Thanks guys.

Here is my config [params.search] enable = true

type of search engine ("lunr", "algolia")

type = "lunr"
# max index length of the chunked content
contentLength = 4000
# placeholder of the search bar
placeholder = ""
# LoveIt NEW | 0.2.1 max number of results length
maxResultLength = 10
# LoveIt NEW | 0.2.3 snippet length of the result
snippetLength = 30
# LoveIt NEW | 0.2.1 HTML tag name of the highlight part in results
highlightTag = "em"
# LoveIt NEW | 0.2.4 whether to use the absolute URL based on the baseURL in search index
absoluteURL = false
[params.search.algolia]
  index = ""
  appID = ""
  searchKey = ""
lazydeveloper commented 1 year ago

This might help https://lazydeveloper.github.io/posts/adding_algolia_search_to_hugo/