com.workday.esclient

EsQueryHelpers

object EsQueryHelpers

Helper object for Elasticsearch queries.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. EsQueryHelpers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def aggregationTerms(field: String, options: Map[String, Any] = Map.empty): Option[Map[String, Map[String, Any]]]

    Returns an Aggregations Terms map for the search Terms Aggregation Elasticsearch API.

    Returns an Aggregations Terms map for the search Terms Aggregation Elasticsearch API.

    field

    String aggregation field.

    options

    Map of options to aggregate on.

    returns

    Map of aggregation fields and any options.

  7. def aggs(maps: Option[Map[String, Any]]*): Option[Map[String, Any]]

    Returns a map for using Elasticsearch's aggs mechanism.

    Returns a map for using Elasticsearch's aggs mechanism.

    maps

    for being included in the ES query.

    returns

    a single Map with a top level "aggs" key.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def bool(must: Option[_] = None, should: Option[_] = None, mustNot: Option[_] = None, options: Map[String, Any] = Map.empty): Option[Map[String, Any]]

    Returns a map for making Bool queries using the Bool Elasticsearch API.

    Returns a map for making Bool queries using the Bool Elasticsearch API.

    must

    Map or Seq of fields and values that must be matched.

    should

    Map or Seq of fields and values that should be matched. Threshold set by minimum_should_match parameter.

    mustNot

    Map or Seq of fields and values.

    options

    Additional fields to include in Bool query, like minimum_should_match.

    returns

    Map for using the Query Bool API.

  10. def boosting(positive: Option[_] = None, negative: Option[_] = None, negativeBoost: Option[Double] = Some(0.2)): Option[Map[String, Any]]

    Returns a map for making Boosting queries using the Boosting Elasticsearch API.

    Returns a map for making Boosting queries using the Boosting Elasticsearch API.

    positive

    Map containing the field and value to positively boost.

    negative

    Map containing the field and value to negatively boost.

    negativeBoost

    Value for negative boosting, set to 0.2.

    returns

    Map for using the Query Boosting API.

  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def disMax(queries: Seq[Map[String, Any]], tieBreaker: Option[Double] = None, boost: Option[Double] = None): Option[Map[String, Any]]

    Returns a map for making Dis Max Elasticsearch queries.

    Returns a map for making Dis Max Elasticsearch queries. Dis Max returns the union of of documents retrieved from the subqueries.

    queries

    Map representing subqueries.

    tieBreaker

    Double tiebreaker parameter for favoring documents with preferred term usage.

    boost

    Double boost parameter.

    returns

    Combined map for making Dis Max queries.

  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def filter(maps: Option[Map[String, Any]]*): Option[Map[String, Any]]

    Returns a map for using Elasticsearch's filter mechanism.

    Returns a map for using Elasticsearch's filter mechanism.

    maps

    for being included in the ES query.

    returns

    a single Map with a top level "filter" key.

  16. def filtered(qOpt: Option[Map[String, Any]], fOpt: Option[Map[String, Any]]): Option[Map[String, Any]]

    Returns a map for making filtered Elasticsearch queries.

    Returns a map for making filtered Elasticsearch queries. Combines and matches on optional query ops and filter ops.

    qOpt

    Map representing the query operation.

    fOpt

    Map representing the filter operation.

    returns

    Combined map for making filtered queries.

  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def functionScore(q: Option[Map[String, Any]], fs: Seq[Map[String, Any]], scoreMode: String): Option[Map[String, Any]]

    Returns a map for making Function Score Elastichsearch queries.

    Returns a map for making Function Score Elastichsearch queries. This API requires the user to provide functions to score each document returned by the query.

    q

    Map representing the query operation.

    fs

    Map representing the function score fields.

    scoreMode

    String representing how the new scores will be combined.

    returns

    Combined map for making Function Score queries.

  19. def geoDistance(field: String, lat: String, lon: String, distance: String): Option[Map[String, Map[String, AnyRef]]]

    Returns a map of Geo Distance parameters for the Geo Distance Elasticsearch API.

    Returns a map of Geo Distance parameters for the Geo Distance Elasticsearch API.

    field

    String field to serve as the center location.

    lat

    String latitude value.

    lon

    String longitude value.

    distance

    String distance value.

    returns

    Map of Geo Distance parameters.

  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. def keyedAggregationRange(rangeKey: String, from: Option[Double], to: Option[Double]): Option[Map[String, Any]]

    Returns a map of Range buckets with String keys for the Range Aggregation Elasticsearch API.

    Returns a map of Range buckets with String keys for the Range Aggregation Elasticsearch API. If neither a "to" nor "from" range are provided, returns None.

    rangeKey

    String key for the range bucket.

    from

    Double "from" range.

    to

    Double "to" range.

    returns

    Map of keyed range buckets.

  24. def keyedAggregationRanges(field: String, ranges: Seq[Map[String, Any]]): Option[Map[String, Any]]

    Returns a keyed Aggregation Range map for the Range Aggregation Elasticsearch API.

    Returns a keyed Aggregation Range map for the Range Aggregation Elasticsearch API. Keyed parameter associates a unique string with each range bucket.

    field

    String field to aggregate on.

    ranges

    Sequences of map ranges to bucket.

    returns

    Map of keyed range fields.

  25. def matchAll: Option[Map[String, Map[String, Any]]]

    Returns a map for making Match All queries using the Match All Elasticsearch API.

    Returns a map for making Match All queries using the Match All Elasticsearch API.

    returns

    Map for using the Query Match All API.

  26. def matchPhrasePrefixQuery(field: String, str: String, otherOption: (String, Any)*): Option[Map[String, Map[String, Any]]]

    Returns a map for making Match queries with the phrase_prefix option.

    Returns a map for making Match queries with the phrase_prefix option.

    field

    String field to match.

    str

    String value for field.

    otherOption

    Tuples of additional parameters to include in the query.

    returns

    Map for using the Query Match API with phrase_prefix matching.

  27. def matchQuery(field: String, str: String, otherOption: (String, Any)*): Option[Map[String, Map[String, Any]]]

    Returns a map for making match queries using the Match Elasticsearch API.

    Returns a map for making match queries using the Match Elasticsearch API.

    field

    String field to match.

    str

    String value for field.

    otherOption

    Tuples of additional parameters to include in the query.

    returns

    Map for using the Query Match API.

  28. def multiMatchQuery(fields: Seq[String], str: String, otherOption: (String, Any)*): Option[Map[String, Map[String, Any]]]

    Returns a map for making mutli match queries using the Multi Match Elasticsearch API.

    Returns a map for making mutli match queries using the Multi Match Elasticsearch API.

    fields

    Sequence of String fields to match.

    str

    String value for field.

    otherOption

    Tuples of additional parameters to include in the query.

    returns

    Map for using the Query Multi Match API.

  29. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  32. def orFilter(filters: Seq[Map[String, Any]]): Option[Map[String, Any]]

    Returns a map of filters for making Or queries using the Or Filter Elasticsearch API.

    Returns a map of filters for making Or queries using the Or Filter Elasticsearch API.

    filters

    Sequence of fields and values to filter on.

    returns

    Map of filter for using the Or Filter API.

  33. def params(maps: Option[Map[String, Any]]*): Option[Map[String, Any]]

    Returns a map for including a group of parameters in an Elasticsearch request.

    Returns a map for including a group of parameters in an Elasticsearch request.

    maps

    for being included in the ES query.

    returns

    a single Map with a top level "params" key.

  34. def postFilter(maps: Option[Map[String, Any]]*): Option[Map[String, Any]]

    Returns a map for using Elasticsearch's post_filter mechanism.

    Returns a map for using Elasticsearch's post_filter mechanism.

    maps

    for being included in the ES query.

    returns

    a single Map with a top level "post_filter" key.

  35. def prefixQuery(field: String, str: String): Option[Map[String, Map[String, Any]]]

    Returns a map for making Prefix queries using the Prefix Elasticsearch API.

    Returns a map for making Prefix queries using the Prefix Elasticsearch API.

    field

    String field to match.

    str

    String value for field.

    returns

    Map for using the Query Prefix API.

  36. def query(maps: Option[Map[String, Any]]*): Option[Map[String, Any]]

    Returns a map for making a general Elasticsearch query.

    Returns a map for making a general Elasticsearch query.

    maps

    for being included in the ES query.

    returns

    a single Map with a top level "query" key.

  37. def queryString(query: String, otherOption: (String, Any)*): Option[Map[String, Map[String, Any]]]

    Returns a map with a query string for use in the Query Elasticsearch API.

    Returns a map with a query string for use in the Query Elasticsearch API.

    query

    String query for ES.

    otherOption

    Tuples of additional parameters to include in ES query.

    returns

    Query string map for ES.

  38. def range(fieldName: String, lowerBound: Option[Double], lowerBoundOp: ComparisonOp, upperBound: Option[Double], upperBoundOp: ComparisonOp): Option[Map[String, Any]]

    Returns a map for making Range Elasticsearch queries.

    Returns a map for making Range Elasticsearch queries.

    fieldName

    String field name to query on.

    lowerBound

    Double value for lower bound of range.

    lowerBoundOp

    Comparison op for lower bound.

    upperBound

    Double value for upper bound of range.

    upperBoundOp

    Comparison op for upper bound.

    returns

    Combined map for making Range queries.

  39. def range(field: String, terms: Map[String, Long]): Option[Map[String, Map[String, Any]]]

    Returns a Range map of comparator keys and values for the search Range Elasticsearch API.

    Returns a Range map of comparator keys and values for the search Range Elasticsearch API. Acceptable comparator key values for "terms": gte, gt, lte, lt.

    field

    String field to compare range on.

    terms

    Map of comparator Strings and associated Long values.

    returns

    Map of comparator keys and values.

  40. def seqOption[T](els: Option[T]*): Option[Seq[T]]

    Returns a flattened sequence or None.

    Returns a flattened sequence or None.

    T

    generic type.

    els

    Option of type T or None.

    returns

    Option sequence of type T or None.

  41. def sort(sortFields: Seq[Map[String, Any]]): Option[Map[String, Any]]

    Generates sort section of query

    Generates sort section of query

    sortFields

    a sequence of tuples (fieldName: String, descending: Boolean).

    returns

    Map for making Sort queries.

  42. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  43. def template(q: Option[Map[String, Any]], p: Option[Map[String, Any]]): Option[Map[String, Any]]

    Returns a template map for making Template Elastichsearch queries.

    Returns a template map for making Template Elastichsearch queries. ES Template queries use params maps to substitute into the templated query.

    q

    Map representing the templated query operation.

    p

    Map representing the params to substitute into the query.

    returns

    Combined map for making Template queries.

  44. def term(field: String, ts: Any, options: Map[String, Any] = Map.empty): Option[Map[String, Map[String, Any]]]

    Returns a Term map of a field key and values for the search Term Elasticsearch API.

    Returns a Term map of a field key and values for the search Term Elasticsearch API.

    field

    String field name for the term.

    ts

    Any type value to associate with field.

    options

    additional map of term options.

    returns

    Map of term field key and any options.

  45. def terms(field: String, ts: Seq[Any], options: Map[String, Any] = Map.empty): Option[Map[String, Map[String, Any]]]

    Returns a Terms map of a field key and a sequence of values for the search Terms Elasticsearch API.

    Returns a Terms map of a field key and a sequence of values for the search Terms Elasticsearch API.

    field

    String field name for the term.

    ts

    Sequence of values to associate with field.

    options

    additional map of term options.

    returns

    Map of terms field key and any options.

  46. def termsFromLookup(field: String, index: String, typeName: String, id: String, path: String, shouldCacheLookup: Option[Boolean] = None, shouldCacheFilter: Option[Boolean] = None, cacheKey: Option[String] = None, queryName: Option[String] = None): Option[Map[String, Map[String, Any]]]

    Returns a map to run a terms lookup query using the Elasticsearch Terms lookup API.

    Returns a map to run a terms lookup query using the Elasticsearch Terms lookup API. Supports all but the routing field for the Terms lookup mechanism. https://www.elastic.co/guide/en/elasticsearch/reference/1.7/query-dsl-terms-filter.html Also see org.elasticsearch.index.query.TermsFilterParser to see ES's underlying code handling this.

    field

    the document field we are filtering on.

    index

    the index to lookup term values from.

    typeName

    the type of the lookup documents.

    path

    the field path in the lookup index to fetch term values from.

    shouldCacheLookup

    whether or not to cache the lookup of the terms from the index (caching the looked-up values).

    shouldCacheFilter

    whether or not to cache the total filter (the docs matching the filter).

    cacheKey

    the cache key to use for the total filter, useful if you want to manually wipe the cache.

    queryName

    name to give this query. (see https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-named-queries-and-filters.html)

    returns

    Map for a Terms query with ES lookup fields.

  47. def toString(): String

    Definition Classes
    AnyRef → Any
  48. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped