Hi,

wrong mailinglist. This is the mailinglist for the documentation tool
Sphinx. http://sphinx-doc.org/

On Sat Jan 17 2015 at 6:24:57 Grzegorz Kołakowski <[email protected]>
wrote:

> Hi,
>
> I've noticed that the result of the sort expression for sphinx matches is
> a *float* value. I'm really disappointed, because *float* cannot
> "represent" as much data as I would like to.
>
> I need to do something similar to SPH_SORT_EXTENDED mode, however one
> column values are slightly influenced by another column. I want to achieve
> something like that:
>
>     2^33 * *@weight* + 2^32 * *attr_a* + *attr_b* - (*attr_c* * 10000)
>                           (boolean)  (int)   (tiny int)
>
> where attr_a is boolean, attr_b is int and attr_c is a tiny number.
>
> This is quite similar to:
>
>     *@weight* DESC *attr_a* DESC *attr_b* DESC
>
> I tried to do something like this:
>
>     2^17 * *floor*(8 * *sqrt*(*@weight*)) + 2^16 * *attr_a* + *sqrt*(
> *attr_b* - (*attr_c* * 10000))
>
> However, this approach was still not sensitive enough to properly sort by
> either @weight or by attr_b - (attr_c * 10000), because the differences
> between weights or between values of attr_b - (attr_c * 10000),
> therefore, the @expr for many matches was rounded to the same float (the
> gaps between consecutive values that can be represented by float are too
> large. In consequence, lots of results have the same @expr value).
>
> Do anyone know some workarounds, solutions, etc.?
>
> Thanks in advance! I really appreciate all suggestions.
> Cheers!
>
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to