mayya-sharipova commented on code in PR #13562:
URL: https://github.com/apache/lucene/pull/13562#discussion_r1677132855
##########
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:
@romseygeek Thanks for feedback. Very nice to see you again. Addressed in
bdc43c7256da8dc178ec33d307d18d47de80ebeb
##########
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:
Addressed in
bdc43c7256da8dc178ec33d307d18d47de80ebebbdc43c7256da8dc178ec33d307d18d47de80ebeb
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]