You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jeremy Friesen <re...@gmail.com> on 2016/05/26 21:53:56 UTC
Sorting IndexSearcher results by LongPoint with 6.0
I'm attempting to upgrade my project to Lucene 6.0, and have run into an
issue with sorting my results. My documents have a timestamp field that was
previously a StoredField with NumericType: Long. I've converted it to a
LongPoint, which seems to work fine for range queries.
My problem is that trying to sort search results with a SortField of type
Long now doesn't seem to work with a LongPoint field. I get an
IllegalStateException "unexpected docvalues type NONE for field 'timestamp'
(expected=NUMERIC). Use UninvertingReader or index with docvalues."
I'm guessing the sorter hasn't been updated to work with PointValues yet,
but I just wanted to check with the mailing list to see if anyone else has
found a way to do results sorting under 6.0.
Re: Sorting IndexSearcher results by LongPoint with 6.0
Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi Jeremy,
Yes. That's right. The question is if you really need the stored field, but that's out of scope for this issue.
Uwe
Am 27. Mai 2016 01:21:48 MESZ, schrieb Jeremy Friesen <re...@gmail.com>:
>Thanks for the help. So just to sum up, if I have a numeric field type
>that
>I want to be able to do a range query on, sort by, and also retrieve in
>the
>document as a stored value, I will need to add it to the document three
>times, as a NumericDocValuesField, as a LongPoint, and as a
>StoredField.
>Does that sound correct?
>
>On Thu, May 26, 2016 at 3:43 PM, Uwe Schindler <uw...@thetaphi.de> wrote:
>
>> Hi,
>>
>> Sorting does not work on indexed fields anymore (since Lucene 5),
>unless
>> you use UninvertingReader. Point values don't work with that because
>they
>> cannot be uninverted.
>>
>> For sorting it's the same rule for all field types: enable DocValues!
>You
>> just have to add another field instance with same name using doc
>values
>> (some numeric type).
>>
>> Uwe
>>
>> Am 26. Mai 2016 23:53:56 MESZ, schrieb Jeremy Friesen
><re...@gmail.com>:
>> >I'm attempting to upgrade my project to Lucene 6.0, and have run
>into
>> >an
>> >issue with sorting my results. My documents have a timestamp field
>that
>> >was
>> >previously a StoredField with NumericType: Long. I've converted it
>to a
>> >LongPoint, which seems to work fine for range queries.
>> >
>> >My problem is that trying to sort search results with a SortField of
>> >type
>> >Long now doesn't seem to work with a LongPoint field. I get an
>> >IllegalStateException "unexpected docvalues type NONE for field
>> >'timestamp'
>> >(expected=NUMERIC). Use UninvertingReader or index with docvalues."
>> >
>> >I'm guessing the sorter hasn't been updated to work with PointValues
>> >yet,
>> >but I just wanted to check with the mailing list to see if anyone
>else
>> >has
>> >found a way to do results sorting under 6.0.
>>
>> --
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, 28213 Bremen
>> http://www.thetaphi.de
>>
--
Uwe Schindler
H.-H.-Meier-Allee 63, 28213 Bremen
http://www.thetaphi.de
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Sorting IndexSearcher results by LongPoint with 6.0
Posted by Jeremy Friesen <re...@gmail.com>.
Thanks for the help. So just to sum up, if I have a numeric field type that
I want to be able to do a range query on, sort by, and also retrieve in the
document as a stored value, I will need to add it to the document three
times, as a NumericDocValuesField, as a LongPoint, and as a StoredField.
Does that sound correct?
On Thu, May 26, 2016 at 3:43 PM, Uwe Schindler <uw...@thetaphi.de> wrote:
> Hi,
>
> Sorting does not work on indexed fields anymore (since Lucene 5), unless
> you use UninvertingReader. Point values don't work with that because they
> cannot be uninverted.
>
> For sorting it's the same rule for all field types: enable DocValues! You
> just have to add another field instance with same name using doc values
> (some numeric type).
>
> Uwe
>
> Am 26. Mai 2016 23:53:56 MESZ, schrieb Jeremy Friesen <re...@gmail.com>:
> >I'm attempting to upgrade my project to Lucene 6.0, and have run into
> >an
> >issue with sorting my results. My documents have a timestamp field that
> >was
> >previously a StoredField with NumericType: Long. I've converted it to a
> >LongPoint, which seems to work fine for range queries.
> >
> >My problem is that trying to sort search results with a SortField of
> >type
> >Long now doesn't seem to work with a LongPoint field. I get an
> >IllegalStateException "unexpected docvalues type NONE for field
> >'timestamp'
> >(expected=NUMERIC). Use UninvertingReader or index with docvalues."
> >
> >I'm guessing the sorter hasn't been updated to work with PointValues
> >yet,
> >but I just wanted to check with the mailing list to see if anyone else
> >has
> >found a way to do results sorting under 6.0.
>
> --
> Uwe Schindler
> H.-H.-Meier-Allee 63, 28213 Bremen
> http://www.thetaphi.de
>
Re: Sorting IndexSearcher results by LongPoint with 6.0
Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,
Sorting does not work on indexed fields anymore (since Lucene 5), unless you use UninvertingReader. Point values don't work with that because they cannot be uninverted.
For sorting it's the same rule for all field types: enable DocValues! You just have to add another field instance with same name using doc values (some numeric type).
Uwe
Am 26. Mai 2016 23:53:56 MESZ, schrieb Jeremy Friesen <re...@gmail.com>:
>I'm attempting to upgrade my project to Lucene 6.0, and have run into
>an
>issue with sorting my results. My documents have a timestamp field that
>was
>previously a StoredField with NumericType: Long. I've converted it to a
>LongPoint, which seems to work fine for range queries.
>
>My problem is that trying to sort search results with a SortField of
>type
>Long now doesn't seem to work with a LongPoint field. I get an
>IllegalStateException "unexpected docvalues type NONE for field
>'timestamp'
>(expected=NUMERIC). Use UninvertingReader or index with docvalues."
>
>I'm guessing the sorter hasn't been updated to work with PointValues
>yet,
>but I just wanted to check with the mailing list to see if anyone else
>has
>found a way to do results sorting under 6.0.
--
Uwe Schindler
H.-H.-Meier-Allee 63, 28213 Bremen
http://www.thetaphi.de
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org