Class MinimizationOperations

java.lang.Object
org.elasticsearch.lucene.util.automaton.MinimizationOperations

public final class MinimizationOperations extends Object
Operations for minimizing automata.

Lucene 10 removed minimization, but Elasticsearch still requires it. Minimization is critical in the security codebase to reduce the heap usage of automata used for permission checks.

Copied of Lucene's AutomatonTestUtil

  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.lucene.util.automaton.Automaton
    minimize(org.apache.lucene.util.automaton.Automaton a, int determinizeWorkLimit)
    Minimizes (and determinizes if not already deterministic) the given automaton using Hopcroft's algorithm.

    Methods inherited from class java.lang.Object

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

    • minimize

      public static org.apache.lucene.util.automaton.Automaton minimize(org.apache.lucene.util.automaton.Automaton a, int determinizeWorkLimit)
      Minimizes (and determinizes if not already deterministic) the given automaton using Hopcroft's algorithm.
      Parameters:
      determinizeWorkLimit - maximum effort to spend determinizing the automaton. Set higher to allow more complex queries and lower to prevent memory exhaustion. Use Operations.DEFAULT_DETERMINIZE_WORK_LIMIT as a decent default if you don't otherwise know what to specify.