org.hibernate.search.query.dsl.impl

## Class ConnectedSpatialContext

- java.lang.Object
- - org.hibernate.search.query.dsl.impl.ConnectedSpatialContext

- All Implemented Interfaces:
    QueryCustomization<SpatialContext>, SpatialContext, SpatialMatchingContext

      public class ConnectedSpatialContext
      extends Object
      implements SpatialContext

  Author:
    Emmanuel Bernard

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectedSpatialContext(QueryBuildingContext context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SpatialContext` | `boostedTo(float boost)` Boost the query to a given value Most of the time positive float: - lower than 1 to diminish the weight - higher than 1 to increase the weight Could be negative but not unless you understand what is going on (advanced)
    `SpatialContext` | `filteredBy(Query filter)` Filter the query results with the given Query instance
    `SpatialMatchingContext` | `onField(String fieldName)` Used to select the spatial field/coordinates used for this query.
    `SpatialContext` | `withConstantScore()` All results matching the query have a constant score equals to the boost FIXME is that true?
    `WithinContext` | `within(double distance, Unit unit)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConnectedSpatialContext

          public ConnectedSpatialContext(QueryBuildingContext context)

  - ### Method Detail

    - #### onField

          public SpatialMatchingContext onField(String fieldName)

      Description copied from interface: `SpatialContext`
      Used to select the spatial field/coordinates used for this query. If not specified, the default field (`Spatial.COORDINATES_DEFAULT_FIELD`) is used.

      Note: An entity can have multiple `Spatial` annotations defining different sets of coordinates. Each non-default `Spatial` instance has a name to identify it. Use this method to specify the targeted coordinate field.

      Specified by:
        `onField` in interface `SpatialContext`
      Parameters:
        `fieldName` - The name of the set of coordinates to target for the query
      Returns:
        `SpatialMatchingContext` instance for continuation

    - #### boostedTo

          public SpatialContext boostedTo(float boost)

      Description copied from interface: `QueryCustomization`
      Boost the query to a given value Most of the time positive float: - lower than 1 to diminish the weight - higher than 1 to increase the weight Could be negative but not unless you understand what is going on (advanced)
      Specified by:
        `boostedTo` in interface `QueryCustomization<SpatialContext>`
      Parameters:
        `boost` - the value to use as boost
      Returns:
        an instance of T for method chaining

    - #### withConstantScore

          public SpatialContext withConstantScore()

      Description copied from interface: `QueryCustomization`
      All results matching the query have a constant score equals to the boost FIXME is that true?
      Specified by:
        `withConstantScore` in interface `QueryCustomization<SpatialContext>`
      Returns:
        an instance of T for method chaining

    - #### filteredBy

          public SpatialContext filteredBy(Query filter)

      Description copied from interface: `QueryCustomization`
      Filter the query results with the given Query instance
      Specified by:
        `filteredBy` in interface `QueryCustomization<SpatialContext>`
      Parameters:
        `filter` - the Query to use as a filter
      Returns:
        an instance of T for method chaining

    - #### within

          public WithinContext within(double distance,
                                      Unit unit)

      Specified by:
        `within` in interface `SpatialMatchingContext`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved