有时候需要核对分词器是否工作良好,可以使用Indices APIs的Analyze来分析。
官方API示例:
GET _analyze
{
"tokenizer" : "keyword",
"filter" : ["lowercase"],
"text" : "this is a test"
}
Yii的PHP中示例:
/*
* 分析器查看用例 文本是如何被分析的
$params = [
'index' => $this->commonIndex,
'analyzer' => 'number_zh_index_analyzer2',
'text' => '英雄联盟最强王者23'
];
echo json_encode($this->client->indices()->analyze($params));die();
*/
相关资料:
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html
https://blog.csdn.net/xifeijian/article/details/51201966
如您从本文得到了有价值的信息或帮助,请考虑扫描文末的二维码对我进行赞赏和鼓励。
如本文对您有用,您的捐赠和留言将是我最好的支持~
如您愿意,请向更多志同道合的朋友们推荐本站,谢谢。
请尊重他人劳动成果。
转载请务必附上原文链接,我将感激不尽。
有什么问题可以 留言或QQ联系我
留言