Index: src/java/org/apache/lucene/search/FieldSortedHitQueue.java =================================================================== --- src/java/org/apache/lucene/search/FieldSortedHitQueue.java (revision 429966) +++ src/java/org/apache/lucene/search/FieldSortedHitQueue.java (working copy) @@ -316,9 +316,19 @@ final String[] index = FieldCache.DEFAULT.getStrings (reader, field); return new ScoreDocComparator() { - public final int compare (final ScoreDoc i, final ScoreDoc j) { - return collator.compare (index[i.doc], index[j.doc]); - } + public final int compare(final ScoreDoc i, final ScoreDoc j) { + String is = index[i.doc]; + String js = index[j.doc]; + if (is == js) { + return 0; + } else if (is == null) { + return -1; + } else if (js == null) { + return 1; + } else { + return collator.compare(is, js); + } + } public Comparable sortValue (final ScoreDoc i) { return index[i.doc]; Index: src/test/org/apache/lucene/search/TestSort.java =================================================================== --- src/test/org/apache/lucene/search/TestSort.java (revision 429966) +++ src/test/org/apache/lucene/search/TestSort.java (working copy) @@ -261,6 +261,12 @@ sort.setSort ("string", true); assertMatches (full, queryF, sort, "IJZ"); + + sort.setSort (new SortField ("i18n", Locale.ENGLISH)); + assertMatches (full, queryF, sort, "ZJI"); + + sort.setSort (new SortField ("i18n", Locale.ENGLISH, true)); + assertMatches (full, queryF, sort, "IJZ"); sort.setSort ("int"); assertMatches (full, queryF, sort, "IZJ");