Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义英文分词不行额,不知道怎么设置呀,头大 #1007

Open
chunpat opened this issue May 18, 2023 · 2 comments
Open

自定义英文分词不行额,不知道怎么设置呀,头大 #1007

chunpat opened this issue May 18, 2023 · 2 comments

Comments

@chunpat
Copy link

chunpat commented May 18, 2023

环境 linux 版本elasticsearch-7.17.7

自定义

vim elasticsearch-7.17.7/config/analysis-ik/main1.dic

OPPO
VIVO
中国
阿
西
吧

analyze

curl -XGET "http://localhost:9200/model/_analyze" -H 'Content-Type: application/json;charset=utf-8' -d'
{
"text": "中国阿西吧OPPOVIVO",
"analyzer": "ik_smart"
}'

{
	"tokens": [{
		"token": "中国",
		"start_offset": 0,
		"end_offset": 2,
		"type": "CN_WORD",
		"position": 0
	}, {
		"token": "阿",
		"start_offset": 2,
		"end_offset": 3,
		"type": "CN_WORD",
		"position": 1
	}, {
		"token": "西",
		"start_offset": 3,
		"end_offset": 4,
		"type": "CN_WORD",
		"position": 2
	}, {
		"token": "吧",
		"start_offset": 4,
		"end_offset": 5,
		"type": "CN_WORD",
		"position": 3
	}, {
		"token": "oppovivo",
		"start_offset": 5,
		"end_offset": 13,
		"type": "ENGLISH",
		"position": 4
	}]
}

英文不生效,不知道怎么弄,请求大佬们啊

@levylll
Copy link

levylll commented Mar 4, 2024

同求这种case怎么处理

@AriesYB
Copy link

AriesYB commented May 1, 2024

楼主解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants