# Query/Filter on Complex Object, Multiple Values

**URL:** <https://discuss.elastic.co/t/query-filter-on-complex-object-multiple-values/29067>\
**Category:** Elasticsearch\
**Created:** [September 10, 2015, 8:16pm UTC](https://discuss.elastic.co/t/query-filter-on-complex-object-multiple-values/29067 "2015-09-10T20:16:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronchalant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ronchalant/32/3611_2.png) [@ronchalant](https://discuss.elastic.co/u/ronchalant)\
**Post date:** [September 10, 2015, 8:16pm UTC](https://discuss.elastic.co/t/query-filter-on-complex-object-multiple-values/29067/1 "2015-09-10T20:16:30Z")

</div>

I'm not sure that this is possible, have not found anything so figured I'd toss it out to the community.

Suppose I have data that has a date/time component as well as a separate value, something like this:

```
{ 
   "values": [
      { "date": "2015-01-01T12:34:56", "value": "apple" },
      { "date": "2011-05-05T14:50:00", "value": "orange" },
      { "date": "2009-09-09T09:32:38", "value": "banana" }
  ] }

```

Or something like that. if I wanted to set up a query that took into account both the 'date' and 'value' attributes of an individual value object, is that possible?

Meaning say I wanted to run a query that returned documents with `value` of apple and `date` greater than the year 2014, it should return the above document because it has a single `values[]` entry containing that, but if I ran the same type of query with a `value` of apple and `date` less than the year 2014 it should _not_ return the above document because those values don't exist in the same object.

Is that even possible? I don't think it is, but I figured it doesn't hurt to ask.

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [September 10, 2015, 8:27pm UTC](https://discuss.elastic.co/t/query-filter-on-complex-object-multiple-values/29067/2 "2015-09-10T20:27:34Z")

</div>

See nested doc support

[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-nested-type.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-nested-type.html)

---

<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 5, 2017, 11:51pm UTC](https://discuss.elastic.co/t/query-filter-on-complex-object-multiple-values/29067/3 "2017-07-05T23:51:03Z")

</div>


