This is an automated email from the ASF dual-hosted git repository.
xiaoyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git
The following commit(s) were added to refs/heads/main by this push:
new daadeb9 [type refactor] add fuzzy match condition rule description.
(#377)
daadeb9 is described below
commit daadeb9fa46bd603d4a370a7895febeb30896ddb
Author: Qicz <[email protected]>
AuthorDate: Wed Nov 24 14:08:07 2021 +0800
[type refactor] add fuzzy match condition rule description. (#377)
---
docs/user-guide/admin-usage/selector-and-rule.md | 8 +++++---
.../current/user-guide/admin-usage/selector-and-rule.md | 6 ++++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/docs/user-guide/admin-usage/selector-and-rule.md
b/docs/user-guide/admin-usage/selector-and-rule.md
index 48e9b5d..6b75b9b 100644
--- a/docs/user-guide/admin-usage/selector-and-rule.md
+++ b/docs/user-guide/admin-usage/selector-and-rule.md
@@ -54,10 +54,12 @@ For example, add a selector to the `divide` plugin:
* Enable: whether to enable the plugin.
* Order:the smaller will have high priorty to execute among multi-selectors.
* Handler: The operation when the request matches the selector.
-
* the above picture means: when the prefix of the request uri is `/http`, it
will redirect to this service `127.0.0.1:8080`.
-
* selector advice : combine `uri` conditon and `match` prefix(/contextPath)as
the first request filter.
+* selector(the same for rule) match condition fuzzy string matching rule:
+ * `?` matches one character
+ * `*` matches zero or more characters
+ * `**` matches zero or more directories in a path
## Rule
@@ -158,7 +160,7 @@ In `ShenYu` you can set different conditional parameters to
get real data from t
* `uri`(recommended)
* `uri` matches are based on the `uri` in the path you requested, and there
is almost no change in the front end when accessing the gateway.
-
+
* When using `match`, the principle is the same as `SpringMVC` fuzzy
matching.
* In selectors, it is recommended to use prefixes in `URI` for matching,
while in rules, specific paths are used for matching.
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/admin-usage/selector-and-rule.md
b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/admin-usage/selector-and-rule.md
index b5d8728..c6a5116 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/admin-usage/selector-and-rule.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/admin-usage/selector-and-rule.md
@@ -48,10 +48,12 @@ description: 选择器和规则管理
* 打印日志:打开时,当匹配上的时候,会打印匹配日志。
* 执行顺序:当多个选择器的时候,执行顺序小的优先执行,值越小优先级越高。
* 处理:即`handle`字段,在 [插件处理管理](./plugin-handle-explanation)
中进行设置。作用是:当请求流量匹配上该选择器时,做什么样的处理操作。
-
* 上述图片中表示: 当请求的 `uri` 前缀是 `/http`,会转发到 `127.0.0.1:8080` 这个服务上。
-
* 选择器建议:可以通过设置 `uri` 条件, `match` 前缀(`/contextPath`)匹配,进行第一道流量筛选。
+* 选择器(同规则)模糊匹配条件规则:
+ * `?` 匹配1个字符
+ * `*` 匹配0个或多个字符
+ * `**` 匹配0个或多个目录
## 规则