All threads / Autocomplete search across multiple models with results from each model

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Autocomplete search across multiple models with results from each model

nynhex asked in Rails

I'm building a simple wiki app and would like to introduce autocomplete search using Searchkick or pg_search. In the search box I'd like to be able to do a search across both an Article and Category model searching Article for title and body and Category by the name column.

I think I can do this with pg_search using multisearch, but I'm curious as to how to display this information using JSON in the search box and how it works similar to Gorails.

Looking foward to an episode on this :)

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,629+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.