黑猴子的家:Elasticsearch 默认中文分词器的效果

针对词条查询(TermQuery),查看默认中文分词器的效果

[victor@hadoop102 elasticsearch]$ curl -XGET \
'http://hadoop102:9200/_analyze?pretty&analyzer=standard' -d '中华人民共和国'
{
  "tokens" : [
    {
      "token" : "中",
      "start_offset" : 0,
      "end_offset" : 1,
      "type" : "",
      "position" : 0
    },
    {
      "token" : "华",
      "start_offset" : 1,
      "end_offset" : 2,
      "type" : "",
      "position" : 1
    },
    {
      "token" : "人",
      "start_offset" : 2,
      "end_offset" : 3,
      "type" : "",
      "position" : 2
    },
    {
      "token" : "民",
      "start_offset" : 3,
      "end_offset" : 4,
      "type" : "",
      "position" : 3
    },
    {
      "token" : "共",
      "start_offset" : 4,
      "end_offset" : 5,
      "type" : "",
      "position" : 4
    },
    {
      "token" : "和",
      "start_offset" : 5,
      "end_offset" : 6,
      "type" : "",
      "position" : 5
    },
    {
      "token" : "国",
      "start_offset" : 6,
      "end_offset" : 7,
      "type" : "",
      "position" : 6
    }
  ]
}

你可能感兴趣的:(黑猴子的家:Elasticsearch 默认中文分词器的效果)