问题
I understand we create views on couchdb and then we can search. Another interesting approach is to connect couchdb with elasticsearch thru river and search in elasticsearch. I have two questions:
- in terms of disk space usage, will elasticsearch be more efficient?
- what would be the pros and cons of using couchdb search vs using elasticsearch on top of couchdb?
Thanks!
回答1:
In terms of disk usage:
- https://github.com/logstash/logstash/wiki/Elasticsearch-Storage-Optimization
- http://till.klampaeckel.de/blog/archives/95-Operating-CouchDB.html
As Marcin pointed out, Elasticsearch excels in full-text-search and its flexibility of analyzer and search functionality.
回答2:
Only thing CouchDB queries can give you is the key -> value mapping. You can search the ordered dictionary, but you cannot search in the multi-dimensional data, with regular expression or even the key that contain a keyword as a substring (e.g. you have data "Mr. John Smith", and you want it to be found by the query with the keyword "John"). ElasticSearch fills the gap and provides additional indexing of the data. It is mainly useful for full-text indexing, but also supports geospatial data.
来源:https://stackoverflow.com/questions/13025065/searching-in-couchdb-or-do-river-thru-an-elastic-search