# ЗАДАЧА РЕШЕНА = Ошибка после обновления ДО Elasticsearch 7.11

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-11/269255>\
**Category:** Вопросы на русском языке\
**Created:** [April 5, 2021, 5:52pm UTC](https://discuss.elastic.co/t/elasticsearch-7-11/269255 "2021-04-05T17:52:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dima\_Sid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dima_sid/32/53790_2.png) [@Dima\_Sid](https://discuss.elastic.co/u/Dima_Sid)\
**Post date:** [April 5, 2021, 5:52pm UTC](https://discuss.elastic.co/t/elasticsearch-7-11/269255/1 "2021-04-05T17:52:18Z")

</div>

ЗАДАЧА РЕШЕНА = Лишние скобки у should  
Собственно ошибка  
'error' =\> [  
'error' =\> [  
'root\_cause' =\> [  
[  
'type' =\> 'x\_content\_parse\_exception',  
'reason' =\> '[1:182] [bool] failed to parse field [should]',  
],  
],  
'type' =\> 'x\_content\_parse\_exception',  
'reason' =\> '[1:182] [bool] failed to parse field [must]',  
'caused\_by' =\> [  
'type' =\> 'x\_content\_parse\_exception',  
'reason' =\> '[1:182] [bool] failed to parse field [should]',  
'caused\_by' =\> [  
'type' =\> 'illegal\_state\_exception',  
'reason' =\> 'expected value but got [START\_ARRAY]',  
],  
],  
],  
'status' =\> 400,  
],

А вот сам запрос

```auto
[
   'url' => 'shop_items/_search',
   'method' => 'POST',
   'data' => [
       'query' => [
           'bool' => [
               'must' => [
                   [
                       'match' => [
                           'available' => 1,
                       ],
                   ],
                   [
                       'fuzzy' => [
                           'search_keywords' => [
                               'value' => 'набор',
                               'fuzziness' => 'auto',
                               'prefix_length' => 0,
                           ],
                       ],
                   ],
                   [
                       'bool' => [
                           'should' => [
                               [
                                   [
                                       'span_near' => [
                                           'clauses' => [
                                               [
                                                   'span_multi' => [
                                                       'match' => [
                                                           'fuzzy' => [
                                                               'search_keywords' => [
                                                                   'value' => 'набор',
                                                                   'fuzziness' => 2,
                                                               ],
                                                           ],
                                                       ],
                                                   ],
                                               ],
                                               [
                                                   'span_multi' => [
                                                       'match' => [
                                                           'fuzzy' => [
                                                               'search_keywords' => [
                                                                   'value' => 'набор',
                                                                   'fuzziness' => 2,
                                                               ],
                                                           ],
                                                       ],
                                                   ],
                                               ],
                                           ],
                                           'slop' => 0,
                                           'in_order' => false,
                                       ],
                                   ],
                               ],
                           ],
                       ],
                   ],
               ],
           ],
       ],
       'aggs' => [
           'shop_category' => [
               'terms' => [
                   'field' => 'shop_category',
                   'size' => 1000,
               ],
           ],
           'max_price' => [
               'max' => [
                   'field' => 'price',
               ],
           ],
           'min_price' => [
               'min' => [
                   'field' => 'price',
               ],
           ],
           'colors' => [
               'terms' => [
                   'field' => 'color.title.keyword',
                   'size' => 100,
               ],
               'aggs' => [
                   'colors_slug' => [
                       'terms' => [
                           'field' => 'color.slug.keyword',
                           'size' => 100,
                       ],
                   ],
               ],
           ],
           'gender' => [
               'terms' => [
                   'field' => 'gender.title.keyword',
                   'size' => 100,
               ],
               'aggs' => [
                   'genders_slug' => [
                       'terms' => [
                           'field' => 'gender.slug.keyword',
                           'size' => 100,
                       ],
                   ],
               ],
           ],
           'provider' => [
               'terms' => [
                   'field' => 'provider.title.keyword',
                   'size' => 100,
               ],
               'aggs' => [
                   'providers_slug' => [
                       'terms' => [
                           'field' => 'provider.slug.keyword',
                           'size' => 100,
                       ],
                   ],
               ],
           ],
           'vendor' => [
               'terms' => [
                   'field' => 'vendor.title.keyword',
                   'size' => 100,
               ],
               'aggs' => [
                   'vendors_slug' => [
                       'terms' => [
                           'field' => 'vendor.slug.keyword',
                           'size' => 100,
                       ],
                   ],
               ],
           ],
           'material' => [
               'terms' => [
                   'field' => 'material.title.keyword',
                   'size' => 100,
               ],
               'aggs' => [
                   'materials_slug' => [
                       'terms' => [
                           'field' => 'material.slug.keyword',
                           'size' => 100,
                       ],
                   ],
               ],
           ],
           'size' => [
               'terms' => [
                   'field' => 'size.title.keyword',
                   'size' => 100,
               ],
               'aggs' => [
                   'sizes_slug' => [
                       'terms' => [
                           'field' => 'size.slug.keyword',
                           'size' => 100,
                       ],
                   ],
               ],
           ],
           'country' => [
               'terms' => [
                   'field' => 'country.title.keyword',
                   'size' => 100,
               ],
               'aggs' => [
                   'countrys_slug' => [
                       'terms' => [
                           'field' => 'country.slug.keyword',
                           'size' => 100,
                       ],
                   ],
               ],
           ],
       ],
       'size' => 48,
       'from' => 1,
   ],
   'error' => [
       'error' => [
           'root_cause' => [
               [
                   'type' => 'x_content_parse_exception',
                   'reason' => '[1:182] [bool] failed to parse field [should]',
               ],
           ],
           'type' => 'x_content_parse_exception',
           'reason' => '[1:182] [bool] failed to parse field [must]',
           'caused_by' => [
               'type' => 'x_content_parse_exception',
               'reason' => '[1:182] [bool] failed to parse field [should]',
               'caused_by' => [
                   'type' => 'illegal_state_exception',
                   'reason' => 'expected value but got [START_ARRAY]',
               ],
           ],
       ],
       'status' => 400,
   ],
]

```

---

<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:** [May 3, 2021, 5:52pm UTC](https://discuss.elastic.co/t/elasticsearch-7-11/269255/2 "2021-05-03T17:52:47Z")

</div>

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