org.hibernate.search.filter
Class FilterOptimizationHelper

java.lang.Object
  extended by org.hibernate.search.filter.FilterOptimizationHelper

public class FilterOptimizationHelper
extends Object

Helper class to apply some common optimizations when several Filters are applied.

Author:
Sanne Grinovero

Constructor Summary
FilterOptimizationHelper()
           
 
Method Summary
static org.apache.lucene.util.DocIdBitSet mergeByBitAnds(List<org.apache.lucene.util.DocIdBitSet> docIdBitSets)
          Merges all DocIdBitSet in a new DocIdBitSet using binary AND operations, which is usually more efficient than using an iterator.
static List<org.apache.lucene.search.DocIdSet> mergeByBitAnds(List<org.apache.lucene.search.DocIdSet> docIdSets)
          Returns a new list of DocIdSet, applying binary AND on all DocIdSet implemented by using BitSet or OpenBitSet.
static org.apache.lucene.util.OpenBitSet mergeByBitAnds(List<org.apache.lucene.util.OpenBitSet> openBitSets)
          Merges all OpenBitSet in a new OpenBitSet using binary AND operations, which is usually more efficient than using an iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterOptimizationHelper

public FilterOptimizationHelper()
Method Detail

mergeByBitAnds

public static List<org.apache.lucene.search.DocIdSet> mergeByBitAnds(List<org.apache.lucene.search.DocIdSet> docIdSets)
Returns a new list of DocIdSet, applying binary AND on all DocIdSet implemented by using BitSet or OpenBitSet.

Parameters:
docIdSets -
Returns:
the same list if not change was done

mergeByBitAnds

public static org.apache.lucene.util.DocIdBitSet mergeByBitAnds(List<org.apache.lucene.util.DocIdBitSet> docIdBitSets)
Merges all DocIdBitSet in a new DocIdBitSet using binary AND operations, which is usually more efficient than using an iterator.

Parameters:
docIdBitSets -
Returns:
a new DocIdBitSet, or the first element if only one element was found in the list.

mergeByBitAnds

public static org.apache.lucene.util.OpenBitSet mergeByBitAnds(List<org.apache.lucene.util.OpenBitSet> openBitSets)
Merges all OpenBitSet in a new OpenBitSet using binary AND operations, which is usually more efficient than using an iterator.

Parameters:
openBitSets -
Returns:
a new OpenBitSet, or the first element if only one element was found in the list.