开发者

How do I implement elastic search in a ruby on rails project hosted on heroku?

My plan is to run elastic search on a separate linux server as a web service. Then I will make calls to it directly from my app to search with strings or other unstructured d开发者_开发技巧ata. What I don't understand is will this basically replace my database for certain objects or at the time that the object is created, should I index it's ID, object type and tags in elastic search as well as simultaneously save the entire object to my database? Then I can make a call to the web service to get the object's ID and then query my database based on that ID to retrieve the actual object?

Is this the right way to think about using elastic search?


You can use ElasticSearch in both ways: using it as a primary storage, or as a search engine. The Tire rubygem allows you to do that, see the README.

With ElasticSearch, it makes more sense to use it as a source for data, since it can index and store arbitrary JSON. You may want to save your data into separate storage for backup and redundancy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜