public override RandomAccessDocIdSet GetRandomAccessDocIdSet(BoboSegmentReader reader) { int maxDoc = reader.MaxDoc; GeoFacetHandler.GeoFacetData dataCache = m_handler.GetFacetData <GeoFacetHandler.GeoFacetData>(reader); return(new GeoDocIdSet(dataCache.xValArray, dataCache.yValArray, dataCache.zValArray, m_lat, m_lon, m_rad, maxDoc, m_miles)); }
/// <summary> /// Constructor /// </summary> /// <param name="name">name of the Geo Facet</param> /// <param name="dataCache">The data cache for the Geo Facet</param> /// <param name="docBase">the base doc id</param> /// <param name="fspec">the facet spec for this facet</param> /// <param name="predefinedRanges">List of ranges, where each range looks like <lat, lon: rad></param> /// <param name="miles">variable to specify if the geo distance calculations are in miles. False indicates distance calculation is in kilometers</param> public GeoFacetCountCollector(string name, GeoFacetHandler.GeoFacetData dataCache, int docBase, FacetSpec fspec, IEnumerable<string> predefinedRanges, bool miles) { _name = name; _dataCache = dataCache; _xvals = dataCache.xValArray; _yvals = dataCache.yValArray; _zvals = dataCache.zValArray; _spec = fspec; _predefinedRanges = new TermStringList(); var predefinedTemp = new List<string>(predefinedRanges); predefinedTemp.Sort(); _predefinedRanges.AddAll(predefinedTemp); _docBase = docBase; _countlength = predefinedTemp.Count; _count = new LazyBigIntArray(_countlength); _ranges = new GeoRange[predefinedTemp.Count]; int index = 0; foreach (string range in predefinedTemp) { _ranges[index++] = Parse(range); } _miles = miles; }