Interface ElasticsearchConverter

All Superinterfaces:
EntityConverter<ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty,Object,Document>, EntityReader<Object,Document>, EntityWriter<Object,Document>
All Known Implementing Classes:
MappingElasticsearchConverter

Author:
Rizwan Idrees, Mohsin Husen, Christoph Strobl, Peter-Josef Meisch, Sasch Woo, Roman Puchkovskiy
  • Method Details

    • getProjectionFactory

      default ProjectionFactory getProjectionFactory()
      Get the configured ProjectionFactory.
      NOTE Should be overwritten in implementation to make use of the type cache.
      Since:
      3.2
    • convertId

      default String convertId(Object idValue)
      Convert a given idValue to its String representation taking potentially registered Converters into account.
      Parameters:
      idValue - must not be null.
      Returns:
      never null.
      Since:
      3.2
    • mapObject

      default Document mapObject(@Nullable Object source)
      Map an object to a Document.
      Parameters:
      source - the object to map
      Returns:
      will not be null.
    • updateQuery

      void updateQuery(Query query, @Nullable Class<?> domainClass)
      Updates a Query by renaming the property names in the query to the correct mapped field names and the values to the converted values if the ElasticsearchPersistentProperty for a property has a PropertyValueConverter. If domainClass is null it's a noop.
      Parameters:
      query - the query that is internally updated, must not be null
      domainClass - the class of the object that is searched with the query
    • updateFieldNames

      String updateFieldNames(String propertyPath, ElasticsearchPersistentEntity<?> persistentEntity)
      Replaces the parts in a dot separated property path with the field names of the respective properties. If no matching property is found, the original parts are rteturned.
      Parameters:
      propertyPath - the property path
      persistentEntity - the replaced values.
      Returns:
      a String wihere the property names are replaced with field names
      Since:
      5.2