Elasticsearch获取id不起作用

Elasticsearch获取id不起作用

本文介绍了Elasticsearch获取id不起作用,但文档存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在弹性搜索1.2.0(最近从1.0.1升级)中看到有ids的奇怪行为。

I'm seeing weird behaviours with ids on elasticsearch 1.2.0 (recently upgraded from 1.0.1).

搜索检索我的文档,显示正确的值对于_id:

A search retrieves my document, showing the correct value for _id:

[终端]

curl 'myServer:9200/global/_search?q=someField:something

结果是

{
  "took": 79,
  "timed_out": false,
  "_shards": {
    "total": 12,
    "successful": 12,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 17.715034,
    "hits": [
      {
        "_index": "global",
        "_type": "user",
        "_id": "7a113e4f-44de-3b2b-a3f1-fb881da1b00a",
        ...
      }
    ]
  }
}

但是直接查找id不会:

[terminal]

But a direct lookup on id doesn't:
[terminal]

curl 'myServer:9200/global/user/7a113e4f-44de-3b2b-a3f1-fb881da1b00a'

结果是

{
  "_index": "global",
  "_type": "user",
  "_id": "7a113e4f-44de-3b2b-a3f1-fb881da1b00a",
  "found": false
}

似乎这是以前已经更新的文档使用自定义脚本。

It seems that this is on documents that have previously been updated using custom scripting.

任何想法?

推荐答案

我认为你应该升级到1.2 .1
由于发行说明()有一些问题,特别是在get:

I think you should upgrade to 1.2.1Due to release notes (http://www.elasticsearch.org/blog/elasticsearch-1-2-1-released/) there are some problems, especially with get:

`有一个Elasticsearch 1.2.0中的路由错误可能会对群集造成一些不良的副作用。可能的副作用包括:

`There was a routing bug in Elasticsearch 1.2.0 that could have a number of bad side effects on the cluster. Possible side effects include:

在升级到1.2.0之前被索引的文档可能无法通过get访问。搜索将找到这些文档,但不能直接获取ID.文件。

documents that were indexed prior to the upgrade to 1.2.0 may not be accessible via get. A search would find these documents, but not a direct get of the document by ID.`

这篇关于Elasticsearch获取id不起作用,但文档存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 01:48