# How to query for attributes in objects which are in an embedded array?

**URL:** <https://discuss.elastic.co/t/how-to-query-for-attributes-in-objects-which-are-in-an-embedded-array/68543>\
**Category:** Elasticsearch\
**Created:** [December 9, 2016, 9:54am UTC](https://discuss.elastic.co/t/how-to-query-for-attributes-in-objects-which-are-in-an-embedded-array/68543 "2016-12-09T09:54:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![whitenexx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whitenexx/32/13773_2.png) [@whitenexx](https://discuss.elastic.co/u/whitenexx)\
**Post date:** [December 9, 2016, 9:54am UTC](https://discuss.elastic.co/t/how-to-query-for-attributes-in-objects-which-are-in-an-embedded-array/68543/1 "2016-12-09T09:54:22Z")

</div>

Hello everybody,

i've a elasticsearch 2.4 instance which contains products in a products index. Someone else built this index and pushed the products in it.

Now i would like to create a range query by price. The problem is that the prices are stored within an embedded array. How can i query this prices (facet\_float\_price =\> v)? I couldn't figure out how to query object attributes who are contained in an array.

The indexed product documents look like this:

```
 {
    "_index": "products",
    "_type": "p",
    "_id": "1195449",
    "_score": 1.0,
    "_source": {
      "float_priceDiff": 0,
      "int_pricedate": 1480940837,
      "int_year": null,
      "int_deliveryDays": "1",
      "string_search": "Product name and some text",
      "facet_string": [
        {
          "k": "facet_string_brand",
          "v": null
        },
        {
          "k": "facet_string_line",
          "v": null
        }
      ],
      "facet_int": [
        {
          "k": "facet_int_brandId",
          "v": 0
        },
        {
          "k": "facet_int_categoryId",
          "v": [
            -1
          ]
        }
      ],
      "facet_boolean": [
        {
          "k": "facet_boolean_hasDeal",
          "v": false
        }
      ],
      "facet_float": [
        {
          "k": "facet_float_price",
          "v": 23.7
        }
      ]
    }
  }

```

Thank you very much and best regards

---

<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:** [January 6, 2017, 9:54am UTC](https://discuss.elastic.co/t/how-to-query-for-attributes-in-objects-which-are-in-an-embedded-array/68543/2 "2017-01-06T09:54:37Z")

</div>

Closed on January 6, 2017, 9:54am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
