我在ElasticSearch中有一个索引,其中包含以下映射:
mappings: {
feed: {
properties: {
html_url: {
index: not_analyzed
omit_norms: true
index_options: docs
type: string
}
title: {
index_options: offsets
type: string
}
created: {
store: true
format: yyyy-MM-dd HH:mm:ss
type: date
}
description: {
type: string
}
}
}
Run Code Online (Sandbox Code Playgroud)
执行短语搜索时出现以下错误("视频游戏"):
IllegalStateException [field \"title \"索引没有位置数据; 无法运行PhraseQuery(term = video)];
单字搜索工作正常.尝试了"index_options:position",但没有运气.标题字段包含多种语言的文本,有时为空.有趣的是,它似乎随机失败,例如,它将使用相同的数据集失败200K文档或800K.是否有一些理由不会将某些头衔编入索引?
弹性搜索版本0.90.5
我们有一个双节点集群(私有云中的VM,64GB内存,每个节点8个核心CPU,CentOS),一些小索引(~1万个文档)和一个带有~220万个文档的大索引(2个分片,170GB)空间).24GB内存分配给每个盒子上的弹性搜索.
文件结构:
{
'article_id': {
'index': 'not_analyzed',
'store': 'yes',
'type': 'long'
},
'feed_id': {
'index': 'not_analyzed',
'store': 'yes',
'type': 'string'
},
'title': {
'index': 'analyzed',
'type': 'string'
},
'content': {
'index': 'analyzed',
'type': 'string'
},
'lang': {
'index': 'not_analyzed',
'type': 'string'
}
}
Run Code Online (Sandbox Code Playgroud)
运行以下查询大约需要1-2秒:
{
"query" : {
"multi_match" : {
"query" : "some search term",
"fields" : [ "title", "content" ],
"type": "phrase_prefix"
}
},
"size": 20,
"fields" :["article_id", "feed_id"]
}
Run Code Online (Sandbox Code Playgroud)
我们此时是否达到了硬件限制,还是有办法优化查询或数据结构以提高性能?
提前致谢!