How do I implement an advanced search with Ruby on Rails and elasticsearch?

I've have already implement the nav bar search option but I do also need to do an advance search could you please help me with ideas and some code thanks. My database is a demo for a real estate listing website so I need to look by city, square_feet, price, type_property, bedrooms, bathrooms and one filter at the the time. Thanks

Posted over 5 years ago by Grace Molina
Posted over 5 years ago by Alex Yang

Grace, this forum isn't for outsourcing the code development you need, but we can help point you in the right direction. Nate is right - you need an advanced filter menu. This is basically a form where the user's inputs are used to choose which results to display in your search controller.

For an example of a simple search filter, you should check out the three-part series in the Video Library. Here's the link to Part I:

If you need further help, just let us know what's already working and what else you've tried. Good luck!

Posted over 5 years ago by Nate

I'm not exactly sure how to do this, but you need to have an advanced search form where the new fields are meant for keywords that you'll use to search your database. Those will then be passed to variables in your search controller.

Looking at the Facets section on the searchkick gem ReadMe may give you some ideas.

Sorry I can't be of more help, but that's where I'd start.