# Field value factor ignoring fields with a value less than one

**URL:** <https://discuss.elastic.co/t/field-value-factor-ignoring-fields-with-a-value-less-than-one/30034>\
**Category:** Elasticsearch\
**Created:** [September 25, 2015, 4:18pm UTC](https://discuss.elastic.co/t/field-value-factor-ignoring-fields-with-a-value-less-than-one/30034 "2015-09-25T16:18:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickff](https://avatars.discourse-cdn.com/v4/letter/p/7993a0/32.png) [@patrickff](https://discuss.elastic.co/u/patrickff)\
**Post date:** [September 25, 2015, 4:18pm UTC](https://discuss.elastic.co/t/field-value-factor-ignoring-fields-with-a-value-less-than-one/30034/1 "2015-09-25T16:18:40Z")

</div>

I'm having difficulty getting function scoring to work when the value is between zero and one (fractional). I want to use a reciprocal/inverse scoring function on these documents where 0.1 would be high and 10+ would be low. However, the function score query appears to ignore any document with a value less than 1.

See here example queries and document:

> <https://gist.github.com/anonymous/e74d11f8bc1e1309afa3>

Any ideas what causes this or if there is a parameter I'm missing to get the function score to consider these documents?

Thank you.

---

<div class="post-metadata">

**Author:** ![patrickff](https://avatars.discourse-cdn.com/v4/letter/p/7993a0/32.png) [@patrickff](https://discuss.elastic.co/u/patrickff)\
**Post date:** [October 1, 2015, 2:42pm UTC](https://discuss.elastic.co/t/field-value-factor-ignoring-fields-with-a-value-less-than-one/30034/2 "2015-10-01T14:42:50Z")

</div>

Bumping to see if anyone has an idea. Seems like a bug.

---

<div class="post-metadata">

**Author:** ![patrickff](https://avatars.discourse-cdn.com/v4/letter/p/7993a0/32.png) [@patrickff](https://discuss.elastic.co/u/patrickff)\
**Post date:** [October 5, 2015, 9:27pm UTC](https://discuss.elastic.co/t/field-value-factor-ignoring-fields-with-a-value-less-than-one/30034/3 "2015-10-05T21:27:17Z")

</div>

It turned out we were mistakenly indexing that property as a short when we created the index. The values still displayed correctly under normal circumstances but when the index on that field was used in a query, the values were being cast to short which rounds them down to zero and caused the symptoms.

---

<div class="post-metadata">

**Author:** ![softwaredoug](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/softwaredoug/32/22681_2.png) [@softwaredoug](https://discuss.elastic.co/u/softwaredoug)\
**Post date:** [October 6, 2015, 6:44pm UTC](https://discuss.elastic.co/t/field-value-factor-ignoring-fields-with-a-value-less-than-one/30034/4 "2015-10-06T18:44:31Z")

</div>

Thanks for replying, I stared sideways at what you were doing quite a bit and couldn't figure out what could possibly be wrong 😄

---

<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 5, 2017, 11:46pm UTC](https://discuss.elastic.co/t/field-value-factor-ignoring-fields-with-a-value-less-than-one/30034/5 "2017-07-05T23:46:27Z")

</div>


