com.browseengine.bobo.facets.impl.VirtualSimpleFacetHandler Maven / Gradle / Ivy
/**
* This software is licensed to you under the Apache License, Version 2.0 (the
* "Apache License").
*
* LinkedIn's contributions are made under the Apache License. If you contribute
* to the Software, the contributions will be deemed to have been made under the
* Apache License, unless you expressly indicate otherwise. Please do not make any
* contributions that would be inconsistent with the Apache License.
*
* You may obtain a copy of the Apache License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, this software
* distributed under the Apache License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Apache
* License for the specific language governing permissions and limitations for the
* software governed under the Apache License.
*
* © 2012 LinkedIn Corp. All Rights Reserved.
*/
package com.browseengine.bobo.facets.impl;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import java.io.IOException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import org.apache.lucene.index.TermDocs;
import com.browseengine.bobo.api.BoboIndexReader;
import com.browseengine.bobo.facets.data.FacetDataCache;
import com.browseengine.bobo.facets.data.TermListFactory;
import com.browseengine.bobo.facets.data.TermFixedLengthLongArrayListFactory;
import com.browseengine.bobo.facets.data.TermStringList;
import com.browseengine.bobo.facets.data.TermValueList;
import com.browseengine.bobo.facets.data.FacetDataFetcher;
import com.browseengine.bobo.util.BigIntArray;
import com.browseengine.bobo.util.BigSegmentedArray;
public class VirtualSimpleFacetHandler extends SimpleFacetHandler
{
protected FacetDataFetcher _facetDataFetcher;
public VirtualSimpleFacetHandler(String name,
String indexFieldName,
TermListFactory termListFactory,
FacetDataFetcher facetDataFetcher,
Set dependsOn)
{
super(name, null, termListFactory, dependsOn);
_facetDataFetcher = facetDataFetcher;
}
public VirtualSimpleFacetHandler(String name,
TermListFactory termListFactory,
FacetDataFetcher facetDataFetcher,
Set dependsOn)
{
this(name, null, termListFactory, facetDataFetcher, dependsOn);
}
@Override
public FacetDataCache load(BoboIndexReader reader) throws IOException
{
int doc = -1;
TreeMap