Build quick and detailed search via elasticsearch


Currently we at are using a homegrown postgres search for searching all the profiles and topics. There are two types of search:

  • a quick search (which only searches some fields - fullname, topics, twitter handle) and
  • a detailed search (which searches mostly all fields and makes it possible to search specific content in specific fields).
    See the search working here:

Now I want to use elasticsearch to rebuild the search and I already implemented the basic functions of elasticsearch via the elasticsearch-rails gem in this branch:

My questions:

What is the best way to build these two search options with elasticsearch? Specificly:

  • How to decide on the best approach to realize the two search options via elasticsearch (e.g. create multiple indeces, use different index types)?
  • Are there examples of similar approaches?

This is a very common setup. Are you sure you really want to add a separate section for advanced search? You could combine most of your requirements into one search box, simply by adding all the fields you want to be searchable, for instance using the multi-match query. Perhaps with the exception of language and country. These can be added as filters using a bool query.
Even if you should decide you want to go for a full blown advanced search where users have to hit the correct input box for each part, you still only need one index, and most likely just one type as well. Good luck!

thank you for sharing your thoughts!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.