From 377eb5b66d3717a5e25c705fa70601cb516fe50a Mon Sep 17 00:00:00 2001 From: Haiyan Meng Date: Fri, 17 Jan 2020 14:53:40 -0800 Subject: [PATCH] Fix the regexp for determining kustomization file --- api/internal/crawl/search_cmds/creationTime.md | 12 ++++++------ api/internal/crawl/search_cmds/fileType.md | 4 ++-- api/internal/crawl/search_cmds/keyword_search.md | 4 ++-- api/internal/crawl/search_cmds/repositoryUrl.md | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api/internal/crawl/search_cmds/creationTime.md b/api/internal/crawl/search_cmds/creationTime.md index 3ebfaf157..e83165efe 100644 --- a/api/internal/crawl/search_cmds/creationTime.md +++ b/api/internal/crawl/search_cmds/creationTime.md @@ -27,7 +27,7 @@ curl -X POST "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'C "query": { "bool": { "filter": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } }, @@ -45,7 +45,7 @@ curl -X POST "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'C "query": { "bool": { "must_not": { - "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" } + "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" } } } }, @@ -94,7 +94,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'Co "query": { "bool": { "filter": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } }, @@ -117,7 +117,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'Co "query": { "bool": { "must_not": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } }, @@ -140,7 +140,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'Co "query": { "bool": { "filter": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } }, @@ -163,7 +163,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'Co "query": { "bool": { "must_not": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } }, diff --git a/api/internal/crawl/search_cmds/fileType.md b/api/internal/crawl/search_cmds/fileType.md index ced952f3e..c5c58357a 100644 --- a/api/internal/crawl/search_cmds/fileType.md +++ b/api/internal/crawl/search_cmds/fileType.md @@ -84,7 +84,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'Co "query": { "bool": { "filter": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } }, @@ -107,7 +107,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'Co "query": { "bool": { "must_not": { - "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" } + "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" } } } }, diff --git a/api/internal/crawl/search_cmds/keyword_search.md b/api/internal/crawl/search_cmds/keyword_search.md index 588f938fb..99a677813 100644 --- a/api/internal/crawl/search_cmds/keyword_search.md +++ b/api/internal/crawl/search_cmds/keyword_search.md @@ -57,7 +57,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?pretty" -H 'Content-T "query": { "bool": { "filter": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } } @@ -73,7 +73,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?pretty" -H 'Content-T "query": { "bool": { "must_not": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } } diff --git a/api/internal/crawl/search_cmds/repositoryUrl.md b/api/internal/crawl/search_cmds/repositoryUrl.md index 291aa1c69..9ce169929 100644 --- a/api/internal/crawl/search_cmds/repositoryUrl.md +++ b/api/internal/crawl/search_cmds/repositoryUrl.md @@ -21,7 +21,7 @@ curl -X POST "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'C "query": { "bool": { "filter": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } }, @@ -44,7 +44,7 @@ curl -X POST "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'C "query": { "bool": { "must_not": { - "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" } + "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" } } } }, @@ -85,7 +85,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'Co "query": { "bool": { "filter": [ - { "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" }} + { "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" }} ] } }, @@ -108,7 +108,7 @@ curl -X GET "${ElasticSearchURL}:9200/${INDEXNAME}/_search?size=0&pretty" -H 'Co "query": { "bool": { "must_not": { - "regexp": { "filePath": ".*/kustomization((.yaml)?|(.yml)?)/*" } + "regexp": { "filePath": "(.*/)?kustomization((.yaml)?|(.yml)?)(/)*" } } } },