在弹性搜索中基于分隔符标记字符串

时间:2016-07-13 08:51:56

标签: elasticsearch tokenize

我需要使用36-3031.00|36-3021.00分隔符将字符串36-3031.00标记为36-3021.00|

我试过这样,

PUT text
{
   "test1": {
  "settings": {
    "analysis" : {
            "tokenizer" : {
                "pipe_tokenizer" : {
                    "type" : "pattern",
                    "pattern" : "|"
                }
            },
            "analyzer" : {
                "pipe_analyzer" : {
                    "type" : "custom",
                    "tokenizer" : "pipe_tokenizer"
                }
            }
        }
  },
  "mappings": {
    "mytype": {
      "properties": {
        "text": {
          "type": "string",
          "analyzer": "pipe_analyzer"
        }
      }
    }
  }
}}

但它并不准确。任何人都可以理清这个用例吗?

1 个答案:

答案 0 :(得分:1)

以下是您应该使用的正确映射(包括REST PUT命令中的索引名称)。并且<StackPanel> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="Orientation"> <VisualState x:Name="Landscape"/> <VisualState x:Name="Portrait"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <TextBox extensions:FieldValidationExtensions.Format="Numeric" x:Name="TextBox" ScrollViewer.BringIntoViewOnFocusChange="False" DesiredCandidateWindowAlignment="BottomEdge" Header="{TemplateBinding Header}" Margin="0" PlaceholderText="{TemplateBinding PlaceholderText}" Style="{TemplateBinding TextBoxStyle}" Width="{TemplateBinding Width}" Canvas.ZIndex="0"/> <TextBlock Text="{Binding (extensions:FieldValidationExtensions.ValidationMessage), ElementName=TextBox}" Visibility="{Binding (extensions:FieldValidationExtensions.ValidationMessageVisibility), ElementName=TextBox}" /> ... </StackPanel> 字符需要转义:

|