Duplicated search results in HUGO fastsearch

For people who encounter duplicate search results.

If your Hugo page is not a single-page application, it will repeatedly run index.json.

This will cause pages to be repeatedly added to the search index, causing the results to be duplicated.

All you have to do is in index.json replace:

{{- range .Site.RegularPages -}} 

on this

{{- range where .Site.RegularPages "Type" "not in" (slice "page" "json") -}}