[
https://issues.apache.org/jira/browse/LUCENE-3918?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shai Erera updated LUCENE-3918:
-------------------------------
Attachment: LUCENE-3918.patch
Patch addresses the following:
* Updated patch to trunk API, following the DocValues changes. As a result, I
implemented only NumericDocValues sorting, throwing
UnsupportedOperationException for the rest. We can add respective impls later.
* Cleaned up all dependencies on analysis module.
* Replaced PostingMap[] by two parallel int[] (docs) and long[] (offsets)
arrays. To sort them, I wrote a simple SorterTemplate extension which swaps the
entries in both arrays when asked.
* Replaced Position by direct members (no need to allocate a new instance on
every nextPosition().
* addPosition wrote the BytesRef.offset -- we don't need to write the offset.
Rather, nextPosition always returns a BytesRef with offset=0.
** In that regard, modified the payload BytesRef to initialize once and reused
in all nextPosition calls, growing its array as needed.
* Cleaned up tests:
** Rather then try-catch(Exception) followed by fail, test methods can throw
Exception. Cleaner code.
** Handled some warnings.
** Used TEST_VERSION_CURRENT.
Also,
bq. ...shouldn't this interface directly take an IndexReader as an argument?
You're right, fixed in this patch too!
bq. SorterUtil.sort uses the stored fields API...
Fixed in the patch!
bq. SortingIndexReader constructor expects a CompositeIndexReader...
Fixed!
bq. Why does SortingIndexReader.getLiveDocs always return null?
I don't remember at the moment why, but this utility currently doesn't handle
source indexes with deleted documents ... again, not sure why, maybe the old
sorter didn't support them too? Anyway, I made SortingIndexReader yell at you
if you pass such a reader, and we can separately (or still in this issue)
enhance it to support such indexes. I will think about it.
I wonder if perhaps instead of {{To}} we should have an extension point on each
of the sorters, to parse the relevant information, returning a Comparable?
> Port index sorter to trunk APIs
> -------------------------------
>
> Key: LUCENE-3918
> URL: https://issues.apache.org/jira/browse/LUCENE-3918
> Project: Lucene - Core
> Issue Type: Task
> Components: modules/other
> Affects Versions: 4.0-ALPHA
> Reporter: Robert Muir
> Fix For: 4.2, 5.0
>
> Attachments: LUCENE-3918.patch, LUCENE-3918.patch, LUCENE-3918.patch
>
>
> LUCENE-2482 added an IndexSorter to 3.x, but we need to port this
> functionality to 4.0 apis.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]