# Weight in Completion Suggester Is Being Rounded Down

**URL:** <https://discuss.elastic.co/t/weight-in-completion-suggester-is-being-rounded-down/14048>\
**Category:** Elasticsearch\
**Created:** [October 21, 2013, 11:14pm UTC](https://discuss.elastic.co/t/weight-in-completion-suggester-is-being-rounded-down/14048 "2013-10-21T23:14:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johny\_Lam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johny_lam/32/1487_2.png) [@Johny\_Lam](https://discuss.elastic.co/u/Johny_Lam)\
**Post date:** [October 21, 2013, 11:14pm UTC](https://discuss.elastic.co/t/weight-in-completion-suggester-is-being-rounded-down/14048/1 "2013-10-21T23:14:58Z")

</div>

I'm using the completion suggester with weights. It appears that the  
weights for each suggestion is being rounded down. For example, if I have  
suggestions "a" with weight 3.54 and "b" with weight 3.25, the weights for  
both are rounded down to 3.0 when used for sorting and when they're  
returned in the response.

Is this supposed to be the case and is there a way to use the weights with  
double or float precision?

--  
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 22, 2013, 7:46am UTC](https://discuss.elastic.co/t/weight-in-completion-suggester-is-being-rounded-down/14048/2 "2013-10-22T07:46:12Z")

</div>

Hey,

the weight is supposed to be an integer. See

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

I think it makes sense to actually throw an error if a non integer is being  
indexed as weight in order to prevent confusion. Simplest solution for that  
might be to multiply by 100 (or whatever factor needed) in your case on the  
client side.

--Alex

On Tue, Oct 22, 2013 at 1:14 AM, Johny Lam [johny.lam@gmail.com](mailto:johny.lam@gmail.com) wrote:

> I'm using the completion suggester with weights. It appears that the  
> weights for each suggestion is being rounded down. For example, if I have  
> suggestions "a" with weight 3.54 and "b" with weight 3.25, the weights for  
> both are rounded down to 3.0 when used for sorting and when they're  
> returned in the response.
> 
> Is this supposed to be the case and is there a way to use the weights with  
> double or float precision?
> 
> --  
> 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:** ![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:11am UTC](https://discuss.elastic.co/t/weight-in-completion-suggester-is-being-rounded-down/14048/3 "2017-07-06T02:11:13Z")

</div>


