Annotation Type DistanceProjection


@Documented @Target(PARAMETER) @Retention(RUNTIME) @MethodParameterMapping(processor=@MethodParameterMappingAnnotationProcessorRef(type=org.hibernate.search.mapper.pojo.mapping.definition.annotation.processing.impl.DistanceProjectionProcessor.class,retrieval=CONSTRUCTOR)) public @interface DistanceProjection
Maps a constructor parameter to a distance projection, i.e. sequences of text that matched the query, extracted from the given field's value.
See Also:
  • SearchProjectionFactory.highlight(String)
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
    org.hibernate.search.engine.spatial.DistanceUnit
     
  • Element Details

    • path

      String path
      Returns:
      The path to the index field whose value will be extracted. Defaults to the name of the annotated constructor parameter, if it can be retrieved (requires the class to be compiled with the -parameters flag; otherwise an empty path will lead to a failure).
      See Also:
      • SearchProjectionFactory.distance(String, GeoPoint)
      Default:
      ""
    • fromParam

      String fromParam
      Returns:
      The name of a query parameter that will represent a GeoPoint point, from which the distance to the field value will be calculated.
      See Also:
      • SearchProjectionFactory.distance(String, GeoPoint)
    • unit

      org.hibernate.search.engine.spatial.DistanceUnit unit
      Returns:
      The unit of the computed distance (default is meters).
      Default:
      METERS