When I visit the link to my json file I see hugo is appending 2 script tags which is breaking my search index. These are the script tags:
<script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script><script data-no-instant defer>console.warn('"head" or "body" tag is required in html to append livereload script. As a fallback, Hugo injects it somewhere but it might not work properly.');</script>
If I start hugo with livereload disabled everything works fine: hugo server --disableLiveReload
Any idea if there is a config setting in order to prevent this or if I am doing something wrong or is this a bug?
You are currently generating your JSON search index with the HTML output format. By default, this output format has the isHTML property set to true, which (among other things) triggers injection of the livereload script.
Instead, generate your JSON search index with the JSON output format. By default, this output format has the isHTML property set to false, which prevents injection of the livereload script.