Hi, On Tue, Jul 30, 2013 at 8:19 PM, Nicolas Guyot <sfni...@gmail.com> wrote: > When sorting numerically, the search seems to take a bit of a while > compared to the lexically sorted search. > Also when sorting numerically the result is sorted within each page but no > globally as opposed to the lexical sorted search. > > From my understanding, a SortedDocValuesField is sorted while indexing but > not the NumericDocValuesField which is why we are facing those issues in > our implementation. Is that correct ?
Sorted doc values are not exactly sorted, but Lucene computes all unique values, sorts them and assigns an ordinal to every unique value. These ordinals are then used at searching time to sort documents. When comparing documents on the same segment, Lucene directly uses the ordinals while when there are documents from different documents to compare, Lucene uses the values themselves (slower). I would expect sorting on a NumericDocValuesField to be faster since longs can be used to directly compare documents across all segments. Moreover, it is not normal that data is only sorted per page. Can you write a small piece of code that reproduces the problem? -- Adrien --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org