Skip to content

Nested version search index problem #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yyx990803 opened this issue Nov 9, 2016 · 19 comments
Closed

Nested version search index problem #575

yyx990803 opened this issue Nov 9, 2016 · 19 comments

Comments

@yyx990803
Copy link
Member

@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?

@maxiloc
Copy link
Contributor

maxiloc commented Nov 9, 2016

Yes we do have multi version capabilities. I updated the vuejs config to prepare for multiversion
(algolia/docsearch-configs@4b816ab)

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 ?

@yyx990803
Copy link
Member Author

@maxiloc awesome, thanks again!

@kazupon
Copy link
Member

kazupon commented Nov 18, 2016

@maxiloc
Does this support for japanese translation?

@maxiloc
Copy link
Contributor

maxiloc commented Nov 18, 2016

Yes we can support it as well but right now http://jp.vuejs.org/v2/api/ does not exist so I can not move it to the new config.

@kazupon
Copy link
Member

kazupon commented Nov 19, 2016

@maxiloc
thanks!
I don't deploy the latest version (2.0 japanese translation) yet.
already, I have been set the new configration.
https://github.com/vuejs/jp.vuejs.org/blob/lang-ja-2.0/themes/vue/layout/layout.ejs#L78-L84

Are we ok with new configration?

@maxiloc
Copy link
Contributor

maxiloc commented Nov 22, 2016

Yes as soon as you deploy ping me and I'll update the config

@kazupon
Copy link
Member

kazupon commented Nov 22, 2016

@maxiloc thanks!

@kazupon
Copy link
Member

kazupon commented Nov 23, 2016

@maxiloc
deploy done.

search configuration is the following:

@maxiloc
Copy link
Contributor

maxiloc commented Nov 23, 2016

Ok it's deployed on our side. You just need to update the v1 by this one:

 docsearch({
            apiKey: '0a75952972806d9ad07e387d08e9cc4c',
            indexName: 'vuejs_jp',
            inputSelector: selector,
            algoliaOptions: { facetFilters: ["version:v1"] }
          })

@kazupon
Copy link
Member

kazupon commented Nov 23, 2016

@maxiloc
thanks quick reply!
I' fixed configuration.
vuejs/v1-jp.vuejs.org@267b40f

@kazupon
Copy link
Member

kazupon commented Nov 25, 2016

@maxiloc
I think that algolia docsearch does not indexed for vuejs japanese translation.
I checked docsearch config of vuejs_jp.
https://github.com/algolia/docsearch-configs/blob/master/configs/vuejs_jp.json#L21-L37

It's is not "url": "http://(?P<version>.*?).vuejs.org/guide/", but "url": "http://(?P<version>.*?)-jp.vuejs.org/guide/", Isn't it?

@maxiloc
Copy link
Contributor

maxiloc commented Nov 25, 2016

@kazupon My bad, it should be fixed now

@kazupon
Copy link
Member

kazupon commented Nov 25, 2016

@maxiloc Thank you very much! 😺

@gbezyuk
Copy link
Contributor

gbezyuk commented Dec 9, 2016

@maxiloc, @yyx990803 — could you please give me a hint on how to update Algolia config for Russian translation? Comparing Japanese and English versions I've realized I need to provide different apiKey and indexName, but I don't seem to understand where could I get 'em.

@maxiloc
Copy link
Contributor

maxiloc commented Dec 9, 2016

I need to configure it. What is the url ?

@gbezyuk
Copy link
Contributor

gbezyuk commented Dec 9, 2016

https://ru.vuejs.org/

@maxiloc
Copy link
Contributor

maxiloc commented Dec 9, 2016

Here you go:
index_name: vuejs_ru
api_key: c6f9366f6f7fe057ee3e01747b603d9f

@gbezyuk
Copy link
Contributor

gbezyuk commented Dec 9, 2016

@maxiloc awesome! Thank you!

@chrisvfritz
Copy link
Contributor

I believe this is all resolved now, so closing. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants