user1757703
user1757703

Reputation: 3015

ElasticSearch: Search across multiple fields with input strings (NumberFormatException)

I am searching across multiple fields in a query using the * asterisk notation (Ex: I want all fields startings with source so I specify fields source.*) and I specify a query of foobar as string. I am using a Query String type query.

I keep getting a NumberFormatException and I have some fields in there with a mapping type of long and double.

Any idea how to go about this? I need to do a multi-field search.

My query is posted below:

{
    "query": {
        "bool": {
            "must": [{
                "query_string": {
                    "default_field": "source.*",
                    "query": "foobar"
                }
            }],
            "must_not": [],
            "should": []
        }
    },
    "from": 0,
    "size": 100000,
    "sort": [],
    "facets": {}
}

Upvotes: 4

Views: 650

Answers (1)

keety
keety

Reputation: 17461

set lenient to true to ignore format based failures

example :

"query_string": 
 {
      "default_field": "source.*",
      "query": "foobar",
      "lenient": true

 }

Upvotes: 7

Related Questions