Package com.browseengine.bobo.facets.data

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


    return new String[]{dataCache.valArray.get(dataCache.orderArray.get(id))};
  }

  @Override
  public Object[] getRawFieldValues(BoboIndexReader reader,int id){
    FacetDataCache dataCache = getFacetData(reader);
    return new Object[]{dataCache.valArray.getRawValue(dataCache.orderArray.get(id))};
  }
View Full Code Here


    if (groupMode) {
      return new FacetCountCollectorSource(){
        @Override
        public FacetCountCollector getFacetCountCollector(
            BoboIndexReader reader, int docBase) {
          FacetDataCache dataCache = SimpleFacetHandler.this.getFacetData(reader);
          return new SimpleGroupByFacetCountCollector(_name,dataCache,docBase,sel,ospec);
       
      };
    }
    else {
      return new FacetCountCollectorSource(){
        @Override
        public FacetCountCollector getFacetCountCollector(
            BoboIndexReader reader, int docBase) {
          FacetDataCache dataCache = SimpleFacetHandler.this.getFacetData(reader);
          return new SimpleFacetCountCollector(_name,dataCache,docBase,sel,ospec);
       
      };
    }
  }
View Full Code Here

    }
  }

  @Override
  public FacetDataCache load(BoboIndexReader reader) throws IOException {
    FacetDataCache dataCache = new FacetDataCache();
    dataCache.load(_indexFieldName, reader, _termListFactory);
    return dataCache;
  }
View Full Code Here

    dataCache.load(_indexFieldName, reader, _termListFactory);
    return dataCache;
  }
 
  public BoboDocScorer getDocScorer(BoboIndexReader reader,FacetTermScoringFunctionFactory scoringFunctionFactory,Map<String,Float> boostMap){
    FacetDataCache dataCache = getFacetData(reader);
    float[] boostList = BoboDocScorer.buildBoostList(dataCache.valArray, boostMap);
    return new SimpleBoboDocScorer(dataCache,scoringFunctionFactory,boostList);
  }
View Full Code Here

  static int numDocsPerSeg = numDocs/numSegs;
  static Random rand = new Random();
 
  static int percent_zero=80;
  static FacetDataCache makeFacetDataCache(){
    FacetDataCache cache = new FacetDataCache();
    cache.freqs = new int[numVals];
    Random r = new Random();
    for (int i=0;i<cache.freqs.length;++i){
      int p = r.nextInt(100);
      int v;
View Full Code Here

    facetHandlers.add(new SimpleFacetHandler("number", numTermFactory));
    facetHandlers.add(new VirtualSimpleFacetHandler("virtual", numTermFactory,
        new FacetDataFetcher() {
          @Override
          public Object fetch(BoboSegmentReader reader, int doc) {
            FacetDataCache sourceCache = (FacetDataCache) reader.getFacetData("number");
            if (sourceCache == null) return null;
            return sourceCache.valArray.getRawValue(sourceCache.orderArray.get(doc));
          }

          @Override
View Full Code Here

  static int percent_zero = 80;

  @SuppressWarnings({ "rawtypes", "unchecked" })
  static FacetDataCache makeFacetDataCache() {
    FacetDataCache cache = new FacetDataCache();
    cache.freqs = new int[numVals];
    Random r = new Random();
    for (int i = 0; i < cache.freqs.length; ++i) {
      int p = r.nextInt(100);
      int v;
View Full Code Here

        ++i;
      }
    }
    list.seal();

    FacetDataCache dataCache = new FacetDataCache(order, list, freqs, minIDs,
      maxIDs, TermCountSize.large);
    return dataCache;
  }
View Full Code Here

    return c;
  }
 
  @Override
  public int getNumItems(BoboIndexReader reader, int id) {
  FacetDataCache dataCache = getFacetData(reader);
  if (dataCache==null) return 0;
  int encoded=dataCache.orderArray.get(id);
  return countBits(encoded);
  }
View Full Code Here

  return countBits(encoded);
  }

  @Override
  public String[] getFieldValues(BoboIndexReader reader,int id) {
    FacetDataCache dataCache = getFacetData(reader);
    if (dataCache==null) return new String[0];
    int encoded=dataCache.orderArray.get(id);
    if (encoded==0) {
      return new String[]{""};
    }
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.