org.hibernate.search.elasticsearch

## Class ElasticsearchQueries

- java.lang.Object
- - org.hibernate.search.elasticsearch.ElasticsearchQueries

-     public class ElasticsearchQueries
      extends Object

  Creates queries to be used with Elasticsearch.

  Methods in this class return `QueryDescriptor`s. See `QueryDescriptor`'s javadoc for more information about how to use it.

  Author:
    Gunnar Morling

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static QueryDescriptor` | `fromJson(String payload)` Creates an Elasticsearch query from the given JSON payload for the Elasticsearch Search API.
    `static QueryDescriptor` | `fromQueryString(String queryStringQuery)` Creates an Elasticsearch query from the given Query String Query, as e.g.

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

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

- - ### Method Detail

    - #### fromJson

          public static QueryDescriptor fromJson(String payload)

      Creates an Elasticsearch query from the given JSON payload for the Elasticsearch Search API.

      Note that only the 'query' attribute is supported.

      See the official documentation for the complete payload syntax.

      Parameters:
        `payload` - The JSON payload as a String
      Returns:
        A query descriptor that can be used to create a query.

    - #### fromQueryString

          public static QueryDescriptor fromQueryString(String queryStringQuery)

      Creates an Elasticsearch query from the given Query String Query, as e.g. to be used with the "q" parameter in the Elasticsearch Search API.

      See the official documentation for the query syntax.

      Parameters:
        `queryStringQuery` - A query string conforming to the "query string" syntax.
      Returns:
        A query descriptor that can be used to create a query.

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