Testing for NaN with MVEL with custom script?

When one search term started bombing, I discovered that one of my documents
somehow must be returning an NaN for one of the custom score scripts
fields. I was using the ternary operator already for emptiness:

"script": "_score +
(doc['custom_booster'].empty?0.0:doc['custom_booster].value)"

However, empty does not cover the case of NaN.

I've tried using variations on the MVEL "is" and "instanceOf" decimal but I
don't know if or how those are supported as every variation throws an
error.

I did notice this issue:

Thanks!

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey

have you tried
doc['custom_booster'].value instanceof Number

You may want to think about index time boosting (although not that
flexible) if you are using this script all the time.

--Alex

On Tue, May 14, 2013 at 3:00 PM, Justin Treher jtreher@gmail.com wrote:

When one search term started bombing, I discovered that one of my
documents somehow must be returning an NaN for one of the custom score
scripts fields. I was using the ternary operator already for emptiness:

"script": "_score +
(doc['custom_booster'].empty?0.0:doc['custom_booster].value)"

However, empty does not cover the case of NaN.

I've tried using variations on the MVEL "is" and "instanceOf" decimal but
I don't know if or how those are supported as every variation throws an
error.

I did notice this issue:
https://github.com/elasticsearch/elasticsearch/issues/2426

Thanks!

--
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.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Justin

What type is your 'custom_booster' mapped as? If it is a number, I'd be
interested to see what value is producing a NaN. Any chance you can
reproduce?

clint

On Tue, May 14, 2013 at 3:40 PM, Alexander Reelsen alr@spinscale.de wrote:

Hey

have you tried
doc['custom_booster'].value instanceof Number

You may want to think about index time boosting (although not that
flexible) if you are using this script all the time.

--Alex

On Tue, May 14, 2013 at 3:00 PM, Justin Treher jtreher@gmail.com wrote:

When one search term started bombing, I discovered that one of my
documents somehow must be returning an NaN for one of the custom score
scripts fields. I was using the ternary operator already for emptiness:

"script": "_score +
(doc['custom_booster'].empty?0.0:doc['custom_booster].value)"

However, empty does not cover the case of NaN.

I've tried using variations on the MVEL "is" and "instanceOf" decimal but
I don't know if or how those are supported as every variation throws an
error.

I did notice this issue:
https://github.com/elasticsearch/elasticsearch/issues/2426

Thanks!

--
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.
For more options, visit 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.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.