Elasticsearch issue: nested: NumberFormatException[For input string:

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.

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:

{
   "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.

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.

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