Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Alias for facetfilters #469

Closed
endiliey opened this issue Jun 24, 2018 · 6 comments
Closed

Alias for facetfilters #469

endiliey opened this issue Jun 24, 2018 · 6 comments

Comments

@endiliey
Copy link
Contributor

endiliey commented Jun 24, 2018

Do you want to request a feature or report a bug?

feature

If it is a DocSearch index issue, what is the related index_name ?

index_name=jest

Explanation

Jest used Docusaurus as a framework, but there is a bug on how we translate the facetfilters on the currently used Docusaurus version. (facebook/docusaurus#797) It will only be fixed after Docusaurus release 1.3.1 and jest upgrade their Docusaurus version to 1.3.1

When jest is currently on 'en' and version '23.0'. It will send

facetFilters: [ "language:en", "version:current" ]

instead of

facetFilters: [ "language:en", "version:23.0" ]

Proposal

We want version alias. Example: if we send facetfilter version:current it will be translated to version:23.0

@s-pace
Copy link
Contributor

s-pace commented Jun 24, 2018

👋 You can change the meta and put it as an array:
<meta name="docsearch:language"content='["23.0","latest"]'>

WDYT @endiliey ?

@endiliey
Copy link
Contributor Author

@s-pace Can you give a specific example ?

@s-pace
Copy link
Contributor

s-pace commented Jun 24, 2018

Yes I put one but it was rendered as HTML. See the edit aboce

@endiliey
Copy link
Contributor Author

endiliey commented Jun 24, 2018

LGTM. Unfortunately I'm trying to look into an alias in the docsearch-configs itself because it's harder for user to upgrade to Docusaurus and changes to the docsearch metadata we put in <head itself

So that when user set
facetFilters: [ "language:en", "version:current" ]

and maybe something like this in their config

facetFiltersAlias: {
  'version': {
     'current': '23.0'
  }
}

The previous facet filter is seen as
facetFilters: [ "language:en", "version:23.0" ]

WDYT?

@s-pace
Copy link
Contributor

s-pace commented Jun 24, 2018

If you already know it, could it be possible to change it from the Search UI instead?

it will populate the meta tags and not the alias.

@endiliey
Copy link
Contributor Author

endiliey commented Jun 24, 2018

Yeah, the easiest is actually to change it from the Search UI.

It's just that if user use an older version of Docusaurus, they cannot change from the Search UI because the search UI is inside node_modules.

Anyway, seems that they'll have to upgrade to fix this. I'm closing this. Thank you for your time @s-pace 😃

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

No branches or pull requests

2 participants