org.hibernate.search.annotations

## Annotation Type Spatial

-     @Retention(value=RUNTIME)
       @Target(value={METHOD,FIELD,TYPE})
       @Documented
       @Repeatable(value=Spatials.class)
      public @interface Spatial

  Defines a spatial property. Spatial coordinates can be indexed as latitude / longitude fields and queried via range queries. This is known as the `SpatialMode.RANGE` approach. Otherwise, they can be indexed using a spatial hash index. This is known as the `SpatialMode.HASH` approach. The size of the grid can be adjusted with `topSpatialHashLevel` and `bottomSpatialHashLevel`. For more information on which model to use, read the Hibernate Search reference documentation. If your longitude and latitude information are hosted on free properties, Add `@Spatial` on the entity (class-level). The `Latitude` and `Longitude` annotations must mark the properties.

       @Entity
       @Spatial(name="home")
       public class User {
           @Latitude(of="home")
           public Double getHomeLatitude() { ... }
           @Longitude(of="home")
           public Double getHomeLongitude() { ... }
       }

  Alternatively, you can put the latitude / longitude information in a property of type `Coordinates`.

       @Entity
       public class User {
           @Spatial
           public Coordinates getHome() { ... }
       }

  Author:
    Nicolas Helleringer
  Experimental
    Spatial support is still considered experimental

- - ### Field Summary

    Fields
    Modifier and Type | Fields and Description
    --- | ---
    `static String` | `COORDINATES_DEFAULT_FIELD` Prefix used to generate field names for a default `Spatial` annotation

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `Boost` | `boost` Deprecated. Index-time boosting will not be possible anymore starting from Lucene 7. You should use query-time boosting instead, for instance by calling `boostedTo(float)` when building queries with the Hibernate Search query DSL.
    `int` | `bottomSpatialHashLevel`
    `String` | `name` The name of the field prefix where spatial index information is stored in a Lucene document.
    `SpatialMode` | `spatialMode`
    `Store` | `store`
    `int` | `topSpatialHashLevel`

- - ### Field Detail

    - #### COORDINATES_DEFAULT_FIELD

          public static final String COORDINATES_DEFAULT_FIELD

      Prefix used to generate field names for a default `Spatial` annotation

  - ### Element Detail

    - #### name

          public abstract String name

      The name of the field prefix where spatial index information is stored in a Lucene document. If `@Spatial` is hosted on a property, defaults to the property name.
      Returns:
        the field name
      Default:
        ""

  - - #### store

          public abstract Store store

      Returns:
        Returns an instance of the `Store` enum, indicating whether the value should be stored in the document. Defaults to `Store.NO`
      Default:
        org.hibernate.search.annotations.Store.NO

  - - #### boost

          @Deprecated
          public abstract Boost boost

      Deprecated. Index-time boosting will not be possible anymore starting from Lucene 7. You should use query-time boosting instead, for instance by calling `boostedTo(float)` when building queries with the Hibernate Search query DSL.
      Returns:
        Returns a `Boost` annotation defining a float index time boost value
      Default:
        @org.hibernate.search.annotations.Boost(1.0f)

  - - #### spatialMode

          public abstract SpatialMode spatialMode

      Returns:
        the mode used for Spatial indexing
      Default:
        org.hibernate.search.annotations.SpatialMode.RANGE

  - - #### topSpatialHashLevel

          public abstract int topSpatialHashLevel

      Returns:
        top range spatial hash level for spatial indexing
      Default:
        0

  - - #### bottomSpatialHashLevel

          public abstract int bottomSpatialHashLevel

      Returns:
        bottom spatial hash level for spatial indexing
      Default:
        16

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