Elasticsearch:字段"title"被索引而没有位置数据; 无法运行PhraseQuery

fle*_*ext 7 elasticsearch

我在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

fle*_*ext 4

以防万一其他人也有同样的问题。同一索引中还有另一个类型/表 (feed2),其相同的“标题”字段设置为“not_analyzed”。

由于某种原因,即使您指定类型:http://elasticsearchhost.com:9200 /index_name/feed/_search,仍然会搜索其他类型。更改 feed2 类型的映射解决了该问题。