Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed PredicateFacetFilter to use the new FacetDataCacheBuilder inter…

…face which is just a Function.

The PredicateFacetFilter doesn't seem to be used anywhere in sensei
  • Loading branch information...
commit 2db6aae78efa556683d5c7047c4df5e5205c6c7f 1 parent 2ca216e
@santip santip authored
View
10 sensei-core/src/main/java/com/senseidb/search/facet/attribute/PredicateFacetFilter.java
@@ -8,14 +8,14 @@
import com.browseengine.bobo.docidset.EmptyDocIdSet;
import com.browseengine.bobo.docidset.RandomAccessDocIdSet;
import com.browseengine.bobo.facets.data.FacetDataCache;
-import com.browseengine.bobo.facets.filter.AdaptiveFacetFilter.FacetDataCacheBuilder;
+import com.browseengine.bobo.facets.filter.Function;
import com.browseengine.bobo.facets.filter.RandomAccessFilter;
public class PredicateFacetFilter extends RandomAccessFilter {
- private final FacetDataCacheBuilder dataCacheBuilder;
+ private final Function<BoboIndexReader, FacetDataCache<?>> dataCacheBuilder;
private final FacetPredicate facetPredicate;
- public PredicateFacetFilter(FacetDataCacheBuilder dataCacheBuilder, FacetPredicate facetPredicate) {
+ public PredicateFacetFilter(Function<BoboIndexReader, FacetDataCache<?>> dataCacheBuilder, FacetPredicate facetPredicate) {
this.dataCacheBuilder = dataCacheBuilder;
this.facetPredicate = facetPredicate;
}
@@ -23,7 +23,7 @@ public PredicateFacetFilter(FacetDataCacheBuilder dataCacheBuilder, FacetPredica
@Override
public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboIndexReader reader) throws IOException {
- final FacetDataCache facetDataCache = dataCacheBuilder.build(reader);
+ final FacetDataCache<?> facetDataCache = dataCacheBuilder.apply(reader);
int startDocIdTemp = Integer.MAX_VALUE;
int endDocIdTemp = -1;
for (int i = facetPredicate.valueStartIndex(facetDataCache); i < facetPredicate.valueEndIndex(facetDataCache); i++) {
@@ -61,7 +61,7 @@ public DocIdSetIterator iterator() throws IOException {
}
@Override
public double getFacetSelectivity(BoboIndexReader reader) {
- FacetDataCache dataCache = dataCacheBuilder.build(reader);
+ FacetDataCache<?> dataCache = dataCacheBuilder.apply(reader);
int[] frequencies = dataCache.freqs;
double selectivity = 0;
int accumFreq = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.