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 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器