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

Algolia search #143

Merged
merged 2 commits into from
Aug 20, 2021
Merged

Algolia search #143

merged 2 commits into from
Aug 20, 2021

Conversation

bravo-kernel
Copy link
Collaborator

@bravo-kernel bravo-kernel commented Aug 20, 2021

Now that we have been added to Algolia DocSearch, this PR enables the SearchBar for the website.

Good to know:

  • Crawler: search results only get updates after the Algolia crawler has indexed the site, runs once every 24 hours
  • Contextual Search: Docusaurus supports contextual search meaning users browsing the v4 website should only see v4 matches in the SearchBar

PLEASE NOTE: if I understand correctly, contextual search requires a new crawl after this PR is merged (because meta tags will be added to the website). Therefore, after merging the search box will not produce results until the next crawl.

SearchBar position

I propose positioning the SearchBar at this location:

right

Alternative locations could be.

Left-most

left

Right-most

default

After internal pages

after-internal

@bravo-kernel bravo-kernel mentioned this pull request Aug 20, 2021
@bravo-kernel
Copy link
Collaborator Author

bravo-kernel commented Aug 20, 2021

@nohwnd to test the various SearchBar locations locally:

  1. clone locally
  2. run yarn start
  3. move the lines below (to a different order inside the items array)
    {
    type: 'search', // algolia search
    position: 'right',
    },

@nohwnd
Copy link
Member

nohwnd commented Aug 20, 2021

@bravo-kernel I like the location that you proposed the most as well.

@bravo-kernel
Copy link
Collaborator Author

Let's merge it then and 🙏 the SearchBox contains content tomorrow :)

@nohwnd nohwnd merged commit 7bdd0fb into pester:master Aug 20, 2021
@nohwnd
Copy link
Member

nohwnd commented Aug 20, 2021

done

@fflaten
Copy link
Collaborator

fflaten commented Aug 22, 2021

Should have been crawled now, right? Any ideas why there's still no results?

@bravo-kernel
Copy link
Collaborator Author

Yes, I noticed the same. It looks like the contextual search filters that are being sent by Docusaurus are not working as expected (for our specific case, where we are using current as v5). I will ask for some support somewhere this week.

@nohwnd
Copy link
Member

nohwnd commented Aug 23, 2021

Great. I went to re-check a minute ago as well, and still the same :)

@bravo-kernel
Copy link
Collaborator Author

Just FYI Docusaurus is producing the correct tags, it seems facet filtering on these tags needs to be configured inside Algolia. However, I cannot find the option in their interface yet. I am quite busy with work so this might take some days.

image

@bravo-kernel
Copy link
Collaborator Author

Found the root cause.

There is no GUI option when using the free/open-source web interface. Instead, facet filtering must be enabled by creating a Pull Request on the Algolia DocSearch configs repository.

Our Pester config was created using the Algolia defaults and thus need to be updated so the config looks similar to this example.

I will not be able to look at this until this weekend so feel free to pick this up if it is required sooner.

@bravo-kernel
Copy link
Collaborator Author

PR now open at algolia/docsearch-configs#4540

@bravo-kernel
Copy link
Collaborator Author

PR has been merged, search is now working as expected 🎉 .

To test contextual search:

  • try searching for gherkinstep when in the v5 website context
  • then switch to the v4 website and search for the same term

Pretty amazing stuff, happy tweeting, do not forget to tag @algolia.

@fflaten
Copy link
Collaborator

fflaten commented Aug 30, 2021

Looks and works great! Awesome job @bravo-kernel 👏

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.

None yet

3 participants