Search Sunspot by id

Is there a way to search for an object by id using subspot

So:

Content.search do with(:ids, [1,2,3]) end 
+4
source share
1 answer

Unfortunately, the only way to achieve this is to index the id field:

 class YourModel < ActiveRecord::Base searchable do integer :id # ... end end 
0
source

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


All Articles