Can thinking-sphinx ransack work together?

Our project uses Ransack at the moment, we are thinking of introducing Thinking-Sphinx. However, they both use the search keyword. Can Thinking-Sphinx and Ransack be used in the same project?

Thanks in advance.

+6
source share
1 answer

The Ransack search method is just an alias. Instead, you can use the ransack method.

Instead:

 @q = Person.search(params[:q]) @people = @q.result(:distinct => true) 

Using:

 @q = Person.ransack(params[:q]) @people = @q.result(:distinct => true) 

Person.search should call ThinkingSphinx as usual.

+8
source

Source: https://habr.com/ru/post/912993/


All Articles