Y
Y
yezolux2014-10-19 22:03:28
Ruby on Rails
yezolux, 2014-10-19 22:03:28

RoR 4 and Elasticsearch. How to connect multi-modeling correctly?

Didn't find a solution.
To search for content in one model, I do the following:
In the model, I connect the concern
include Searchable according to the example elasticsearch-model#feature-extraction-pattern
+
Page.import
In the controller

@pages = Kaminari.paginate_array(Page.search(params[:query]).records).page(params[:page]).per(9)

Accordingly, the search is carried out within the same model. How to search for the specified models?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
romanwb, 2014-10-23
@romanwb

To search for several models at once, you can create a multi-model and search in it.
Here is the solution for this issue https://github.com/elasticsearch/elasticsearch-rai...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question