使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。

ES6.4 Pattern Analyzer 逗号分词无法匹配数据

Elasticsearch | 作者 Jasonbian | 发布于2021年05月31日 | 阅读数:1521

创建mapping:
PUT /test
{
  "settings": {
    "refresh_interval": "5s",
    "number_of_shards": 5,
    "number_of_replicas": 1,
    "analysis": {
      "tokenizer": {
        "comma": {
          "type": "pattern",
          "pattern": ","
        }
      },
      "analyzer": {
        "comma": {
          "tokenizer": "comma"
        }
      }
    }
  },
  "mapping": {
    "test": {
      "properties": {
        "channel": {
          "type": "text",
          "analyzer": "comma",
          "search_analyzer": "comma"
        }
      }
    }
  }
}
 
插入数据:
POST /test/test/1
{
  "channel": "1001,1002,1003"
}
 
查询数据
POST /test/test/_search
{
  "query": {
    "match": {
      "channel": "1001"
    }
  }
}
已邀请:

要回复问题请先登录注册