# Elasticsearch issue: nested: NumberFormatException\[For input string:

**URL:** <https://discuss.elastic.co/t/elasticsearch-issue-nested-numberformatexception-for-input-string/293730>\
**Category:** Elasticsearch\
**Created:** [January 7, 2022, 11:19am UTC](https://discuss.elastic.co/t/elasticsearch-issue-nested-numberformatexception-for-input-string/293730 "2022-01-07T11:19:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiran\_Chauhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kiran_chauhan/32/99970_2.png) [@Kiran\_Chauhan](https://discuss.elastic.co/u/Kiran_Chauhan)\
**Post date:** [January 7, 2022, 11:19am UTC](https://discuss.elastic.co/t/elasticsearch-issue-nested-numberformatexception-for-input-string/293730/1 "2022-01-07T11:19:14Z")

</div>

Hello @all,

I am new here and hope this is the right place to discuss the issue.  
Sorry if I am violating any community rule.

I have Elasticsearch with [open-edx](https://open.edx.org).

Currently, I am facing an issue with Elasticsearch.  
when the user search keywords, Elasticsearch fails to respond.  
I don't know the exact issue and don't have much familiarity with Elasticsearch.

I found below the errors in logs.

`RequestError: TransportError(400, u'SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[tGEFzXjCQYS2UeWFe9QnuA][courseware_index][0]: SearchParseException[[courseware_index][0]:`

and

`nested: NumberFormatException[For input string:`

Query:

```auto
{
   "sort":{
      "is_new":{
         "order":"desc",
         "ignore_unmapped":true
      }
   },
   "query":{
      "filtered":{
         "filter":{
            "bool":{
               "must":[
                  {
                     "or":[
                        {
                           "range":{
                              "enrollment_end":{
                                 "gte":"2022-01-07T10:43:05.999119"
                              }
                           }
                        },
                        {
                           "missing":{
                              "field":"enrollment_end"
                           }
                        }
                     ]
                  },
                  {
                     "not":{
                        "filter":{
                           "or":[
                              {
                                 "term":{
                                    "all":"Invitation"
                                 }
                              },
                              {
                                 "term":{
                                    "all":"Invitation_subtopic"
                                 }
                              }
                           ]
                        }
                     }
                  }
               ]
            }
         },
         "query":{
            "bool":{
               "must":[
                  {
                     "query_string":{
                        "fields":[
                           "content.*"
                        ],
                        "query":"elgal"
                     }
                  }
               ]
            }
         }
      }
   },
   "facets":{
      "all":{
         "terms":{
            "field":"all"
         }
      },
      "language":{
         "terms":{
            "field":"language",
            "size":100
         }
      },
      "level":{
         "terms":{
            "field":"level"
         }
      },
      "is_new":{
         "terms":{
            "field":"is_new"
         }
      },
      "course_status":{
         "terms":{
            "field":"course_status"
         }
      },
      "topic":{
         "terms":{
            "field":"topic",
            "size":1000
         }
      },
      "subject":{
         "terms":{
            "field":"subject",
            "size":1000
         }
      }
   }
}

```

I really appreciate it if anyone helps me.  
Thank you.

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [January 7, 2022, 4:53pm UTC](https://discuss.elastic.co/t/elasticsearch-issue-nested-numberformatexception-for-input-string/293730/2 "2022-01-07T16:53:48Z")

</div>

Hi,

though I'm not sure about the error message, the boolean query looks strange. There are no 'or' clause or 'not' clause in Elasticsearch boolean query. Such condition must be expressed with 'must\_not', 'should' or other hierarchical child boolean query. Please read this explanation again, carefully.

> **[Boolean query | Elasticsearch Guide \[7.16\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.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:** [February 4, 2022, 4:54pm UTC](https://discuss.elastic.co/t/elasticsearch-issue-nested-numberformatexception-for-input-string/293730/3 "2022-02-04T16:54:31Z")

</div>

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