Ich möchte einen globalen Analyzer für jeden Index in Elasticsearch festlegen.Elasticsearch analyzer config
Diese Zeilen in elasticsearch.yaml hinzugefügt werden:
index.analysis.analyzer.ik.type: ik
index.analysis.analyzer.default.type: ik
index.analysis.analyzer.standard.type: ik
Nach Elasticsearch Neustart werden diese Linien in http://localhost:9200/_nodes/settings
index: {
analysis: {
analyzer: {
standard: {
type: "ik"
},
default: {
type: "ik"
},
ik: {
type: "ik"
}
}
}
}
gezeigt Dann habe ich mit url getestet http://localhost:9200/_analyze?text= 时间 & Analysator = ik
{
tokens: [
{
token: "时间",
start_offset: 0,
end_offset: 2,
type: "CN_WORD",
position: 0
}
]
}
Es zeigt an, dass der IKAnalyzer aktiviert ist. Wenn es jedoch darum geht, http://localhost:9200/_analyze?text=时间&analyzer=standard oder http://localhost:9200/_analyze?text= 时间, die „Standard“ Analyseergebnisse werden zurückgegeben:
{
tokens: [
{
token: "时",
start_offset: 0,
end_offset: 1,
type: "<IDEOGRAPHIC>",
position: 0
},
{
token: "间",
start_offset: 1,
end_offset: 2,
type: "<IDEOGRAPHIC>",
position: 1
}
]
}
Also, was soll ich tun?