Class FieldNameTranslators

java.lang.Object
org.elasticsearch.xpack.security.support.FieldNameTranslators

public final class FieldNameTranslators extends Object
  • Field Details

    • FLATTENED_METADATA_INDEX_FIELD_NAME

      public static final String FLATTENED_METADATA_INDEX_FIELD_NAME
      See Also:
    • API_KEY_FIELD_NAME_TRANSLATORS

      public static final FieldNameTranslators API_KEY_FIELD_NAME_TRANSLATORS
    • USER_FIELD_NAME_TRANSLATORS

      public static final FieldNameTranslators USER_FIELD_NAME_TRANSLATORS
    • ROLE_FIELD_NAME_TRANSLATORS

      public static final FieldNameTranslators ROLE_FIELD_NAME_TRANSLATORS
  • Method Details

    • translateQueryBuilderFields

      public QueryBuilder translateQueryBuilderFields(QueryBuilder queryBuilder, @Nullable Consumer<String> visitor)
      Deep copies the passed-in translating all the field names, from query level to index level, see translate(java.lang.String). In general, the returned builder should create the same query as if the query were created by the passed in , only with the field names translated. Field name patterns (including "*"), are also replaced with the explicit index level field names whose associated query level field names match the pattern. The optional can be used to collect all the translated field names.
    • translateFieldSortBuilders

      public void translateFieldSortBuilders(List<FieldSortBuilder> fieldSortBuilders, SearchSourceBuilder searchSourceBuilder, @Nullable Consumer<String> visitor)
      Adds the to the , translating the field names, form query level to index level, see translate(java.lang.String). The optional can be used to collect all the translated field names.
    • translate

      public String translate(String queryFieldName)
      Translate the query level field name to index level field names. It throws an exception if the field name is not explicitly allowed.
    • translatePattern

      public Set<String> translatePattern(String fieldNameOrPattern)
      Translates a query level field name pattern to the matching index level field names. The result can be the empty set, if the pattern doesn't match any of the allowed index level field names.
    • isQueryFieldSupported

      public boolean isQueryFieldSupported(String fieldName)
    • isIndexFieldSupported

      public boolean isIndexFieldSupported(String fieldName)