com.browseengine.bobo.facets.impl
Class GeoFacetHandler

java.lang.Object
  extended by com.browseengine.bobo.facets.FacetHandler<GeoFacetHandler.GeoFacetData>
      extended by com.browseengine.bobo.facets.impl.GeoFacetHandler

public class GeoFacetHandler
extends FacetHandler<GeoFacetHandler.GeoFacetData>

Constructor for GeoFacetHandler


Nested Class Summary
static class GeoFacetHandler.GeoFacetData
           
 
Nested classes/interfaces inherited from class com.browseengine.bobo.facets.FacetHandler
FacetHandler.FacetDataNone, FacetHandler.TermCountSize
 
Field Summary
 
Fields inherited from class com.browseengine.bobo.facets.FacetHandler
_name
 
Constructor Summary
GeoFacetHandler(String name, String latFieldName, String lonFieldName)
           
GeoFacetHandler(String name, String latFieldName, String lonFieldName, boolean miles)
          Constructor for GeoFacetHandler
 
Method Summary
 RandomAccessFilter buildRandomAccessFilter(String value, Properties selectionProperty)
          Builds a random access filter.
 DocComparatorSource getDocComparatorSource()
          builds a comparator to determine how sorting is done
 FacetCountCollectorSource getFacetCountCollectorSource(BrowseSelection sel, FacetSpec fspec)
          Gets a FacetCountCollector
 String[] getFieldValues(BoboIndexReader reader, int id)
          Gets the field value
 GeoFacetHandler.GeoFacetData load(BoboIndexReader reader)
          Load information from an index reader, initialized by BoboIndexReader
 
Methods inherited from class com.browseengine.bobo.facets.FacetHandler
buildFilter, buildRandomAccessAndFilter, buildRandomAccessOrFilter, clone, getDependedFacetHandler, getDependsOn, getFacetCountCollectorSource, getFacetData, getFieldValue, getName, getRawFieldValues, getTermCountSize, load, loadFacetData, loadFacetData, merge, putDependedFacetHandler, setTermCountSize, setTermCountSize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoFacetHandler

public GeoFacetHandler(String name,
                       String latFieldName,
                       String lonFieldName)

GeoFacetHandler

public GeoFacetHandler(String name,
                       String latFieldName,
                       String lonFieldName,
                       boolean miles)
Constructor for GeoFacetHandler

Parameters:
name - name of the geo facet
latFieldName - name of the index field that stores the latitude value
lonFieldName - name of the index field that stores the longitude value
miles - variable to specify if the geo distance calculations are in miles. False indicates distance calculation is in kilometers
Method Detail

buildRandomAccessFilter

public RandomAccessFilter buildRandomAccessFilter(String value,
                                                  Properties selectionProperty)
                                           throws IOException
Builds a random access filter.

Specified by:
buildRandomAccessFilter in class FacetHandler<GeoFacetHandler.GeoFacetData>
Parameters:
value - Should be of the form: lat, lon: rad
selectionProperty -
Throws:
IOException

getDocComparatorSource

public DocComparatorSource getDocComparatorSource()
Description copied from class: FacetHandler
builds a comparator to determine how sorting is done

Specified by:
getDocComparatorSource in class FacetHandler<GeoFacetHandler.GeoFacetData>
Returns:
a sort comparator

getFacetCountCollectorSource

public FacetCountCollectorSource getFacetCountCollectorSource(BrowseSelection sel,
                                                              FacetSpec fspec)
Description copied from class: FacetHandler
Gets a FacetCountCollector

Specified by:
getFacetCountCollectorSource in class FacetHandler<GeoFacetHandler.GeoFacetData>
Parameters:
sel - selection
fspec - facetSpec
Returns:
a FacetCountCollector

getFieldValues

public String[] getFieldValues(BoboIndexReader reader,
                               int id)
Description copied from class: FacetHandler
Gets the field value

Specified by:
getFieldValues in class FacetHandler<GeoFacetHandler.GeoFacetData>
Parameters:
reader - index reader
id - doc
Returns:
array of field values
See Also:
FacetHandler.getFieldValue(BoboIndexReader,int)

load

public GeoFacetHandler.GeoFacetData load(BoboIndexReader reader)
                                  throws IOException
Description copied from class: FacetHandler
Load information from an index reader, initialized by BoboIndexReader

Specified by:
load in class FacetHandler<GeoFacetHandler.GeoFacetData>
Parameters:
reader - reader
Throws:
IOException


Copyright © 2011. All Rights Reserved.