org.elasticsearch.search.facet.histogram.unbounded
Class ScriptHistogramFacetCollector

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by org.elasticsearch.search.facet.FacetCollector
          extended by org.elasticsearch.search.facet.AbstractFacetCollector
              extended by org.elasticsearch.search.facet.histogram.unbounded.ScriptHistogramFacetCollector

public class ScriptHistogramFacetCollector
extends AbstractFacetCollector


Field Summary
 
Fields inherited from class org.elasticsearch.search.facet.AbstractFacetCollector
facetName, filter
 
Constructor Summary
ScriptHistogramFacetCollector(String facetName, String scriptLang, String keyScript, String valueScript, Map<String,Object> params, long interval, HistogramFacet.ComparatorType comparatorType, SearchContext context)
           
 
Method Summary
static long bucket(double value, long interval)
           
protected  void doCollect(int doc)
           
protected  void doSetNextReader(org.apache.lucene.index.IndexReader reader, int docBase)
           
 Facet facet()
           
 void setScorer(org.apache.lucene.search.Scorer scorer)
           
 
Methods inherited from class org.elasticsearch.search.facet.AbstractFacetCollector
acceptsDocsOutOfOrder, collect, getAndClearFilter, getFilter, setFilter, setNextReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptHistogramFacetCollector

public ScriptHistogramFacetCollector(String facetName,
                                     String scriptLang,
                                     String keyScript,
                                     String valueScript,
                                     Map<String,Object> params,
                                     long interval,
                                     HistogramFacet.ComparatorType comparatorType,
                                     SearchContext context)
Method Detail

doCollect

protected void doCollect(int doc)
                  throws IOException
Specified by:
doCollect in class AbstractFacetCollector
Throws:
IOException

setScorer

public void setScorer(org.apache.lucene.search.Scorer scorer)
               throws IOException
Overrides:
setScorer in class AbstractFacetCollector
Throws:
IOException

doSetNextReader

protected void doSetNextReader(org.apache.lucene.index.IndexReader reader,
                               int docBase)
                        throws IOException
Specified by:
doSetNextReader in class AbstractFacetCollector
Throws:
IOException

facet

public Facet facet()
Specified by:
facet in class FacetCollector

bucket

public static long bucket(double value,
                          long interval)


Copyright © 2009-2012. All Rights Reserved.