Class ContextUtils

java.lang.Object
org.opensearch.search.pipeline.common.helpers.ContextUtils

public final class ContextUtils extends Object
Helpers for working with request-scoped context.
  • Field Details

    • CONTEXT_PREFIX_PARAMETER

      public static final String CONTEXT_PREFIX_PARAMETER
      Parameter that can be passed to a stateful processor to avoid collisions between contextual variables by prefixing them with distinct qualifiers.
      See Also:
  • Method Details

    • applyContextPrefix

      public static String applyContextPrefix(String contextPrefix, String variableName)
      Replaces a "global" variable name with one scoped to a given context prefix (unless prefix is null or empty).
      Parameters:
      contextPrefix - the prefix qualifier for the variable
      variableName - the generic "global" form of the context variable
      Returns:
      the variableName prefixed with contextPrefix followed by ".", or just variableName if contextPrefix is null or empty