Package com.browseengine.bobo.facets

Examples of com.browseengine.bobo.facets.FacetCountCollector


    return new FacetCountCollectorSource() {
      @Override
      public FacetCountCollector getFacetCountCollector(BoboSegmentReader reader, int docBase) {
        FacetDataCache<?> dataCache = (FacetDataCache<?>) reader.getFacetData(_dataHandlerName);
        FacetCountCollector baseCollector = baseCollectorSrc
            .getFacetCountCollector(reader, docBase);
        return new HistogramCollector<T>(getName(), baseCollector, dataCache, ospec, _start, _end,
            _unit);
      }
    };
View Full Code Here


    public void setNextReader(BoboSegmentReader reader, int docBase) throws IOException {
      ArrayList<FacetCountCollector> collectorList = new ArrayList<FacetCountCollector>();
      sortPostCollectors(reader);
      for (int i = 0; i < _collectors.length; ++i) {
        _collectors[i].setNextReader(reader, docBase);
        FacetCountCollector collector = _collectors[i]._currentPointers.facetCountCollector;
        if (collector != null) {
          collectorList.add(collector);
        }
      }
      _countCollectors = collectorList.toArray(new FacetCountCollector[collectorList.size()]);
View Full Code Here

    public void setNextReader(BoboSegmentReader reader, int docBase) throws IOException {
      ArrayList<FacetCountCollector> collectorList = new ArrayList<FacetCountCollector>();
      sortPostCollectors(reader);
      for (int i = 0; i < _collectors.length; ++i) {
        _collectors[i].setNextReader(reader, docBase);
        FacetCountCollector collector = _collectors[i]._currentPointers.facetCountCollector;
        if (collector != null) {
          collectorList.add(collector);
        }
      }
      _countCollectors = collectorList.toArray(new FacetCountCollector[collectorList.size()]);
View Full Code Here

  public LinkedList<FacetCountCollector> _countCollectorList = new LinkedList<FacetCountCollector>();
  public LinkedList<FacetCountCollector> _collectAllCollectorList = new LinkedList<FacetCountCollector>();

  public void setNextReader(BoboSegmentReader reader, int docBase) throws IOException {
    if (_collectAllSource != null) {
      FacetCountCollector collector = _collectAllSource.getFacetCountCollector(reader, docBase);
      _collectAllCollectorList.add(collector);
      collector.collectAll();
    } else {
      if (_filter != null) {
        _currentPointers.docidSet = _filter.getRandomAccessDocIdSet(reader);
        _currentPointers.postDocIDSetIterator = _currentPointers.docidSet.iterator();
        _currentPointers.doc = _currentPointers.postDocIDSetIterator.nextDoc();
View Full Code Here

    {
      FacetAccessible f = iter.next();
      if (f instanceof FacetCountCollector)
      {
        System.out.println("====================================");
        FacetCountCollector fc = (FacetCountCollector)f;
        int[] dist = fc.getCountDistribution();
        if (dist!=null)
        {
          ChiSquaredFacetCountStatisticsGenerator gen = new ChiSquaredFacetCountStatisticsGenerator();
          gen.setMinCount(0);
          FacetCountStatistics stats = gen.generateStatistic(dist, 0);
          System.out.println("stat for field "+fc.getName()+": "+stats);
          System.out.println("Centered distribution score: " + (stats.getDistribution()-(double)(stats.getNumSamplesCollected()-1))/Math.sqrt((2.0*(double)(stats.getNumSamplesCollected()-1))));
          System.out.println("........................");
          List<BrowseFacet> facetList = fc.getFacets();
          System.out.println(facetList);
          System.out.println("........................");
        }
        System.out.println("====================================");
      }
View Full Code Here

    {
      @Override
      public FacetCountCollector getFacetCountCollector(BoboIndexReader reader, int docBase)
      {
        FacetDataCache<?> dataCache = (FacetDataCache<?>)reader.getFacetData(_dataHandlerName);
        FacetCountCollector baseCollector = baseCollectorSrc.getFacetCountCollector(reader, docBase);
        return new HistogramCollector<T>(getName(),baseCollector, dataCache, ospec, _start, _end, _unit);
      }
  };
  }
View Full Code Here

      @SuppressWarnings("unchecked")
      @Override
      public FacetCountCollector getFacetCountCollector(BoboSegmentReader reader, int docBase) {
        FacetHandler<FacetDataCache<?>> dependOnFacetHandler = (FacetHandler<FacetDataCache<?>>) getDependedFacetHandler(_dependsOnFacetName);

        FacetCountCollector defaultCollector = dependOnFacetHandler.getFacetCountCollectorSource(
          sel, ospec).getFacetCountCollector(reader, docBase);
        if (defaultCollector instanceof DefaultFacetCountCollector) {
          return new BucketFacetCountCollector(_name,
              (DefaultFacetCountCollector) defaultCollector, ospec, _predefinedBuckets,
              reader.numDocs());
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.facets.FacetCountCollector

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.