Search in sources :

Example 1 with RegexpFlag

use of org.elasticsearch.index.query.RegexpFlag in project elasticsearch by elastic.

the class RegexOptionsTests method randomRegexOptions.

public static RegexOptions randomRegexOptions() {
    final RegexOptions.Builder builder = RegexOptions.builder();
    maybeSet(builder::setMaxDeterminizedStates, randomIntBetween(1, 1000));
    StringBuilder sb = new StringBuilder();
    for (RegexpFlag regexpFlag : RegexpFlag.values()) {
        if (randomBoolean()) {
            if (sb.length() != 0) {
                sb.append("|");
            }
            sb.append(regexpFlag.name());
        }
    }
    maybeSet(builder::setFlags, sb.toString());
    return builder.build();
}
Also used : RegexpFlag(org.elasticsearch.index.query.RegexpFlag)

Aggregations

RegexpFlag (org.elasticsearch.index.query.RegexpFlag)1