# Parse Exception in Query Excecution

**URL:** <https://discuss.elastic.co/t/parse-exception-in-query-excecution/13963>\
**Category:** Elasticsearch\
**Created:** [October 16, 2013, 5:51am UTC](https://discuss.elastic.co/t/parse-exception-in-query-excecution/13963 "2013-10-16T05:51:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![samaswin](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@samaswin](https://discuss.elastic.co/u/samaswin)\
**Post date:** [October 16, 2013, 5:51am UTC](https://discuss.elastic.co/t/parse-exception-in-query-excecution/13963/1 "2013-10-16T05:51:32Z")

</div>

Hi,  
If I execute the follow query its shows a exception,  
{  
"from" : 0,  
"size" : 20,  
"query" : {  
"multi\_match" : {  
"fields" : ["Description", "jobStatus","rxCustomerID"],  
"query" : "no"  
}  
},  
"sort" : [ {  
"\_uid" : {  
"order" : "desc"  
}  
} ],  
"highlight" : {  
"pre\_tags" : ["**"],  
"post\_tags" : ["**"],  
"fields" : {  
"\*" : { }  
}  
}  
}

Note: The field rxCustomerID is long

Exception: NumberFormatException[For input string: "no"]; }]

Can anyone explain how to resolve that?

I need the query for multi\_match only

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 16, 2013, 7:59am UTC](https://discuss.elastic.co/t/parse-exception-in-query-excecution/13963/2 "2013-10-16T07:59:24Z")

</div>

Hey,

I assume your mention of the field rxCustomerId is long was referring to  
the datatype and not to the length of the field.

What the exception tries to express, is the problem that you cannot execute  
a text search on a number field. What happens internally is, that the input  
string is tried to be converted to a number (in order to execute the search  
on a number based field), which fails and therefore the whole search  
request fails. So omitting the field would be the simplest option, but most  
likely not what you want.

Can you maybe explain, why you want to search in the number field as well?  
Because the input could possibly be a number? A little more information  
about what you want to do might result in someone having a workaround for  
your problem.

--Alex

On Wed, Oct 16, 2013 at 7:51 AM, sam aswin [samaswin@gmail.com](mailto:samaswin@gmail.com) wrote:

> Hi,  
> If I execute the follow query its shows a exception,  
> {  
> "from" : 0,  
> "size" : 20,  
> "query" : {  
> "multi\_match" : {  
> "fields" : ["Description", "jobStatus","rxCustomerID"],  
> "query" : "no"  
> }  
> },  
> "sort" : [ {  
> "\_uid" : {  
> "order" : "desc"  
> }  
> } ],  
> "highlight" : {  
> "pre\_tags" : ["**"],  
> "post\_tags" : ["**"],  
> "fields" : {  
> "\*" : { }  
> }  
> }  
> }
> 
> Note: The field rxCustomerID is long
> 
> Exception: NumberFormatException[For input string: "no"]; }]
> 
> Can anyone explain how to resolve that?
> 
> I need the query for multi\_match only
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![samaswin](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@samaswin](https://discuss.elastic.co/u/samaswin)\
**Post date:** [October 16, 2013, 9:12am UTC](https://discuss.elastic.co/t/parse-exception-in-query-excecution/13963/3 "2013-10-16T09:12:18Z")

</div>

I need it for my application. Currently I converted all fields as a String.  
So i didn't get the problem now.  
Thanks Alexander

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 16, 2013, 10:23am UTC](https://discuss.elastic.co/t/parse-exception-in-query-excecution/13963/4 "2013-10-16T10:23:30Z")

</div>

Hey,

alternatively you could use the lenient option, see  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#_other_options)(all  
the options from match query also apply to multi match)

--Alex

On Wed, Oct 16, 2013 at 11:12 AM, sam aswin [samaswin@gmail.com](mailto:samaswin@gmail.com) wrote:

> I need it for my application. Currently I converted all fields as a  
> String. So i didn't get the problem now.  
> Thanks Alexander
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![samaswin](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@samaswin](https://discuss.elastic.co/u/samaswin)\
**Post date:** [October 16, 2013, 10:54am UTC](https://discuss.elastic.co/t/parse-exception-in-query-excecution/13963/5 "2013-10-16T10:54:26Z")

</div>

Thanks Alex,  
It works fine.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:12am UTC](https://discuss.elastic.co/t/parse-exception-in-query-excecution/13963/6 "2017-07-06T02:12:10Z")

</div>


