Friendly URLs + Routing with SearchKick

I am currently in the midst of building a directory that list services in a particular City and State. My goal is to be able to have a user search from the homepage and navigate to a static URL that is SEO friendly. This URL should also update and cache whenever a new listing is added. Is this something that's SearchKick is capable of? Thank you!

Posted over 5 years ago by johnathan
Posted over 5 years ago by Alex Yang

Johnathan, can you explain more on what you're looking for? The search feature as demonstrated in the Yelpdemo course contains the search terms in the URL (e.g. 'website.com/restaurants/search?utf8=%E2%9C%93&search=Panera+Bread'). You could make this more readable (e.g. 'website.com/restaurants/search/Panera-Bread'), but it should already be fine from an SEO standpoint.

The searchkick gem handles the output of search results but not the URL for the page that they're displayed on. You'll need to set that up separately in your config/routes.rb file.

Finally, I'm not that knowledgeable when it comes to caching, but I recommend reading the Rails Guide on this topic: http://guides.rubyonrails.org/caching_with_rails.html

Hope that helps!

0