romseygeek commented on code in PR #13562: URL: https://github.com/apache/lucene/pull/13562#discussion_r1674172561
########## lucene/queries/src/java/org/apache/lucene/queries/intervals/Intervals.java: ########## @@ -206,6 +210,91 @@ public static IntervalsSource wildcard(BytesRef wildcard, int maxExpansions) { return new MultiTermIntervalsSource(ca, maxExpansions, wildcard.utf8ToString()); } + /** + * Return an {@link IntervalsSource} over the disjunction of all terms that match a regular + * expression + * + * <p>WARNING: Setting {@code maxExpansions} to higher than the default value of {@link Review Comment: This line doesn't need to be on this method ########## lucene/queries/src/java/org/apache/lucene/queries/intervals/Intervals.java: ########## @@ -206,6 +210,91 @@ public static IntervalsSource wildcard(BytesRef wildcard, int maxExpansions) { return new MultiTermIntervalsSource(ca, maxExpansions, wildcard.utf8ToString()); } + /** + * Return an {@link IntervalsSource} over the disjunction of all terms that match a regular + * expression + * + * <p>WARNING: Setting {@code maxExpansions} to higher than the default value of {@link + * #DEFAULT_MAX_EXPANSIONS} can be both slow and memory-intensive + * + * @param regexp regula expression + * @throws IllegalStateException if the regex expands to more than {@link #DEFAULT_MAX_EXPANSIONS} + * terms + * @see RegexpQuery for regexp format + */ + public static IntervalsSource regexp(BytesRef regexp) { + return regexp(regexp, DEFAULT_MAX_EXPANSIONS); + } + + /** + * Expert: Return an {@link IntervalsSource} over the disjunction of all terms that match a + * regular expression + * + * <p>WARNING: Setting {@code maxExpansions} to higher than the default value of {@link + * #DEFAULT_MAX_EXPANSIONS} can be both slow and memory-intensive + * + * @param regexp regula expression Review Comment: ```suggestion * @param regexp regular expression ``` ########## lucene/queries/src/java/org/apache/lucene/queries/intervals/Intervals.java: ########## @@ -206,6 +210,91 @@ public static IntervalsSource wildcard(BytesRef wildcard, int maxExpansions) { return new MultiTermIntervalsSource(ca, maxExpansions, wildcard.utf8ToString()); } + /** + * Return an {@link IntervalsSource} over the disjunction of all terms that match a regular + * expression + * + * <p>WARNING: Setting {@code maxExpansions} to higher than the default value of {@link + * #DEFAULT_MAX_EXPANSIONS} can be both slow and memory-intensive + * + * @param regexp regula expression Review Comment: ```suggestion * @param regexp regular expression ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org