DocSearch isn't showing results on newer version of docs


We have DocSearch integrated with the Open Policy Agent documentation site Open Policy Agent | Documentation and we’re seeing that when we cut new releases the search isn’t working correctly (we don’t get any results, try searching for “regex” or something on the linked page or even on the explicit versioned URL Open Policy Agent | Documentation ).

It works great for the older doc versions (ex: Open Policy Agent | Documentation ) and even our “edge” version which is updated from master (so re-published almost every day).

I’m curious if anyone has suggestions for why this might be occurring or how we can get the search to work on the newly published releases.

For reference here is the PR where it was added: Add initial implementation of search bar by lucperkins · Pull Request #1513 · open-policy-agent/opa · GitHub

Any info or pointers would be much appreciated!


:wave: @east.patrick. On it

The issue is that you set the content of the meta tags version via an array that is not interpreted as it. So as of today you have: ['v0.13.3', 'latest'], edge, v0.10.7, v0.11.0, v0.12.2 Please use only one value and update your front’s filters accordingly.


1 Like

Thanks for the quick response!!

I believe we have it that way based on the comments here: Alias for facetfilters · Issue #469 · algolia/docsearch-configs · GitHub although I’m not entirely sure of the context. Just to make sure I understand, is there a way to have some content be tagged with >1 version like this for our latest url rewrite stuff? Or do we even need that for filtering the results?

PR for the OPA website which changes to using just a single value for the version meta tag: docs: Use a single value for algolia version meta by patrick-east · Pull Request #1683 · open-policy-agent/opa · GitHub I’m assuming we’ll need to merge and deploy to get the changes picked up.

:wave: @east.patrick

For the record and since you are referring this link, you can use an array but in this way:
<meta name="docsearch:language"content='["23.0","latest"]'> please mind the single quote. You are not doing it in the same way:
<meta name="docsearch:version" content="[&quot;v0.13.4&quot;, &quot;latest&quot;]">

Thanks for the update. Yes you will need to deploy it first. It will be fixed once the crawl ran while these changes are live.

Thanks for the info!

The changes have merged and been deployed on the site.

Out of curiosity, is there any way for us (OPA maintainers) to know when the crawl happens or to like trigger one after we cut a new release and add a bunch of new URLs?

:wave: @east.patrick

You can not know when then next one will happen but you can see when was its last change from the dashboard.


Thanks again Sylvain!!

We have results again :smile: But are showing too many… It seems that the facet filter is working as expected but we have 3 unique URLs for each doc content page. For example:

Searching for “regex” on Open Policy Agent | Documentation gives results including:

Any suggestions come to mind? (or maybe some obvious docs to point me at?)

My suspicion is that we need to adjust our rewrite/redirect rule for latest to fix the extra / path result. Other pages on the site redirect accordingly with the netlify pretty url feature.

What I’m not sure of is how to limit the result to only showing the results that matches the current url when the latest one doesn’t have any content marked as such, its just rewrite rules at the gateway. I guess maybe some javascript to update the tags… will mess around with it and report back (in case this is helpful for others in the future).

:wave: @east.patrick

This is due to different versions of your website. Please implement these meta tags and we will make sure to filter on it.

I will also update the conf to make sure a proper lvl0 is set