Class IndexSupport


  • public class IndexSupport
    extends Object

    Index utilities

    Author:
    Silvano Riz
    • Method Detail

      • deduplicateIfNecessary

        public static <O,​A> ResultSet<O> deduplicateIfNecessary​(Iterable<? extends ResultSet<O>> results,
                                                                      Query<O> query,
                                                                      Attribute<O,​A> attribute,
                                                                      QueryOptions queryOptions,
                                                                      int retrievalCost)

        If a query option specifying logical deduplication was supplied, wrap the given result sets in ResultSetUnion, otherwise wrap in ResultSetUnionAll.

        There are two exceptions where a ResultSetUnionAll is used regardless of the logical deduplication query option:

        • If the index is built on a SimpleAttribute which means that the same object could not exist in more than one StoredResultSet.
        • If the query is an In query and it is marked as disjoint ( In.isDisjoint() returns true )
        Parameters:
        results - Provides the result sets to union
        query - The query for which the union is being constructed
        queryOptions - Specifies whether or not logical deduplication is required
        retrievalCost - The resultSet retrieval cost
        Returns:
        A union view over the given result sets