我需要将西班牙语分析器应用于对象类型参数,但它返回错误。我该如何申请?在该字段内是一个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'],
],
],
],
]
];