lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <...@thorntothehorn.org>
Subject NullPointerException in FieldSortedHitQueue
Date Thu, 14 Apr 2011 11:36:17 GMT
Upgrading from 2.3.2 to 2.9.4 I get NPE as below

Caused by: java.lang.NullPointerException
	at 
org.apache.lucene.search.FieldSortedHitQueue$1.createValue(FieldSortedHitQueue.java:224)
	at org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:224)
	at 
org.apache.lucene.search.FieldSortedHitQueue.getCachedComparator(FieldSortedHitQueue.java:176)
	at org.apache.lucene.search.FieldSortedHitQueue.<init>(FieldSortedHitQueue.java:56)

I have a SortField that is created something like

new SortField(fieldName, comparator)

which generates a custom SortField, but in the call to Comparators.get() fails 
because createValue in FieldSortedHitQueue calls

         case SortField.CUSTOM:
           comparator = factory.newComparator (reader, fieldname);

and factory is null.

Is this a bug?  I know FSHQ is deprecated, but presumably it should still work 
with a SortField containing a comparator?

Thanks
Antony

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message