v2.vuejs.org: Nested version search index problem

@maxiloc sorry to bother again, but as we are planning to merge multiple major versions of the docs under one domain (from vuejs.org+v1.vuejs.org to vuejs.org/v2 and vuejs.org/v1), we realized that Algalia may end up including both versions under the same index, and the search results can be confusing.

Basically, our question is - is it possible to make one index only crawl pages under vuejs.org/v1, while the other vuejs.org/v2?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (19 by maintainers)

Commits related to this issue

Most upvoted comments

Yes we do have multi version capabilities. I updated the vuejs config to prepare for multiversion (https://github.com/algolia/docsearch-configs/commit/4b816ab9660c818ecb23bea97870cd0d58dcf52a)

You just need to update the snippet

<!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
  apiKey: '85cc3221c9f23bfbaa4e3913dd7625ea',
  indexName: 'vuejs',
  inputSelector: '### REPLACE ME ####',
  algoliaOptions: { 'facetFilters': ["version:$VERSION"] },
  debug: false // Set debug to true if you want to inspect the dropdown
});
</script>

$VERSION being v2.

When you’ll have v1 ready, we’ll add it to the config. And you can change the $VERSION to v1 for the v1 part of the website

Does that makes sense ?