You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2011/02/28 16:58:37 UTC
[jira] Created: (SOLR-2396) deprecated char[] based collation
factories / replace with byte[]-based
deprecated char[] based collation factories / replace with byte[]-based
-----------------------------------------------------------------------
Key: SOLR-2396
URL: https://issues.apache.org/jira/browse/SOLR-2396
Project: Solr
Issue Type: Improvement
Reporter: Robert Muir
Fix For: 4.0
Attachments: SOLR-2396.patch
In LUCENE-2551 collation support was changed to use byte[] keys.
Previously it encoded sort keys with IndexableBinaryString into char[],
but this is wasteful with regards to RAM and disk when terms can be byte.
A simple solution is to create tokenizer factories which are KeywordTokenizer + [ICU]CollationAttributeFactory.
A better solution would be [ICU]CollationFieldTypes, as this would allow locale-sensitive
range queries, but I found this to be more difficult due to the fact that the indexed values
are byte[] not String...
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (SOLR-2396) add [ICU]CollationField
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011646#comment-13011646 ]
Robert Muir commented on SOLR-2396:
-----------------------------------
I'd like to commit this in a few days if no one objects. The existing encoding is wasteful and I would like to cut solr over to this more efficient one (and enable locale-sensitive range queries).
We could open future issues for any additional features such as specifying the icu locale as BCP47, etc, etc. (this just implements the lucene 3.1 functionality more efficiently)
> add [ICU]CollationField
> -----------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Assignee: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (SOLR-2396) add [ICU]CollationField
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated SOLR-2396:
------------------------------
Description:
In LUCENE-2551 collation support was changed to use byte[] keys.
Previously it encoded sort keys with IndexableBinaryString into char[],
but this is wasteful with regards to RAM and disk when terms can be byte.
A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
was:
In LUCENE-2551 collation support was changed to use byte[] keys.
Previously it encoded sort keys with IndexableBinaryString into char[],
but this is wasteful with regards to RAM and disk when terms can be byte.
A simple solution is to create tokenizer factories which are KeywordTokenizer + [ICU]CollationAttributeFactory.
A better solution would be [ICU]CollationFieldTypes, as this would allow locale-sensitive
range queries, but I found this to be more difficult due to the fact that the indexed values
are byte[] not String...
Summary: add [ICU]CollationField (was: deprecated char[] based collation factories / replace with byte[]-based)
editing summary/description to fit
> add [ICU]CollationField
> -----------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Resolved] (SOLR-2396) add [ICU]CollationField
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir resolved SOLR-2396.
-------------------------------
Resolution: Fixed
Committed revision 1086637.
> add [ICU]CollationField
> -----------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Assignee: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] Updated: (SOLR-2396) deprecated char[] based collation
factories / replace with byte[]-based
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated SOLR-2396:
------------------------------
Attachment: SOLR-2396.patch
updated patch, instead adding CollatedField and ICUCollatedField.
the trick was trying to get this thing to "use" my internal analyzer... setting TOKENIZED and changing SolrQueryParser to check isTokenized() instead of 'instanceof TextField' got things going.
still needs unit tests but locale-sensitive range queries etc are working here.
> deprecated char[] based collation factories / replace with byte[]-based
> -----------------------------------------------------------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A simple solution is to create tokenizer factories which are KeywordTokenizer + [ICU]CollationAttributeFactory.
> A better solution would be [ICU]CollationFieldTypes, as this would allow locale-sensitive
> range queries, but I found this to be more difficult due to the fact that the indexed values
> are byte[] not String...
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (SOLR-2396) add [ICU]CollationField
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009670#comment-13009670 ]
Robert Muir commented on SOLR-2396:
-----------------------------------
Well, its something we could be consider?, but on another issue really as its not solr-related... this one just exposes the lucene functionality from LUCENE-2551 and deprecates the old support.
But really, this is going to be wasteful in most cases versus IDENTICAL strength (which will basically give someone the same functionality from a sort/range-query perspective).
> add [ICU]CollationField
> -----------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] Commented: (SOLR-2396) deprecated char[] based collation
factories / replace with byte[]-based
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000520#comment-13000520 ]
Robert Muir commented on SOLR-2396:
-----------------------------------
FYI depending on how LUCENE-2943 is resolved, I'll adjust the patch for the ICU
case to ensure all the operations are thread-safe... right now its not.
> deprecated char[] based collation factories / replace with byte[]-based
> -----------------------------------------------------------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A simple solution is to create tokenizer factories which are KeywordTokenizer + [ICU]CollationAttributeFactory.
> A better solution would be [ICU]CollationFieldTypes, as this would allow locale-sensitive
> range queries, but I found this to be more difficult due to the fact that the indexed values
> are byte[] not String...
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] Updated: (SOLR-2396) deprecated char[] based collation
factories / replace with byte[]-based
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated SOLR-2396:
------------------------------
Attachment: SOLR-2396.patch
Updated patch, with unit tests for the CollationField and ICUCollationField.
I think this is close.
> deprecated char[] based collation factories / replace with byte[]-based
> -----------------------------------------------------------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A simple solution is to create tokenizer factories which are KeywordTokenizer + [ICU]CollationAttributeFactory.
> A better solution would be [ICU]CollationFieldTypes, as this would allow locale-sensitive
> range queries, but I found this to be more difficult due to the fact that the indexed values
> are byte[] not String...
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (SOLR-2396) add [ICU]CollationField
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir updated SOLR-2396:
------------------------------
Attachment: SOLR-2396.patch
now that the lucene issues are resolved, I think this patch is really close.
It could use a review though from someone who knows the fieldtype stuff better.
> add [ICU]CollationField
> -----------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Assigned] (SOLR-2396) add [ICU]CollationField
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Muir reassigned SOLR-2396:
---------------------------------
Assignee: Robert Muir
> add [ICU]CollationField
> -----------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Assignee: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (SOLR-2396) add [ICU]CollationField
Posted by "Toke Eskildsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009627#comment-13009627 ]
Toke Eskildsen commented on SOLR-2396:
--------------------------------------
A rough idea: It seems that ICU Collator Keys are null-terminated. Would it be possible to allow for a key that contained the original String? Something like [collator-bytes][null][term-as-utf-8]? This embedding would make collator-ordered faceting with multiple terms/document much easier.
> add [ICU]CollationField
> -----------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (SOLR-2396) add [ICU]CollationField
Posted by "Toke Eskildsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009665#comment-13009665 ]
Toke Eskildsen commented on SOLR-2396:
--------------------------------------
The JavaDoc for CollationKey is very explicit about the null-termination, but I do not know enough about the inner workings to judge whether a concatenation would work in all cases.
> add [ICU]CollationField
> -----------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (SOLR-2396) add [ICU]CollationField
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009630#comment-13009630 ]
Robert Muir commented on SOLR-2396:
-----------------------------------
bq. A rough idea: It seems that ICU Collator Keys are null-terminated.
This isn't always the case, at least at query-time for example if you are using a bound mode (http://icu-project.org/apiref/icu4j/com/ibm/icu/text/CollationKey.BoundMode.html) I think for the UPPER_LONG case it does not exist.
But, in any case I think we can't rely upon the fact that ICU might currently avoid zero bytes: this isn't really specified anywhere and just an optional impl detail (http://unicode.org/reports/tr10/#Avoiding_Zero_Bytes)
> add [ICU]CollationField
> -----------------------
>
> Key: SOLR-2396
> URL: https://issues.apache.org/jira/browse/SOLR-2396
> Project: Solr
> Issue Type: Improvement
> Reporter: Robert Muir
> Fix For: 4.0
>
> Attachments: SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch, SOLR-2396.patch
>
>
> In LUCENE-2551 collation support was changed to use byte[] keys.
> Previously it encoded sort keys with IndexableBinaryString into char[],
> but this is wasteful with regards to RAM and disk when terms can be byte.
> A better solution would be [ICU]CollationFieldTypes, as this would also allow locale-sensitive range queries.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org