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 :)

Reply
Join the discussion
Create an account Log in

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

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

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

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2024 GoRails, LLC. All rights reserved.