File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
main/groovy/org/elasticsearch/gradle/doc
test/groovy/org/elasticsearch/gradle/doc Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,11 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
4141
4242 /**
4343 * Doc write operations start with an index name that cannot
44- * start with -, _ or + and must be lower case.
44+ * start with -, _ or + and must be lower case and are followed
45+ * by the doc type or doc Id. If the 2nd part of the path
46+ * (after the '/') starts with a '_' then it is an API call.
4547 */
46- private static final Pattern DOCS_WRITE_OP_PATTERN = Pattern . compile(" ^[^_\\ -\\ +][a-z_-]+/" );
48+ private static final Pattern DOCS_WRITE_OP_PATTERN = Pattern . compile(" ^[^_\\ -\\ +][a-z_-]+/[^_] " );
4749
4850 @Input
4951 Map<String , String > setups = new HashMap ()
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class RestTestFromSnippetsTaskTest extends GroovyTestCase {
4949 void testIsDocWriteRequest () {
5050 assertTrue (isDocWriteRequest(" doc-index/doc_id" ));
5151 assertTrue (isDocWriteRequest(" doc_index/doc_type/doc_id" ));
52- assertFalse (isDocWriteRequest(" doc_index" ))
52+ assertFalse (isDocWriteRequest(" doc_index/_search " ))
5353 assertFalse (isDocWriteRequest(" _xpack/ml/datafeeds/datafeed-id/_preview" ));
5454 }
5555}
You can’t perform that action at this time.
0 commit comments