private String operatorToString(int operator) {
        return switch (operator) {
            case NOP -> null;
            case OR -> "or";
            case AND -> "and";
            default -> throw new IllegalStateException("Logical operator " + operator + " not supported.");
        };
    }
Converts the given operator index to a string representation.

@param operator The operator index to convert.
@return The string representation.
document/src/main/java/com/yahoo/document/select/rule/LogicNode.java