Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute runCommand with Mongoid?

I have text index in MongoDB and want to use text command for searching in my collection. Can't find this functionality in Mongoid.

like image 748
egens Avatar asked Dec 12 '25 20:12

egens


1 Answers

I have tried to find the solution as I am also a mongoid user. I haven't found anything specific related to search text in mongoid other than where query. After little investigation I have found mongoid_search gem which could be useful for search text.

It has one limitation that is written in very first line of readme is "If your searchable model is big (i.e. 1.000.000+ records), solr or sphinx may suit you better." If you have so you need to configure solr or elasticsearch for better performance. If you are going to deploy on heroku then please develop in that consideration too.

May be this would help you to achieve your goal.

like image 96
Anand Soni Avatar answered Dec 14 '25 13:12

Anand Soni