org.apache.lucene.search

## Class BlockJoinComparatorSource

- java.lang.Object
- - org.apache.lucene.search.FieldComparatorSource
  - - org.apache.lucene.search.BlockJoinComparatorSource

-     public class BlockJoinComparatorSource
      extends FieldComparatorSource

  Helper class to sort readers that contain blocks of documents.

  Note that this class is intended to used with `SortingMergePolicy`, and for other purposes has some limitations:

  - Cannot yet be used with `IndexSearcher.searchAfter`
  - Filling sort field values is not yet supported.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BlockJoinComparatorSource(Query parentsFilter, Sort parentSort)` Create a new BlockJoinComparatorSource, sorting only blocks of documents with `parentSort` and not reordering children with a block.
    `BlockJoinComparatorSource(Query parentsFilter, Sort parentSort, Sort childSort)` Create a new BlockJoinComparatorSource, specifying the sort order for both blocks of documents and children within a block.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FieldComparator<Integer>` | `newComparator(String fieldname, int numHits, int sortPos, boolean reversed)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BlockJoinComparatorSource

          public BlockJoinComparatorSource(Query parentsFilter,
                                   Sort parentSort)

      Create a new BlockJoinComparatorSource, sorting only blocks of documents with `parentSort` and not reordering children with a block.
      Parameters:
        `parentsFilter` - Filter identifying parent documents
        `parentSort` - Sort for parent documents

    - #### BlockJoinComparatorSource

          public BlockJoinComparatorSource(Query parentsFilter,
                                   Sort parentSort,
                                   Sort childSort)

      Create a new BlockJoinComparatorSource, specifying the sort order for both blocks of documents and children within a block.
      Parameters:
        `parentsFilter` - Filter identifying parent documents
        `parentSort` - Sort for parent documents
        `childSort` - Sort for child documents in the same block

  - ### Method Detail

    - #### newComparator

          public FieldComparator<Integer> newComparator(String fieldname,
                                               int numHits,
                                               int sortPos,
                                               boolean reversed)
                                                 throws IOException

      Specified by:
        `newComparator` in class `FieldComparatorSource`
      Throws:
        `IOException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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