lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <...@thorntothehorn.org>
Subject NullPointerException in FieldSortedHitQueue
Date Mon, 18 Apr 2011 11:05:00 GMT
Sent originally to the user list, but no response.  Any comments here?

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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message