Class QueryParserHelper

java.lang.Object
org.elasticsearch.index.search.QueryParserHelper

public final class QueryParserHelper
extends java.lang.Object
Helpers to extract and expand field names and boosts
  • Method Summary

    Modifier and Type Method Description
    static boolean hasAllFieldsWildcard​(java.util.Collection<java.lang.String> fields)
    Returns true if any of the fields is the wildcard *, false otherwise.
    static java.util.Map<java.lang.String,​java.lang.Float> parseFieldsAndWeights​(java.util.List<java.lang.String> fields)
    Convert a list of field names encoded with optional boosts to a map that associates the field name and its boost.
    static java.util.Map<java.lang.String,​java.lang.Float> resolveMappingFields​(QueryShardContext context, java.util.Map<java.lang.String,​java.lang.Float> fieldsAndWeights)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parseFieldsAndWeights

      public static java.util.Map<java.lang.String,​java.lang.Float> parseFieldsAndWeights​(java.util.List<java.lang.String> fields)
      Convert a list of field names encoded with optional boosts to a map that associates the field name and its boost.
      Parameters:
      fields - The list of fields encoded with optional boosts (e.g. ^0.35).
      Returns:
      The converted map with field names and associated boosts.
    • resolveMappingFields

      public static java.util.Map<java.lang.String,​java.lang.Float> resolveMappingFields​(QueryShardContext context, java.util.Map<java.lang.String,​java.lang.Float> fieldsAndWeights)
    • hasAllFieldsWildcard

      public static boolean hasAllFieldsWildcard​(java.util.Collection<java.lang.String> fields)
      Returns true if any of the fields is the wildcard *, false otherwise.
      Parameters:
      fields - A collection of field names