Skip to main content

Searchkick conversion settings help

Gems / Libraries • Asked by Alex Deering

Im starting to integrate search features into my recipe app and looking to build a "Popular", "Trending", and "Just For You" query to display on the index screen. Ive got the searchkick and searchjoy gems install and basic search with filtering constraints setup via tags and aggs. Reading thru the searchkick documentation it looks like the feature I want to use for the popular and trending is conversions. Having a little trouble understanding the flow of logging conversions to the database and the elasticsearch indexing though.

My understanding so far is with the searchjoy gem, have a separate table that logs searches by users, time, etc. Then I need to pass the id of the search to the results view, and if I want to track some action like viewing a recipe need to update the search record with that recipe id. Is that right?

That all seems pretty straightforward, but I have a few questions to make sure Im setting this up right:

  1. If I want to track a conversion that requires them to view a recipe first, like saving a recipe to their favorites, I should pass the search id to the show view as well and then trigger conversion with the save action?
  2. If i wanted to make a few types of conversions would I do something like this: searchkick conversions: [:view_conversions, :save_conversions, :made_conversions] And for tracking those in the searches table I guess I would need to create a new column with the conversion type, since all of those would be recipe conversions which searchjoy just has the record type and id...does this seem right?

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.