UTF8 encoding is longer than the max length 32766

前端 未结 10 990
鱼传尺愫
鱼传尺愫 2020-11-29 01:39

I\'ve upgraded my Elasticsearch cluster from 1.1 to 1.2 and I have errors when indexing a somewhat big string.

{
  \"error\": \"IllegalArgumentException[Docu         


        
10条回答
  •  天涯浪人
    2020-11-29 02:09

    If you really want not_analyzed on on the property because you want to do some exact filtering then you can use "ignore_above": 256

    Here is an example of how I use it in php:

    'mapping'    => [
        'type'   => 'multi_field',
        'path'   => 'full',
        'fields' => [
            '{name}' => [
                'type'     => 'string',
                'index'    => 'analyzed',
                'analyzer' => 'standard',
            ],
            'raw' => [
                'type'         => 'string',
                'index'        => 'not_analyzed',
                'ignore_above' => 256,
            ],
        ],
    ],
    

    In your case you probably want to do as John Petrone told you and set "index": "no" but for anyone else finding this question after, like me, searching on that Exception then your options are:

    • set "index": "no"
    • set "index": "analyze"
    • set "index": "not_analyzed" and "ignore_above": 256

    It depends on if and how you want to filter on that property.

提交回复
热议问题