【发布时间】:2015-02-09 04:38:18
【问题描述】:
在我正在构建的索引中,我有兴趣运行一个查询,然后(使用构面)返回该查询的 shingles。这是我在文本中使用的分析器:
{
"settings": {
"analysis": {
"analyzer": {
"shingleAnalyzer": {
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
"custom_stop",
"custom_shingle",
"custom_stemmer"
]
}
},
"filter": {
"custom_stemmer" : {
"type": "stemmer",
"name": "english"
},
"custom_stop": {
"type": "stop",
"stopwords": "_english_"
},
"custom_shingle": {
"type": "shingle",
"min_shingle_size": "2",
"max_shingle_size": "3"
}
}
}
}
}
主要问题是,在 Lucene 4.4 中,停止过滤器不再支持 enable_position_increments 参数来消除包含停止词的带状疱疹。相反,我会得到类似的结果..
“红黄相间”
"terms": [
{
"term": "red",
"count": 43
},
{
"term": "red _",
"count": 43
},
{
"term": "red _ yellow",
"count": 43
},
{
"term": "_ yellow",
"count": 42
},
{
"term": "yellow",
"count": 42
}
]
这自然会极大地扭曲返回的带状疱疹数量。 Lucene 4.4 后有没有办法在不对结果进行后处理的情况下管理这个问题?
【问题讨论】:
-
你找到解决这个问题的方法了吗?
标签: elasticsearch lucene stop-words