# Range Filter on array with different range

**URL:** <https://discuss.elastic.co/t/range-filter-on-array-with-different-range/104988>\
**Category:** Elasticsearch\
**Created:** [October 24, 2017, 2:41am UTC](https://discuss.elastic.co/t/range-filter-on-array-with-different-range/104988 "2017-10-24T02:41:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Canappeco](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@Canappeco](https://discuss.elastic.co/u/Canappeco)\
**Post date:** [October 24, 2017, 2:41am UTC](https://discuss.elastic.co/t/range-filter-on-array-with-different-range/104988/1 "2017-10-24T02:41:28Z")

</div>

Hi all.

I have an index named 2000 on my Elasticsearch cluster, here is the map:

```auto
curl -XGET "192.168.1.140:9200/2000/_mapping?pretty"
{
  "2000" : {
    "mappings" : {
      "testData" : {
        "properties" : {
          "faceFeature" : {
            "type" : "float"
          }
        }
      }
    }
  }
}

```

The content of `faceFeature` is a 128-dimensional array of `float` type. For example, it can be:

```auto
[0.3, 0.7, -0.4, -0.6, ...]

```

Now I have a standard array. To make it easy, I call this array `a`. For example, `a` is:

```auto
[0.2, 0.8, -0.7, -0.3, ...]

```

Now in every dimension, I hope that I can get the array in given range:

[![eg](http://latex.codecogs.com/gif.latex?0.2%5Cpm0.5), ![eg](http://latex.codecogs.com/gif.latex?0.8%5Cpm0.5), ![eg](http://latex.codecogs.com/gif.latex?-0.7%5Cpm0.5), ![eg](http://latex.codecogs.com/gif.latex?-0.3%5Cpm0.5), ...]

That means array like`[0.3, 0.5, -0.5, -0.6, ...]` is what I want to get but array like `[0.1, -0.1, 0.2, -0.5, ...]` is not what I want to get because its second dimension is out of the range ![eg](http://latex.codecogs.com/gif.latex?0.8%5Cpm0.5) as well as the third dimension is out of the range ![eg](http://latex.codecogs.com/gif.latex?-0.7%5Cpm0.5).

How can I do this using query?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Canappeco](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@Canappeco](https://discuss.elastic.co/u/Canappeco)\
**Post date:** [October 24, 2017, 11:04am UTC](https://discuss.elastic.co/t/range-filter-on-array-with-different-range/104988/2 "2017-10-24T11:04:02Z")

</div>

hmm, maybe this is a really difficult problem.

Now I try to save this 128-dimensional array with 128 field, but I found that saving such a document is so slowly. It save 6000 thousand documents in three hours.

Is there a limit of the number of field? Or maybe it will be slow with so many fields in an index?

---

<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:** [November 21, 2017, 11:04am UTC](https://discuss.elastic.co/t/range-filter-on-array-with-different-range/104988/3 "2017-11-21T11:04:02Z")

</div>

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