Signed-off-by: Zhang Yuhang zhangyuhang25@huawei.com --- src/lib/web_backend.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/web_backend.rb b/src/lib/web_backend.rb index 48cfadb..fda01ca 100644 --- a/src/lib/web_backend.rb +++ b/src/lib/web_backend.rb @@ -47,7 +47,7 @@ end def filter_tbox_group(es_result) result = Set.new es_result.each do |r| - if r =~ /(^.+--.+$)|(^vm-.*-\d\w*-([a-zA-Z]+)|(\d+)$)/ + if r =~ /(^.+--.+$)|(^vm-.*-\d\w*-(([a-zA-Z]+)|(\d+))$)/ index = r.index('--') || r.rindex('-') r = r[0, index] end
On Tue, Oct 20, 2020 at 09:39:32AM +0800, Zhang Yuhang wrote:
Signed-off-by: Zhang Yuhang zhangyuhang25@huawei.com
src/lib/web_backend.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/web_backend.rb b/src/lib/web_backend.rb index 48cfadb..fda01ca 100644 --- a/src/lib/web_backend.rb +++ b/src/lib/web_backend.rb @@ -47,7 +47,7 @@ end def filter_tbox_group(es_result) result = Set.new es_result.each do |r|
- if r =~ /(^.+--.+$)|(^vm-.*-\d\w*-([a-zA-Z]+)|(\d+)$)/
- if r =~ /(^.+--.+$)|(^vm-.*-\d\w*-(([a-zA-Z]+)|(\d+))$)/
we should also consider tbox_group like: dc-1g--taishan200-2288-2s48p-256g--a52
after intercept tbox_group, a tobx: vm-hi1620-2p8g--taishan200-2288-2s48p-256g--a52 => vm-hi1620-2p8g, but we saved tbox_group in ES DB like: tbox_group: vm-hi1620-2p8g--taishan200-2288-2s48p-256g--a52 1. how to use them to search job in ES DB? - use "vm-hi1620-2p8g" to match_all in ES 2. how to use them auto group in compare? - how about ignore --XXX end of tbox_group when search and auto group like: vm-hi1620-2p8g--taishan200-2288-2s48p-256g--a1 => vm-hi1620-2p8g vm-hi1620-2p8g--taishan200-2288-2s48p-256g--a2 => vm-hi1620-2p8g we treat both tbox_group as vm-hi1620-2p8g we need discuss
Thanks, Weitao
index = r.index('--') || r.rindex('-') r = r[0, index] end
-- 2.23.0
On Tue, Oct 20, 2020 at 11:45:13AM +0800, Lu Weitao wrote:
On Tue, Oct 20, 2020 at 09:39:32AM +0800, Zhang Yuhang wrote:
Signed-off-by: Zhang Yuhang zhangyuhang25@huawei.com
src/lib/web_backend.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/web_backend.rb b/src/lib/web_backend.rb index 48cfadb..fda01ca 100644 --- a/src/lib/web_backend.rb +++ b/src/lib/web_backend.rb @@ -47,7 +47,7 @@ end def filter_tbox_group(es_result) result = Set.new es_result.each do |r|
- if r =~ /(^.+--.+$)|(^vm-.*-\d\w*-([a-zA-Z]+)|(\d+)$)/
- if r =~ /(^.+--.+$)|(^vm-.*-\d\w*-(([a-zA-Z]+)|(\d+))$)/
we should also consider tbox_group like: dc-1g--taishan200-2288-2s48p-256g--a52
after intercept tbox_group, a tobx: vm-hi1620-2p8g--taishan200-2288-2s48p-256g--a52 => vm-hi1620-2p8g, but we saved tbox_group in ES DB like: tbox_group: vm-hi1620-2p8g--taishan200-2288-2s48p-256g--a52
- how to use them to search job in ES DB?
- use "vm-hi1620-2p8g" to match_all in ES
- how to use them auto group in compare?
- how about ignore --XXX end of tbox_group when search and auto group like: vm-hi1620-2p8g--taishan200-2288-2s48p-256g--a1 => vm-hi1620-2p8g vm-hi1620-2p8g--taishan200-2288-2s48p-256g--a2 => vm-hi1620-2p8g we treat both tbox_group as vm-hi1620-2p8g
we need discuss
Thanks, Weitao
OK.
Thanks, Zhang Yuhang
index = r.index('--') || r.rindex('-') r = r[0, index] end
-- 2.23.0