elasticsearch,sense,Php,elasticsearch,Sense" /> elasticsearch,sense,Php,elasticsearch,Sense" />

Php ElasticSearch字段显示为坏字符串,搜索时出错

Php ElasticSearch字段显示为坏字符串,搜索时出错,php,elasticsearch,sense,Php,elasticsearch,Sense,我对elasticsearch中的数据有一个问题,基本上我需要存储拥有下面文档的userID,如果我查看数据时感觉到userID字段上出现了“坏字符串”错误,我可以搜索除userID之外的任何内容 发生什么事了 {"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":3,"max_score":1.0,"hits":[{"_index":"pheme","_typ

我对elasticsearch中的数据有一个问题,基本上我需要存储拥有下面文档的userID,如果我查看数据时感觉到userID字段上出现了“坏字符串”错误,我可以搜索除userID之外的任何内容

发生什么事了

   {"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":3,"max_score":1.0,"hits":[{"_index":"pheme","_type":"searches","_id":"AU__X0W7bLxGTuBqZB_E","_score":1.0,"_source":{
      userID: "AU__X0W7bLxGTuBqZB_E", **<---- This shows as bad string in Sense**
      mustHave: "Laravel",
      notHave: "Moogle",
      couldHave: "AngularJS",
      exclusions: {
        ID : ""
      }
    }
    },{"_index":"pheme","_type":"searches","_id":"AU__ZNA0bLxGTuBqZCCn","_score":0.30685282,"_source":{
      userID: "AU__X0W7bLxGTuBqZB_E",
      mustHave: "Laravel",
      notHave: "Moogle",
      couldHave: "AngularJS",
      exclusions: {
        ID : ""
      }
    }
    },{"_index":"pheme","_type":"searches","_id":"AVAJl5OZbMFoS2ut2YM9","_score":0.30685282,"_source":{
          userID: "AU__X0W7bLxGTuBqZB_E",
          mustHave: "Laravel",
          notHave: "Moogle",
          couldHave: "AngularJS",
          exclusions: {
            ID : ""
          }
        }
        }]}}
{“take”:1,“timed_out”:false,“_shards”:{“total”:5,“successful”:5,“failed”:0},“hits”:{“total”:3,“max_score”:1.0,“hits”:[{“_index”:“pheme”,“_type”:“search”,“_id”:“AU_uuuuuuuuuuuuuuux0w7blxgtubqzb_E”,“_score”:1.0,“u source{

userID:“AU_uuux0w7blxgtubqzb_E”,***好的,如果您注意到在我的示例中,上面的字段名缺少周围的引号,那么问题在于数据的创建方式:

  {"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":3,"max_score":1.0,"hits":[{"_index":"pheme","_type":"searches","_id":"AU__X0W7bLxGTuBqZB_E","_score":1.0,"_source":{
      userID: "AU__X0W7bLxGTuBqZB_E", **<---- This shows as bad string in Sense**
      mustHave: "Laravel",
      notHave: "Moogle",
      couldHave: "AngularJS",
      exclusions: {
        ID : ""
      }
    }
    }
{“take”:1,“timed_out”:false,“_shards”:{“total”:5,“successful”:5,“failed”:0},“hits”:{“total”:3,“max_score”:1.0,“hits”:[{“_index”:“pheme”,“_type”:“search”,“_id”:“AU_uuuuuuuuuuuuuuux0w7blxgtubqzb_E”,“_score”:1.0,“u source{
用户标识:“AU_uux0w7blxgtubqzb_E”**
 {"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":3,"max_score":1.0,"hits":[{"_index":"pheme","_type":"searches","_id":"AU__X0W7bLxGTuBqZB_E","_score":1.0,"_source":{
      "userID": "AU__X0W7bLxGTuBqZB_E", **<---- This shows as bad string in Sense**
      "mustHave": "Laravel",
      "notHave": "Moogle",
      "couldHave": "AngularJS",
      "exclusions": {
        "ID" : ""
      }
    }
    }