在Elasticsearch的“对象类型”属性/字段中应用语言分析器

时间:2019-04-30 17:20:46

标签: elasticsearch

我需要将西班牙语分析器应用于对象类型参数,但它返回错误。我该如何申请?在该字段内是一个JSON对象数组。

谢谢!

$params   = [
        'index' => 'cl',
        'body' => [
          'analysis' => [
            'analyzer' => [
              'spanish' => [
                'type' => 'custom',
                'tokenizer' => 'standard',
                'filter' =>  ['lowercase', 'asciifolding', 'spanish_stop', 'spanish_stemmer']
              ]
            ],
            'filter' => [
              'spanish_stemmer' => [
                'type' => 'stemmer',
                'name' => 'spanish'
              ],
              'spanish_stop' => [
                'type' => 'stop',
                'stopwords' => ['_spanish_', 'del', 'de', 'el', 'ella', 'los', 'los', 'las', 'la', 'a', 'un', 'y']
              ]
            ]
          ],
          'mappings' => [
            'people' => [
              '_all' => ['enabled' => true],
              'properties' => [
                'user_info' => ['type' => 'text', 'analyzer' => 'spanish', 'search_analyzer' => 'spanish'],
                'resumes'   => ['type' => 'object', 'analyzer' => 'spanish', 'search_analyzer' => 'spanish'],
                'resume_details' => ['type' => 'object', 'analyzer' => 'spanish', 'search_analyzer' => 'spanish'],
                'applications'   => ['type' => 'object', 'analyzer' => 'spanish', 'search_analyzer' => 'spanish'],
              ],
            ],
          ],
        ]
      ];

0 个答案:

没有答案
相关问题