# Sort search results when sorted by double\_range or float\_range field return array\_index\_out\_of\_bounds\_exception

**URL:** <https://discuss.elastic.co/t/sort-search-results-when-sorted-by-double-range-or-float-range-field-return-array-index-out-of-bounds-exception/287753>\
**Category:** Elasticsearch\
**Created:** [October 27, 2021, 6:05am UTC](https://discuss.elastic.co/t/sort-search-results-when-sorted-by-double-range-or-float-range-field-return-array-index-out-of-bounds-exception/287753 "2021-10-27T06:05:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carpeDiem](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carpediem/32/88362_2.png) [@carpeDiem](https://discuss.elastic.co/u/carpeDiem)\
**Post date:** [October 27, 2021, 6:05am UTC](https://discuss.elastic.co/t/sort-search-results-when-sorted-by-double-range-or-float-range-field-return-array-index-out-of-bounds-exception/287753/1 "2021-10-27T06:05:22Z")

</div>

Hello experts,  
I'm currently trying to sort search results by double\_range or float\_range field,but return a server error:array\_index\_out\_of\_bounds\_exception,I've included the query and the error output, is this supported, and/or is there any workarounds?  
this is mapping setting:

 ![企业微信截图_1635311928317](https://us1.discourse-cdn.com/elastic/original/3X/1/6/16677a64b1c9d383e4939e3e64f5a7d21e8645cf.png)  
this is documents  
 ![企业微信截图_16353119739220](https://us1.discourse-cdn.com/elastic/original/3X/4/8/482356fbcbe95042655655b13f8a798345d3a4e9.png)  
this is request body and results

```auto
POST */_search
{
    "_source":true,
    "aggs":{
        
    },
    "from":0,
    "highlight":{
        "fields":{
            "*":{
                "fragment_size":10000
            }
        },
        "post_tags":[
            "@/kibana-highlighted-field@"
        ],
        "pre_tags":[
            "@kibana-highlighted-field@"
        ],
        "require_field_match":false
    },
    "query":{
        "bool":{
            "filter":[],
            "must":[
                {
                    "query_string":{
                        "analyze_wildcard":true,
                        "default_field":"*",
                        "lenient":true,
                        "query":"*",
                        "type":"phrase"
                    }
                }
            ],
            "must_not":[],
            "should":[]
        }
    },
    "size":10,
    "sort":[
        {
            "double_range":{
                "missing":"_last",
                "order":"desc",
                "unmapped_type":"double_range"
            }
        }
    ]
}

```

 ![企业微信截图_16353126139214](https://us1.discourse-cdn.com/elastic/original/3X/3/6/36eac8ff1e03eb7e639ded0417fb748f26dffbec.png)

Looking forward to any help! Thank you!

---

<div class="post-metadata">

**Author:** ![carpeDiem](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carpediem/32/88362_2.png) [@carpeDiem](https://discuss.elastic.co/u/carpeDiem)\
**Post date:** [November 16, 2021, 10:05am UTC](https://discuss.elastic.co/t/sort-search-results-when-sorted-by-double-range-or-float-range-field-return-array-index-out-of-bounds-exception/287753/2 "2021-11-16T10:05:15Z")

</div>

Are there someone can help me？Thanks！

---

<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:** [December 14, 2021, 10:06am UTC](https://discuss.elastic.co/t/sort-search-results-when-sorted-by-double-range-or-float-range-field-return-array-index-out-of-bounds-exception/287753/3 "2021-12-14T10:06:14Z")

</div>

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