我有一个website
字段的文档索引在弹性搜索。示例值:http://example.com。问题是,当我搜索example
时,文档不包括在内。如何正确地映射网站/网址字段?在弹性搜索索引网站/ url
我创建了以下指标:我猜你正在使用standard
分析仪,它分裂成http://example.dom
两个记号
{
"settings":{
"index":{
"analysis":{
"analyzer":{
"analyzer_html":{
"type":"custom",
"tokenizer": "standard",
"filter":"standard",
"char_filter": "html_strip"
}
}
}
}
},
"mapping":{
"blogshops": {
"properties": {
"category": {
"properties": {
"name": {
"type": "string"
}
}
},
"reviews": {
"properties": {
"user": {
"properties": {
"_id": {
"type": "string"
}
}
}
}
}
}
}
}
}
感谢@vhyza。我更新了如何创建索引的问题。我有一个嵌套的属性,并希望剥离HTML。 –
不客气。嵌套属性应该没问题。如果需要,您可以在'lowercase_with_stopwords'中添加'char_filter'来去除html。 – vhyza