Skip to content
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

Search for correct language & version in website #6533

Merged
merged 5 commits into from
Jun 28, 2018
Merged

Search for correct language & version in website #6533

merged 5 commits into from
Jun 28, 2018

Conversation

endiliey
Copy link
Contributor

@endiliey endiliey commented Jun 23, 2018

Summary

Close #6531

Test plan

Unfortunately I am unable to test locally due to process.env.ALGOLIA_JEST_API_KEY being hidden from me :)

But implementation is according to https://docusaurus.io/docs/en/search#extra-search-options

Any occurrences of "VERSION" or "LANGUAGE" will be replaced by the version or language of the current page, respectively.

@SimenB
Copy link
Member

SimenB commented Jun 23, 2018

@yangshun seems like something that should be the default?

@endiliey endiliey changed the title Search for correct language in website Search for correct language & version in website Jun 24, 2018
@endiliey
Copy link
Contributor Author

endiliey commented Jun 24, 2018

Hi @SimenB
I wanted to ask for your opinion on this. There is a bug on searching for correct version in Docusaurus <= 1.3.0 (including 1.2.0, 1.0.5, etc)
The search is broken when we are currently on 'latest stable version' if we use
facetFilters: ['language:LANGUAGE', 'version:VERSION'],

The good news is that it is fixed in facebook/docusaurus#797 which is probably released in 1.3.1.

So there are three options for now:

  1. Search for correct language but only search for docs version '23.0'
    facetFilters: ['language:LANGUAGE', 'version:23.0'],
  2. Search for correct language & correct version
    But this might need a wait a little bit before merging this PR while we work on a workaround in algolia
    Alias for facetfilters algolia/docsearch-configs#469 or when Docusaurus release 1.3.1
  3. Leave it as it is (close this PR) -> but this means that there are duplicate search on jest docsearch

duplicate

@yangshun
Copy link
Contributor

yangshun commented Jun 24, 2018

I'll leave @endiliey to resolve this for Jest. He has been working on languages and search for Docusaurus 😄

@thymikee
Copy link
Collaborator

Search for correct language but only search for docs version '23.0'
facetFilters: ['language:LANGUAGE', 'version:23.0'],

I'd go with this solution and fix the dynamic version when Algolia is updated.
Also, looks like we need 23.1 version sync on website 😅.

@endiliey
Copy link
Contributor Author

endiliey commented Jun 24, 2018

I'd go with this solution and fix the dynamic version when Algolia is updated.

done. This shall be fixed in Docusaurus 1.3.1 by the way 😃

Also, looks like we need 23.1 version sync on website

I think it's good to have it in separate PR ? Do you need help ? Seems to me that we'll have to add 23.0.1 and 23.1

@codecov-io
Copy link

Codecov Report

Merging #6533 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6533   +/-   ##
=======================================
  Coverage   63.75%   63.75%           
=======================================
  Files         234      234           
  Lines        8810     8810           
  Branches        3        4    +1     
=======================================
  Hits         5617     5617           
  Misses       3192     3192           
  Partials        1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 393e971...7453f3b. Read the comment docs.

@cpojer cpojer merged commit a173a42 into jestjs:master Jun 28, 2018
@cpojer
Copy link
Member

cpojer commented Jun 28, 2018

Nice, thanks for sending this PR!

@endiliey endiliey deleted the search branch June 28, 2018 07:55
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Website docsearch according to current language & version
7 participants