lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Goetzke" <uwe.goet...@veenion.de>
Subject Problem with sorting on NumericFields
Date Mon, 25 Oct 2010 19:42:46 GMT
I got stuck on a problem using  NumericFields using with lucene 2.9.3

 

I add values  to the document by

doc.add(new NumericField("minprice").setDoubleValue(net_price));

 

If I want to search with a sorter for this field, I get this error:

 

java.lang.NumberFormatException: Invalid shift value in prefixCoded
string (is encoded value really an INT?)

                at
org.apache.lucene.util.NumericUtils.prefixCodedToInt(NumericUtils.java:2
33)

                at
org.apache.lucene.search.FieldCache$8.parseFloat(FieldCache.java:256)

                at
org.apache.lucene.search.FieldCacheImpl$FloatCache.createValue(FieldCach
eImpl.java:514)

                at
org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:22
4)

                at
org.apache.lucene.search.FieldCacheImpl.getFloats(FieldCacheImpl.java:48
7)

                at
org.apache.lucene.search.FieldCacheImpl$FloatCache.createValue(FieldCach
eImpl.java:504)

                at
org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:22
4)

                at
org.apache.lucene.search.FieldCacheImpl.getFloats(FieldCacheImpl.java:48
7)

                at
org.apache.lucene.search.FieldComparator$FloatComparator.setNextReader(F
ieldComparator.java:269)

                at
org.apache.lucene.search.TopFieldCollector$MultiComparatorNonScoringColl
ector.setNextReader(TopFieldCollector.java:435)

                at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:257)

                at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:240)

                at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:181)

                at
org.apache.lucene.search.Searcher.search(Searcher.java:90)

 

The Sort field as seen by the debugger:

*	sort_fields = {org.apache.lucene.search.SortField[1]@9010} 
*	[0] = {org.apache.lucene.search.SortField@9011}"!" 
*	field = {java.lang.String@8642}"minprice" 
*	type = 5 
*	locale = null 
*	reverse = true 
*	factory = null 
*	parser = null 
*	comparatorSource = null 
*	useLegacy = false 

I run out of ideas what might go wrong. I did look at the index with
luke and I do not see anything special. 

As this happens with the same code on other servers, too, It looks like
some kind of programming error.

Any hints? 

Thx

 

Uwe 

 


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