lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless" <>
Subject Re: [jira] Resolved: (LUCENE-510) IndexOutput.writeString() should write length in bytes
Date Wed, 26 Mar 2008 22:06:54 GMT
Yonik Seeley <> wrote:

>  Hmmm, can't we always do it by unicode code point?
>  When do we need UTF-16 order?

In theory, we can.  I think the sort order doesn't matter much, as
long as everyone (writers & readers) agree what it is.  I think
unicode code point order is more "standards compliant" too.

A big benefit is then we could leave things (eg TermBuffer and maybe
eventually Term, FieldCache) as UTF8 bytes and save on the conversion
cost when reading.

But I don't think Java provides a way to do this comparison?  However
it's not hard to implement your own:

But then I worried about how much slower that code is than
String.compareTo, and, I found alot of places where innocent compareTo
or < or > needed to be changed to this method call.  Field name
comparisons would have to be fixed too.  Then for backwards
compatibility all of these places that do comparisons would have to
fallback to the Java way when interacting with an older segment.

I think we can still explore this?  It just seemed way too big to
glomm into the already-big changes in LUCENE-510.


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

View raw message