# ES and MongoDB for filtering out objects

**URL:** <https://discuss.elastic.co/t/es-and-mongodb-for-filtering-out-objects/9231>\
**Category:** Elasticsearch\
**Created:** [October 3, 2012, 4:45pm UTC](https://discuss.elastic.co/t/es-and-mongodb-for-filtering-out-objects/9231 "2012-10-03T16:45:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matan\_Safriel](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Matan\_Safriel](https://discuss.elastic.co/u/Matan_Safriel)\
**Post date:** [October 3, 2012, 4:45pm UTC](https://discuss.elastic.co/t/es-and-mongodb-for-filtering-out-objects/9231/1 "2012-10-03T16:45:48Z")

</div>

Hi,

Still optimistic about making my first installation dance[https://groups.google.com/forum/?hl=en&fromgroups=#!topic/elasticsearch/ntbd5U6NBVo](https://groups.google.com/forum/?hl=en&fromgroups=#!topic/elasticsearch/ntbd5U6NBVo) (and  
looking at hosted 'forget about servers' alternatives, i.e. Heroku) I'd  
like to address the following more high level question:  
What can be said about the search performance of elasticsearch v.s.  
MongoDB. Hypothetically both store data objects that have fields and  
values, and allow querying that body of objects.

So presumably \*filtering \*out subsets of the objects according to fields  
selected ad-hoc, is something _fit for both_. I'm initially looking at  
filtering simultaneously by more than a single field - put differently, the  
filtering criteria would typically comprise anywhere between 1 and 4  
fields, maybe slightly more in some cases. Whereas the fields chosen as  
filters would be a subset of a much larger amount of fields. Picture some  
20 field names existing, and each query is an attempt to filter the objects  
by few fields out of those overall 20 fields (It can be less or more than  
20 overall field names existing, I just used this number to demonstrate the  
ratio of fields to fields used as filters in every discrete query). The  
type of filtering can be by the existence of the chosen fields, as well as  
by the field values, e.g. filtering out objects that have field _A_, and  
their field _B_ is between _x_ and _y_, and their field _C_ is equal to _w_.

Perhaps in elasticsearch \*indexes \*need to be defined, but maybe even  
without indexes speed is at par with that of MongoDB.  
I'm not yet aware that either of the two scales out better or worse than  
the other.

What do _you_ think?  
And, have you experimented this aspect?

Thanks,  
Matan

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:10am UTC](https://discuss.elastic.co/t/es-and-mongodb-for-filtering-out-objects/9231/2 "2017-07-06T03:10:19Z")

</div>


