ElasticSearch在某些字段上无法搜索

时间:2020-02-10 13:12:00

标签: elasticsearch

这是我的示例文档

{
  "_index": "my_index_log",
  "_type": "_doc",
  "_id": "50688-63-22-null",
  "_version": 56,
  "_score": 1,
  "_source": {
    "documentId": "50688-63-22-null",
    "primaryId": 50688,
    "cId": 63,
    "oI": 63,
    "code": "22",
    "errorCount": 56,
    "firstSeenAt": 1577420695319,
    "lastSeenAt": 1581339916000
  }
}

当我在primaryIdcId上搜索Kibana时,它工作正常,没有任何问题。但是,当我搜索errorCountfirstSeenAtlastSeenAt时,搜索不会完全匹配。

此外,请注意,只要看到错误消息,errorCountlastSeenAt就会更新。

搜索不起作用的原因是什么?

编辑:输出GET my_index_log/_mappings

{
    "my_index_log": {
        "mappings": {
            "_doc": {
                "properties": {
                    "cId": {
                        "type": "long"
                    },
                    "documentId": {
                        "type": "text",
                        "fields": {
                            "keyword": {
                                "type": "keyword",
                                "ignore_above": 256
                            }
                        }
                    },
                    "errorCount": {
                        "type": "long"
                    },
                    "errorType": {
                        "type": "text",
                        "fields": {
                            "keyword": {
                                "type": "keyword",
                                "ignore_above": 256
                            }
                        }
                    },
                    "firstSeenAt": {
                        "type": "long"
                    },
                    "primaryId": {
                        "type": "long"
                    },
                    "lastSeenAt": {
                        "type": "long"
                    },
                    "oI": {
                        "type": "long"
                    }
                }
            }
        }
    }
}

0 个答案:

没有答案