lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] Commented: (LUCENE-2426) change sort order to binary order
Date Sun, 02 May 2010 16:22:55 GMT


Robert Muir commented on LUCENE-2426:

I think most apps will be unaffected by this change (if the prefix-flex index convertor can
sort the terms in binary, too).

But we need to lookout for some traps:
* Things that use String.compareTo are dangerous, as it uses code unit order (e.g. i see a
binary search w/ this in FieldCache)
* In general assuming a term can be a String at all is problematic with using byte[] terms,
if numeric wants to use full byte, etc. 
So we should think about changing Term, too.

the best way to avoid problems is to stick with byte[] as much as possible and try to avoid
using String for terms... 

> change sort order to binary order
> ---------------------------------
>                 Key: LUCENE-2426
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 4.0.0
>            Reporter: Robert Muir
>             Fix For: 4.0.0
> Since flexible indexing, terms are now represented as byte[], but for backwards compatibility
reasons, they are not sorted as byte[], but instead as if they were char[].
> I think its time to look at sorting terms as byte[]... this would yield the following
> * terms are more opaque by default, they are byte[] and sort as byte[]. I think this
would make lucene friendlier to customizations.
> * numerics and collation are then free to use their own encoding (full byte) rather than
avoiding the use of certain bits to remain compatible with char[] sort order.
> * automaton gets simpler because as in LUCENE-2265, it uses byte[] too, and has special
hacks because terms are sorted as char[]

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message