dou44481 2018-06-12 13:18
浏览 366

ElasticSearch索引出错

I want to index some data from MongoDB to ElasticSearch but i got a error like below:

{"error":{"root_cause": [{"type":"number_format_exception","reason":"Unable to parse"}],"type":"number_format_exception","reason":"Unable to parse"},"status":400}

All my data are a string and array string on MongoDB and all my Elastic mapping type is text like below :

        'iran_code' => [
            'type' => 'text',
        ],
        'gs1' => [
            'type' => 'text',
        ],
        'international_code' => [
            'type' => 'text',
        ],
        "catalouge_link" => [
            'type' => 'text',
        ],
        "group_name_fa" => [
            'type' => 'text',
        ],
        "group_name_eng" => [
            'type' => 'text',
        ],
        "member_name" => [
            'type' => 'text',
        ],
        "brand" => [
            'type' => 'text',
        ],
        "whole_name_fa" => [
            'type' => 'text',
        ],
        "searchable_whole_name_fa" => [
            'type' => 'text',
            "norms"=>false,
            "term_vector"=> "with_positions_offsets_payloads",
            "analyzer"=> "positionPayloadAnalyzer",
            "similarity"=> "positionSimilarity",
        ],
        'whole_name_eng' => [
            'type' => 'text',
        ],
        'attr_keys' => [
            'type' => 'text',
        ],
        'attr_values' => [
            'type' => 'text',
        ]

Also, I change some data value while indexing to elastic

      $words = explode(' ',$array['whole_name_fa']);
      for($i=0; $i < count($words);$i++){
        $tags[] = $words[$i].'|'.$i;
      }
      $array['searchable_whole_name_fa'] = implode(' ',$tags);

So why the error shows while indexing?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
    • ¥15 lammps拉伸应力应变曲线分析
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
    • ¥30 python代码,帮调试,帮帮忙吧
    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建