分布式搜索引擎ElasticSearch-Elasticsearch6查看分词器效果

之前的es版本是5.x,查看分词器效果可以直接在URL中指定分词器和查询词,方法是GET,如下:

http://localhost:9200/_analyze?analyzer=ik_smart&text=快乐奔跑

现在安装了es6.x,发现用原来的办法报错:

==============
{"error":{"root_cause":[{"type":"parse_exception","reason":"request body or source parameter is required"}],"type":"parse_exception","reason":"request body or source parameter is required"},"status":400}
==================

后来发现,es6.x查看分词效果,可以使用GET或者POST方法,但是分词器和查询词需要以json的形式写在body里。

http://192.168.2.10:9200/_analyze?pretty=true
{
	"analyzer":"chinese",
	"text": "快乐奔跑"
}

分布式搜索引擎ElasticSearch-Elasticsearch6查看分词器效果

相关文章:

  • 2023-03-23
  • 2022-12-23
  • 2021-11-09
  • 2022-01-15
  • 2021-11-08
  • 2021-05-26
猜你喜欢
  • 2021-12-05
  • 2022-01-29
  • 2021-11-07
  • 2022-01-23
  • 2021-09-03
  • 2022-12-23
相关资源
相似解决方案