Ah, I see. The indention and lack of braces fooled me. You might consider making things as easy as possible when asking people to volunteer their time trying to help you.
Then I'm unsure what's the problem, you could try showing us the entire stack trace. Have you defined your own compare function? If so, do you test in that function to see whether the values you're comparing are actually set in your objects? The fragment you've posted doesn't really give us enough to help very much. Best Erick On Mon, Feb 2, 2009 at 4:18 AM, ninaS <nina...@gmx.de> wrote: > > That's not true: have a look at the "else"-block. > > The problem is that lucene's FieldDocSortedHitQueue does only test for null > values if uses the type FieldDoc.STRING. With FieldDoc.CUSTOM lucene > assumes > ci to be never null: > > FieldDocSortedHitQueue 163-166: > > case SortField.CUSTOM:{ > c = docA.fields[i].compareTo > (docB.fields[i]); > break; > } > > If I have null values in the field that I want to sort by: I can not use a > custom SortComparator. > -- > View this message in context: > http://www.nabble.com/NullPointerException-in-FieldDocSortedHitQueue.lessThan-with-custom-SortComparator-tp21702845p21786431.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >