Skip to content

attempt algolia search fix#357

Closed
swyxio wants to merge 4 commits intomasterfrom
sw-yx-patch-2
Closed

attempt algolia search fix#357
swyxio wants to merge 4 commits intomasterfrom
sw-yx-patch-2

Conversation

@swyxio
Copy link
Copy Markdown
Contributor

@swyxio swyxio commented Apr 19, 2021

This doesnt work yet! we THINK we have a cause, but we are not sure it is the ROOT cause. have filed a pair issue on the docusaurus repo facebook/docusaurus#4644

What was changed:

changed algolia search config

Why?

our search page always returns blank right now. we think its because as of this PR
#327 (When we upgraded Docusaurus from alpha 66 to alpha 72)

the search has started to send in default facets ["language","docusaurus_tag"] and facetFilters [["language:en"],["docusaurus_tag:default","docusaurus_tag:docs-default-current"]]"} where it didn't use to before (internal notes: https://www.notion.so/temporalio/debug-search-8213484654214fb784952d0e5d474501)

as far as I can tell this is undocumented and i'm not sure it is intentional behavior (cc @slorber in case this was supposed to be documented)

How was this tested:

testing in deploy preview:

https://deploy-preview-357--mystifying-fermi-1bc096.netlify.app/search/?q=workflow

Comment on lines +191 to +192
facetFilters: [],
facets: []
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not work to clear the facetFilters field. i also tried facetFilters: null and that did not work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

somehow the legacy search page does not respect these settings, it's like contextual search is always enabled by default in this page so you can't remove the hardcoded facet filters.

But this highlighted a more important problem: your docsearch config is wrong. Fix it, and contextual search + facet filters will both work.

@slorber
Copy link
Copy Markdown
Contributor

slorber commented Apr 20, 2021

hi,

It looks like your DocSearch config has diverged quite a lot from the regular Docusaurus 2 docsearch config:

In particular, your config does not permit Algolia to index the facetting fields such as docusaurus_tag that we set in pages and use for contextual search filtering.

When we released Contextual Search, I think Algolia run a batch update of all the Docusaurus 2 configs to add those new fields, but maybe it didn't update your config for some reason?

cc @shortcuts @Shipow

@shortcuts
Copy link
Copy Markdown

It indeed seems like this one hasn't been updated @slorber.

I've opened a PR here algolia/docsearch-configs#3986, which will allow you to use the Contextual Search @sw-yx

@swyxio
Copy link
Copy Markdown
Contributor Author

swyxio commented Apr 20, 2021

oh awesome, thanks so much both of you!

@swyxio swyxio closed this Apr 20, 2021
@flossypurse flossypurse deleted the sw-yx-patch-2 branch April 21, 2021 18:23
shortcuts pushed a commit to algolia/docsearch-configs that referenced this pull request May 16, 2021
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

Successfully merging this pull request may close these issues.

3 participants