org.apache.lucene.index.sorter
Class BlockJoinSorter

java.lang.Object
  extended by org.apache.lucene.index.sorter.Sorter
      extended by org.apache.lucene.index.sorter.BlockJoinSorter

public abstract class BlockJoinSorter
extends Sorter

Helper class to sort readers that contain blocks of documents.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.index.sorter.Sorter
Sorter.DocComparator, Sorter.DocMap
 
Field Summary
protected  Filter parentsFilter
           
 
Fields inherited from class org.apache.lucene.index.sorter.Sorter
INDEX_ORDER_COMPARATOR, REVERSE_DOCS
 
Constructor Summary
BlockJoinSorter(Filter parentsFilter)
          Sole constructor.
 
Method Summary
protected  Sorter.DocComparator getChildComparator(AtomicReader reader)
          Return a Sorter.DocComparator instance that will be called on children of the same parent.
protected abstract  Sorter.DocComparator getParentComparator(AtomicReader reader)
          Return a Sorter.DocComparator instance that will be called on parent doc IDs.
 Sorter.DocMap sort(AtomicReader reader)
          Returns a mapping from the old document ID to its new location in the sorted index.
 
Methods inherited from class org.apache.lucene.index.sorter.Sorter
getID, sort, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parentsFilter

protected final Filter parentsFilter
Constructor Detail

BlockJoinSorter

public BlockJoinSorter(Filter parentsFilter)
Sole constructor.

Method Detail

getParentComparator

protected abstract Sorter.DocComparator getParentComparator(AtomicReader reader)
Return a Sorter.DocComparator instance that will be called on parent doc IDs.


getChildComparator

protected Sorter.DocComparator getChildComparator(AtomicReader reader)
Return a Sorter.DocComparator instance that will be called on children of the same parent. By default, children of the same parent are not reordered.


sort

public final Sorter.DocMap sort(AtomicReader reader)
                         throws IOException
Description copied from class: Sorter
Returns a mapping from the old document ID to its new location in the sorted index. Implementations can use the auxiliary Sorter.sort(int, DocComparator) to compute the old-to-new permutation given a list of documents and their corresponding values.

A return value of null is allowed and means that reader is already sorted.

NOTE: deleted documents are expected to appear in the mapping as well, they will however be marked as deleted in the sorted view.

Specified by:
sort in class Sorter
Throws:
IOException


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.