I Anton.

I think you’re right.  PointVectorStrategy has been overlooked.  The
work-around is pretty simple though.  In addition to calling
createIndexableFields, also create two DoubleDocValuesField instances, one
for each dimension that uses the identical names the strategy generates.
Lucene will merge the doc-values from these fields by the same name with
the inverted index purpose of the fields returned by createIndexableFields,
even though they have the same name.

I filed an issue: https://issues.apache.org/jira/browse/LUCENE-6376  I
think the solution should use the same API approach as BBoxStrategy, which
allows you to customize the indexing options via a setFieldType method — to
turn on/off DocValues or the inverted index (IndexOptions).

~ David Smiley
Freelance Apache Lucene/Solr Search Consultant/Developer
http://www.linkedin.com/in/davidwsmiley

On Mon, Mar 30, 2015 at 7:49 AM, Anton Lyska <profondome...@gmail.com>
wrote:

> Hi
>
> I have tried to upgrade lucene from 4.x to 5.0 recently.I found out from
> documentation that FieldCache is removed from lucene 5, and I should use
> DocValues fields for sorting.
> I upgraded my sources, and everything works fine except spatial sorting by
> distance.
> When I looked into PointVectorStrategy I saw that createIndexableFields()
> creates DoubleFields, but class that used during sorting
> (DistanceValueSource) works with NumericDocValues. At runtime I got the
> exception, and advice to use UninveringReader.
>
> I'm a little confused with that.
> So, in my opinion, there is spatial sorting, which is broken by default. Am
> I right or missing something?
>
> Option to use UninveringReader doesnt works for me because according to
> https://issues.apache.org/jira/browse/LUCENE-6370 there is no easy way to
> use UninveringReader with NRT index, which I use.
>

Reply via email to