lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomás Fernández Löbbe <tomasflo...@gmail.com>
Subject Re: NumericDocValues only supports long?
Date Tue, 14 Feb 2017 19:43:21 GMT
I think you should use FloatFieldSource. Solr uses
Float.floatToIntBits(floatValue) when adding the DV field, so you could use
Float.intBitsToFloat((int)longValue) when reading (See
TrieField.createFields(...)), but FloatFieldSource is already doing that
for you.

On Tue, Feb 14, 2017 at 10:37 AM, Ugo Matrangolo <ugo.matrangolo@gmail.com>
wrote:

> Hi,
>
> I have a corpus where each document contains a field of type Float.
>
> I'm trying to write a PostFilter that returns a DelegatingCollector to
> filter all the docs where the value of a function applied to this float
> value is lower than a given threshold. I can't precompute/index anything
> here.
>
> I have just found that calling IndexReader to read a single document and
> then read the stored field of type float that I need is quite expensive so
> I was thinking to load all of them at once using:
>
>  LeafReader.numericDocValues($my_float_field_name_here)
>
> Turns out that NumericDocValues only supports long!
>
> How can I access all my float values in the same way ???
>
> Best
> Ugo
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message