Class GeolocationContextMapping.Builder

    • Constructor Detail

      • Builder

        protected Builder(String name)
      • Builder

        protected Builder(String name,
                          boolean neighbors,
                          int... levels)
    • Method Detail

      • precision

        public GeolocationContextMapping.Builder precision(double meters)
        Set the precision use o make suggestions
        Parameters:
        meters - precision as distance in meters
        Returns:
        this
      • precision

        public GeolocationContextMapping.Builder precision(int level)
        Set the precision use o make suggestions
        Parameters:
        level - maximum length of geohashes
        Returns:
        this
      • neighbors

        public GeolocationContextMapping.Builder neighbors(boolean neighbors)
        Set neighborhood usage
        Parameters:
        neighbors - should neighbor cells also be valid
        Returns:
        this
      • addDefaultLocation

        public GeolocationContextMapping.Builder addDefaultLocation(String geohash)
        Set a default location that should be used, if no location is provided by the query
        Parameters:
        geohash - geohash of the default location
        Returns:
        this
      • addDefaultLocations

        public GeolocationContextMapping.Builder addDefaultLocations(Collection<String> geohashes)
        Set a default location that should be used, if no location is provided by the query
        Parameters:
        geohashes - geohash of the default location
        Returns:
        this
      • addDefaultLocation

        public GeolocationContextMapping.Builder addDefaultLocation(double lat,
                                                                    double lon)
        Set a default location that should be used, if no location is provided by the query
        Parameters:
        lat - latitude of the default location
        lon - longitude of the default location
        Returns:
        this
      • defaultLocation

        public GeolocationContextMapping.Builder defaultLocation(GeoPoint point)
        Set a default location that should be used, if no location is provided by the query
        Parameters:
        point - location
        Returns:
        this