lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dragan Jotanovic <dragan.jotano...@diosphere.com>
Subject How to achive this kind of document ordering
Date Tue, 18 May 2010 16:01:34 GMT
|Hi, I need to sort results by two fields. First one is numeric and sorting should be in ascending
order.
Second one should be ordered in a "levels" structure.
Here is the example:

Unsorted:
DocId      SortFieldA          SortFieldB
   1        101A
   2        102        B
   3        102        A   |
|   4        101        C
||   5        102        B|
|   6        101        A   |
|   7        101        B|
|   8        101        C|
|   9        101        B|
|  10        101        A|



Sorted:
|DocId      SortFieldA          SortFieldB
   1        101A   |
|   7        101        B|
|   4        101        C|
|   6        101        A|
|   9        101        B|
|   8        101        C|
|  10        101        A|
|   ||3        102        A|||||
|   2        102        B||
||   5        102        B||||

First, all results are ordered by SortFieldA in ascending order. Than by SortFieldB so that
all documents with the same SortFieldA value are ordered in "levels" structure. Each level
consists of documents with distinct SortFieldB values.
So, the requirenment is to show documents from first level first, than second level, and so
on.
It will not be possible to order documents while indexing, so I will need search time ordering.
Is this achievable with lucene? What would be the best approach to solve this without huge
performance impact on multimillion documents index?
|


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message