lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karl wettin <karl.wet...@gmail.com>
Subject Re: Sorting
Date Sat, 29 Jul 2006 10:42:50 GMT
On Sat, 2006-07-29 at 01:43 -0700, neils wrote:
> is there another "fast" way to sort by alphabetic order ?
>
> The indexsize is currently about 2 GB and index is split in two parts
> and are accessed by a parallelreader.

I don't know how much faster it is, but you could try to store the sort
order as a float value in a secondary field and sort by that value.

Find or calculate the value by using TermEnum and TermDocs at insert
time. This requires that the string field you are sorting by is one term
only. If there are more than one term you (might) have to figure this
out in your primary data storage.

(I've used this strategy in ORM CRUDs to minimize writing to data
storage when setting the order of an instance in an ordered list.)

This is what insert iterations would look like:

new insert: aaaa

[aaaa : 1.0]

new insert: aaab

[aaaa : 1.0]
[aaab : 2.0]

new insert: aaac

[aaaa : 1.0]
[aaab : 2.0]
[aaac : 3.0]

new insert: aaaba

[aaaa  : 1.0]
[aaab  : 2.0]
[aaaba : 2.5]
[aaac  : 3.0]

new insert: aaabb

[aaaa  : 1.0]
[aaab  : 2.0]
[aaaba : 2.5]
[aaabb : 2.75]
[aaac  : 3.0]

new insert: aaabc

[aaaa  : 1.0]
[aaab  : 2.0]
[aaaba : 2.5]
[aaabb : 2.75]
[aaabc : 2.875]
[aaac  : 3.0]

and so on.


> Currently I'm using lucene 1.9.1 (dotnet).

This is the Lucene java-user list. You might want to try the dotnet.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message