Package com.browseengine.bobo.facets.data

Examples of com.browseengine.bobo.facets.data.FacetDataCache$FacetDocComparatorSource


  }
 
  private int[] getCollapsedCounts(){
  if (_collapsedCounts==null){
    _collapsedCounts = new int[_bucketValues.size()];
    FacetDataCache dataCache = _subCollector._dataCache;
    TermValueList<?> subList = dataCache.valArray;
    int[] subcounts = _subCollector._count;
    BitVector indexSet = new BitVector(subcounts.length);
    int c = 0;
    int i = 0;
View Full Code Here


    final List<String> list = buildAllRangeStrings();
   
    return new FacetCountCollectorSource(){
    @Override
    public FacetCountCollector getFacetCountCollector(BoboIndexReader reader, int docBase) {
        FacetDataCache dataCache = _dataFacetHandler.getFacetData(reader);
        return new DynamicRangeFacetCountCollector(getName(), dataCache, docBase, fspec, list);
    }
    };
  }
View Full Code Here

  }
 
  public double getFacetSelectivity(BoboIndexReader reader)
  {
    double selectivity = 0;
    FacetDataCache dataCache = _facetHandler.getFacetData(reader);
    int accumFreq=0;
    for(String value : _vals)
    {
      int idx = dataCache.valArray.indexOf(value);
      if(idx < 0)
View Full Code Here

      RandomAccessDocIdSet innerDocSet = _facetFilter.getRandomAccessDocIdSet(reader);
      if (innerDocSet==EmptyDocIdSet.getInstance()){
        return innerDocSet;
      }
     
    FacetDataCache dataCache = _facetDataCacheBuilder.build(reader);
    int totalCount = reader.maxDoc();
    TermValueList valArray = dataCache.valArray;
    int freqCount = 0;
   
   
View Full Code Here

  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  @Override
  public FacetDataCache load(BoboSegmentReader reader) throws IOException {
    FacetDataCache<?> dataCache = new FacetDataCache();
    dataCache.load(_indexFieldName, reader, _termListFactory);
    return dataCache;
  }
View Full Code Here

        processedReadersCount.inc();
        Object facetDataObj = reader.getFacetData(facetName);
        if (facetDataObj == null || !(facetDataObj instanceof FacetDataCache)) {
          throw new IllegalStateException("Couldn't extract the facet data cache for the facet - " + facetName);
        }
        FacetDataCache facetDataCache= (FacetDataCache)reader.getFacetData(facetName);
        if (!(facetDataCache.valArray instanceof TermLongList)) {
          throw new IllegalStateException("Currently only the long field is supported for the time facet - " + facetName);
        }
        long[] elements = ((TermLongList)facetDataCache.valArray).getElements();
        if (elements.length < 2) {
View Full Code Here

  }
  public  final FacetDataCache getValueCache(String name) {
    if (name.equals(lastFacetDataCacheName)) {
      return  lastFacetDataCache;
    }
    FacetDataCache ret = facetDataMap.get(name);
    if (ret != null) {
      lastFacetDataCache = ret;
      lastFacetDataCacheName = name;
      return ret;
    }
View Full Code Here

   * @param fieldName
   * @param docId
   * @return
   */
  public final  Object get(String fieldName, int docId) {
    FacetDataCache valueCache = getValueCache(fieldName);
    if (valueCache instanceof MultiValueFacetDataCache) {
      return getArray(fieldName, docId);
    }
    if (valueCache != null) {
      return valueCache.valArray.getRawValue(valueCache.orderArray.get(docId));
View Full Code Here

   * @param fieldName
   * @param docId
   * @return
   */
  public final long getLong(String fieldName, int docId) {
    FacetDataCache valueCache = getValueCache(fieldName);   
    if (valueCache != null) {
      if (valueCache.valArray instanceof TermLongList) {
        return ((TermLongList) valueCache.valArray).getPrimitiveValue(valueCache.orderArray.get(docId));
      } else {
        return (long)((TermNumberList) valueCache.valArray).getDoubleValue(valueCache.orderArray.get(docId));
View Full Code Here

   * @param fieldName
   * @param docId
   * @return
   */
  public final double getDouble(String fieldName, int docId) {
    FacetDataCache valueCache = getValueCache(fieldName);   
    if (valueCache != null) {
      return ((TermNumberList) valueCache.valArray).getDoubleValue(valueCache.orderArray.get(docId));
    } else {
      Object value = getFacetHandler(fieldName).getRawFieldValues(boboIndexReader, docId)[0];
      if (value instanceof Double) {
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.facets.data.FacetDataCache$FacetDocComparatorSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.