You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Algolia DocSearch for the search system on my Hugo/Docsy doc site (I cannot use Lunr as the site is quite large creating a huge index) and having battled with the Algolia Crawler to build a search results index that is acceptable (this is another story as I found the DocSearch crawler config very much a black box and difficult to understand), I recently wanted to increase the number of search results that are returned per "group". The default is 5 results and this is quite a low number....
I discovered that it is possible to change this default value using the API maxResultsPerGroup (see https://docsearch.algolia.com/docs/api/#maxresultspergroup). I then found that Algolia DocSearch is defined in Docsy within the /layout/partial/scripts.html file and that by creating my own scripts.html override file and adding maxResultsPerGroup in, I was able to change this behaviour:
It would be really good to be able to add in these Algolia DocSearch API options directly in the hugo.toml file under [params.search.algolia] - this would avoid having to create an override partial to do it.
Or is there a better way to do this that avoids having to create a scripts.html partial?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using Algolia DocSearch for the search system on my Hugo/Docsy doc site (I cannot use Lunr as the site is quite large creating a huge index) and having battled with the Algolia Crawler to build a search results index that is acceptable (this is another story as I found the DocSearch crawler config very much a black box and difficult to understand), I recently wanted to increase the number of search results that are returned per "group". The default is 5 results and this is quite a low number....
I discovered that it is possible to change this default value using the API
maxResultsPerGroup
(see https://docsearch.algolia.com/docs/api/#maxresultspergroup). I then found that Algolia DocSearch is defined in Docsy within the/layout/partial/scripts.html
file and that by creating my ownscripts.html
override file and addingmaxResultsPerGroup
in, I was able to change this behaviour:It would be really good to be able to add in these Algolia DocSearch API options directly in the
hugo.toml
file under[params.search.algolia]
- this would avoid having to create an override partial to do it.Or is there a better way to do this that avoids having to create a
scripts.html
partial?Beta Was this translation helpful? Give feedback.
All reactions