Hi All, we have two different places I want to add Algolia to on our website. Our product documentation, and our Company Handbook. I need to be able to have two different search bars on our site, one that just returns Handbook-related content, and the other returning docs content.
On our site, the relevant content lives at /handbook/* and /docs/* respectively.
The site is built in Eleventy, hosted on Netlify.
I’ve thought of the following the options:
Two Crawlers: Have two crawlers, one for each path, and then point each search bar accordingly. I don’t seem to be able to configure the Netlify Crawler such that it would create two indices though?
Query Time Filtering: At query-time, somehow define a filter that only returns results with the url containing /handbook or /docs accordingly. I believe this is possible with a custom search bar (and not using the algoliasearchNetlify() setup), but not sure how I can apply the filter, even with something like instanceSearch.js?
If there is anyway of “easily” doing this with the Netlify plugin, that’d be great. All help appreciated! Thanks.
Hi @joepavitt, the best would be to have a property in your records identifying the section that would allow you to do faceting.
The Netlify plugin doesn’t expose a lot of configuration options unfortunately. Maybe you could leverage the keywords, or the category attributes, by adding the expected meta tags to your website.
You could create two separate indices for your product documentation and company handbook and then use the relevant index for each search bar. To do this, you could use the Algolia Netlify plugin to automatically index both /handbook/* and /docs/* pages into separate indices.