如何在Elasticsearch中加载数据?

时间:2019-06-17 08:33:09

标签: elasticsearch

我创建了一个字典,当我尝试在ES中加载数据时出现此错误, 请有人可以解释什么是错误吗?

var Calculator = {
  x: undefined,
  y: undefined,
  addition: function() {
    var result = this.x + this.y;
    return result;
  },
  division: function() {
    var result = this.x / this.y;
    return result;
  },
  multiplication: function() {
    var result = this.x * this.y;
    return result;
  },
  subtraction: function() {
    var result = this.x - this.y;
    return result;
  },
  calulation: function() {
    var mathSign;
    this.x = +prompt('Please insert a first number: ');
    this.y = +prompt('Please enter a second number: ');
    if (isNaN(this.x) || isNaN(this.y)) {
      alert('Please insert a number!');
      this.x = +prompt('Please insert a first number: ');
      this.y = +prompt('Please enter a second number: ');
    }
    mathSign = prompt('Please enter a math symbol: (+, -, *, /)');
    if (mathSign == '+' || mathSign == '-' || mathSign == '*' || mathSign == '/') {
      switch (mathSign) {
        case '+':
          this.addition();
        case '-':
          this.subtraction();
        case '*':
          this.multiplication();
        case '/':
          this.division();
      }
    } else {
      alert('An input should be a math symbol! (+, -, *, /)')
    }
  }
}

console.log(Calculator.calulation());

错误:

    final_adress = {}
      for i in DF['adress'].unique():
        final_adress[i] = [{"service": DF.service[j], "Number of person": DF.num_person[j], "Number of rooms": DF.num_room[j]} for j in DF[DF.adress==i].index]
      print final_adress
es = Elasticsearch([ipES])
es.index(index="*****, doc_type='timeWindow', body=final_adress)
except Exception as e:
  logFile.write("Can't load data into ElasticSearch: {}\n".format(str(e)))

有时会出现错误:

Can't load data into ElasticSearch: RequestError(400, u'mapper_parsing_exception', u"failed to parse field [adresse.01.15.22] of type [long] in document with id 'z4ibZGsBFBLhne6XSvuE'")
    'postecode'

0 个答案:

没有答案