lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2380) Add FieldCache.getTermBytes, to load term data as byte[]
Date Wed, 07 Apr 2010 16:51:33 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-2380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854594#action_12854594
] 

Uwe Schindler commented on LUCENE-2380:
---------------------------------------

The structure should look like String and StringIndex, but I am not sure, if we need real
BytesRefs. In my opinion, it should be an array of byte[], where each byte[] is allocated
with the termsize from the enums BytesRef and copied over - this is. This is no problem, as
the terms need to be replicated either way, as the BytesRef from the enum is reused. The only
problem is that byte[] is mising the cool bytesref methods like utf8ToString() that may be
needed by consumers.

getStrings and getStringIndex should be deprecated. We cannot emulate them using BytesRef.utf8ToString,
as the String[] arrays are raw and allow no wrapping. If FieldCache would use accessor methods
and not raw arrays, we would not have that problem...

> Add FieldCache.getTermBytes, to load term data as byte[]
> --------------------------------------------------------
>
>                 Key: LUCENE-2380
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2380
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>             Fix For: 3.1
>
>
> With flex, a term is now an opaque byte[] (typically, utf8 encoded unicode string, but
not necessarily), so we need to push this up the search stack.
> FieldCache now has getStrings and getStringIndex; we need corresponding methods to load
terms as native byte[], since in general they may not be representable as String.  This should
be quite a bit more RAM efficient too, for US ascii content since each character would then
use 1 byte not 2.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message