Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 弹性搜索:创建标记,标记之间用<;空间>;或“-”;并大于3个字符,同时保留原始字段值_Regex_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch - Fatal编程技术网 elasticsearch,Regex,elasticsearch" /> elasticsearch,Regex,elasticsearch" />

Regex 弹性搜索:创建标记,标记之间用<;空间>;或“-”;并大于3个字符,同时保留原始字段值

Regex 弹性搜索:创建标记,标记之间用<;空间>;或“-”;并大于3个字符,同时保留原始字段值,regex,elasticsearch,Regex,elasticsearch,在我的弹性搜索设置中,我希望创建以“”或“-”分隔且大于3个字符的标记,并且希望保留原始字段值。我相信模式标记器可以工作,但我无法创建正则表达式。 例如:字段值为“这是我的令牌”。预期的令牌是“This”、“token”和“This is my token” 我尝试了下面的索引,但它没有返回原始值 PUT m_index { "settings": { "analysis": { "analyzer": { "default": { "

在我的弹性搜索设置中,我希望创建以“”或“-”分隔且大于3个字符的标记,并且希望保留原始字段值。我相信模式标记器可以工作,但我无法创建正则表达式。 例如:字段值为“这是我的令牌”。预期的令牌是“This”、“token”和“This is my token”

我尝试了下面的索引,但它没有返回原始值

PUT m_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "default": {
          "type": "custom",
          "tokenizer": "my_tokenizer"
        },
        "default_search": {
          "type": "custom",
          "tokenizer": "my_tokenizer"
        }
      },
      "tokenizer": {
        "my_tokenizer": {
          "type": "pattern",
          "pattern": "[^\\s-]{4,}",
          "group": 0
        }
      }
    }
  }
}

请帮我学习正则表达式

你有代码了吗?有什么办法吗?如何?尝试了
“标记器”:{“my_标记器”:{“type”:“pattern”,“pattern”:“[^-\\s]{4,}”,“group”:0}}
?我已经尝试过了……这不会将原始值保留为标记。因此,对于给定的示例,它只会将令牌创建为“This”、“token”,但我也想要“This is my token”。然后请将您尝试的内容添加到问题中,以便其他人不会建议您已经尝试过的内容。谢谢……我已编辑了我的问题。