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

Change over from Algolia search to PHP search backend #263

Merged

Conversation

llexical
Copy link
Contributor

@llexical llexical commented Jun 21, 2020

We originally added in Algolia as a stop gap as we had not very many
days before launch and needed to get something in quickly. However
Algolia is very expensive and although the searching is great we cannot
afford to keep running the site on it.

Here is where @ChrisHolland came in :D. There is now a PHP backend
setup that is super fast and works the same as Algolia for all intents
and purposes for our search! The new useSearch hook uses that and
removes the need for Algolia entirely from the site.

NOTE: I believe the new backend only indexes approved Businesses, so I could remove that search filter.

Pages/Interfaces that will change

  • Businesses page search functionality has changed but should look exactly the same.

Steps to test

  1. Go to the businesses page
  2. View results
  3. Search for as many different variations you can think of.
  4. Go through many pages in pagination.
  5. Try and break it.

Additional Notes

  • We will need to add SEARCH_API_ENDPOINT environment variable to Netlify.

 We originally added in Algolia as a stop gap as we had not very many
 days before launch and needed to get something in quickly. However
 Algolia is very expensive and although the searching is great we cannot
 afford to keep running the site on it.

 Here is where @ChrisHolland came in :D. There is now a PHP backend
 setup that is super fast and works the same as Algolia for all intents
 and purposes for our search! The new useSearch hook uses that and
 removes the need for Algolia entirely from the site.
Copy link
Member

@magnificode magnificode left a comment

Choose a reason for hiding this comment

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

This looks awesome @llexical thank you so much for getting this taken care of!! Appreciate you keeping the documentation updated as well 😄

Left one small comment about being able to remove any of the Algolia NPM packages.

From a code standpoint everything looks excellent. I need to get the SEARCH_API_ENDPOINT value set in Netlify so that I can do some testing for ya.

Thank you so much again!

package.json Show resolved Hide resolved
@magnificode
Copy link
Member

Oh! @llexical any chance we can also remove the "Search powered by Algolia" bit in this PR as well?

src/hooks/useSearch.js Outdated Show resolved Hide resolved
llexical and others added 3 commits June 21, 2020 22:16
Prefixed the frontend search environment variable with Gatsby. Honestly
not sure how much of a difference it makes however it does make it clear
and it guarentees it will build correctly so added it in.

Uninstalled the Algolia library and removed the 'search powered by
Algolia' message.
After the move over from Algolia to our own inhouse search the website
and donate links were not hooked up correctly with the cards.
@magnificode magnificode merged commit ed5fb33 into master Jun 22, 2020
@racedale racedale deleted the feature/237-changeover-from-algolia-to-new-search-backend branch September 22, 2020 02:23
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.

2 participants