Class QueryParserHelper

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

public final class QueryParserHelper extends Object
Helpers to extract and expand field names and boosts
  • Method Details

    • parseFieldsAndWeights

      public static Map<String,Float> parseFieldsAndWeights(List<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 Map<String,Float> resolveMappingFields(SearchExecutionContext context, Map<String,Float> fieldsAndWeights)
    • hasAllFieldsWildcard

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