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 Ludovic Bertin <l....@lombardodier.com> on 2016/10/21 09:54:02 UTC

Migration Lucene 4 -> Lucene 6

Hi,

When I'm trying to launch search with ordering, but it fails with exception : unexpected docvalues type NONE for field 'LOCAL_TIME' (expected=NUMERIC). Re-index with correct docvalues type.

For indexing:


doc.add(new LongPoint("longValue", (Long) value));
doc.add(new StoredField("longValue", (Long) value));


For searching:

Sort sort = new Sort(new SortField("longValue", SortField.Type.LONG, false)

searcher.search(query, max, sort);


ð  unexpected docvalues type NONE for field 'LOCAL_TIME' (expected=NUMERIC). Re-index with correct docvalues type.

Do I have to reindex all my data, or can I change the way to do the search ?
If I have to reindex, what is the correct way to index with sort capabilities ?

Thanks

Ludovic BERTIN


[[ rethink everything. ]]<http://www.lombardodier.com>

DISCLAIMER **********************************************
This message is intended only for use by the person to
whom it is addressed. It may contain information that is
privileged and confidential. Its content does not constitute
a formal commitment by Bank Lombard Odier & Co Ltd
or any of its branches or affiliates. If you are not the
intended recipient of this message, kindly notify the sender
immediately and destroy this message. Thank You.
***************************************************************


Re: Migration Lucene 4 -> Lucene 6

Posted by Alan Woodward <al...@flax.co.uk>.
Hi,

You need to add a NumericDocValuesField here as well - Point is for searching, Stored is for display.

Alan Woodward
www.flax.co.uk


> On 21 Oct 2016, at 10:54, Ludovic Bertin <l....@lombardodier.com> wrote:
> 
> Hi,
> 
> When I'm trying to launch search with ordering, but it fails with exception : unexpected docvalues type NONE for field 'LOCAL_TIME' (expected=NUMERIC). Re-index with correct docvalues type.
> 
> For indexing:
> 
> 
> doc.add(new LongPoint("longValue", (Long) value));
> doc.add(new StoredField("longValue", (Long) value));
> 
> 
> For searching:
> 
> Sort sort = new Sort(new SortField("longValue", SortField.Type.LONG, false)
> 
> searcher.search(query, max, sort);
> 
> 
> ð  unexpected docvalues type NONE for field 'LOCAL_TIME' (expected=NUMERIC). Re-index with correct docvalues type.
> 
> Do I have to reindex all my data, or can I change the way to do the search ?
> If I have to reindex, what is the correct way to index with sort capabilities ?
> 
> Thanks
> 
> Ludovic BERTIN
> 
> 
> [[ rethink everything. ]]<http://www.lombardodier.com>
> 
> DISCLAIMER **********************************************
> This message is intended only for use by the person to
> whom it is addressed. It may contain information that is
> privileged and confidential. Its content does not constitute
> a formal commitment by Bank Lombard Odier & Co Ltd
> or any of its branches or affiliates. If you are not the
> intended recipient of this message, kindly notify the sender
> immediately and destroy this message. Thank You.
> ***************************************************************
>