org.hibernate.search.elasticsearch.impl

## Class ToElasticsearch

- java.lang.Object
- - org.hibernate.search.elasticsearch.impl.ToElasticsearch

-     public class ToElasticsearch
      extends Object

  Various utilities to transform Hibernate Search API into Elasticsearch JSON.
  Author:
    Guillaume Smet, Gunnar Morling

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `FACET_FIELD_SUFFIX`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addFacetingRequest(JsonBuilder.Object jsonQuery, FacetingRequest facetingRequest, String sourceFieldAbsoluteName, String facetRelativeName)`
    `static com.google.gson.JsonObject` | `condition(String operator, com.google.gson.JsonArray conditions)`
    `static com.google.gson.JsonObject` | `fromDeletionQuery(DocumentBuilderIndexedEntity documentBuilder, DeletionQuery deletionQuery)`
    `static com.google.gson.JsonObject` | `fromLuceneQuery(Query query)`
    `static com.google.gson.JsonArray` | `fromLuceneSort(Sort sort)` Convert a Lucene `Sort` to an Elasticsearch sort, trying to preserve the exact same meaning as the Sort would have in Lucene.

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

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

- - ### Field Detail

    - #### FACET_FIELD_SUFFIX

          public static final String FACET_FIELD_SUFFIX

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### addFacetingRequest

          public static void addFacetingRequest(JsonBuilder.Object jsonQuery,
                                                FacetingRequest facetingRequest,
                                                String sourceFieldAbsoluteName,
                                                String facetRelativeName)

    - #### condition

          public static com.google.gson.JsonObject condition(String operator,
                                                             com.google.gson.JsonArray conditions)

    - #### fromLuceneQuery

          public static com.google.gson.JsonObject fromLuceneQuery(Query query)

    - #### fromDeletionQuery

          public static com.google.gson.JsonObject fromDeletionQuery(DocumentBuilderIndexedEntity documentBuilder,
                                                                     DeletionQuery deletionQuery)

    - #### fromLuceneSort

          public static com.google.gson.JsonArray fromLuceneSort(Sort sort)

      Convert a Lucene `Sort` to an Elasticsearch sort, trying to preserve the exact same meaning as the Sort would have in Lucene.

      For instance, missing values on numeric fields are implicitly 0 in Lucene, so this method will add it explicitly on any numeric Elasticsearch sort.

      Parameters:
        `sort` - The Lucene `Sort` to convert
      Returns:
        The equivalent Elasticsearch sort, as a `JsonArray`

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