Skip to content
Snippets Groups Projects
Commit f615fc8e authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix : Erreur ElasticSearch (problème de compatibilité dans le mapping des champs)

parent d5e5838e
No related branches found
No related tags found
No related merge requests found
Pipeline #23478 passed
...@@ -265,77 +265,77 @@ class OrganizationElasticSearch implements OrganizationSearchStrategy ...@@ -265,77 +265,77 @@ class OrganizationElasticSearch implements OrganizationSearchStrategy
} catch (\Exception $e) { } catch (\Exception $e) {
throw $e; throw $e;
} }
//
try { // try {
$this->getClient()->indices()->create( // $this->getClient()->indices()->create(
[ // [
'index' => $this->getIndex(), // 'index' => $this->getIndex(),
'body' => [ // 'body' => [
'settings' => [ // 'settings' => [
'analysis' => [ // 'analysis' => [
'analyzer' => [ // 'analyzer' => [
'noaccent' => [ // 'noaccent' => [
"type" => "custom", // "type" => "custom",
"tokenizer" => "standard", // "tokenizer" => "standard",
"filter" => ['asciifolding', "lowercase"] // "filter" => ['asciifolding', "lowercase"]
] // ]
], // ],
] // ]
], // ],
'mappings' => [ // 'mappings' => [
"organization" => [ // "organization" => [
'properties' => [ // 'properties' => [
'code' => [ // 'code' => [
'type' => 'keyword', // 'type' => 'keyword',
], // ],
'shortname' => [ // 'shortname' => [
'type' => 'text', // 'type' => 'text',
// 'analyzer' => 'noaccent' //// 'analyzer' => 'noaccent'
], // ],
'fullname' => [ // 'fullname' => [
// 'analyzer' => 'noaccent', //// 'analyzer' => 'noaccent',
'type' => 'text', // 'type' => 'text',
], // ],
'description' => [ // 'description' => [
// 'analyzer' => 'noaccent', //// 'analyzer' => 'noaccent',
'type' => 'text', // 'type' => 'text',
], // ],
'email' => [ // 'email' => [
// 'analyzer' => 'noaccent', //// 'analyzer' => 'noaccent',
'type' => 'text', // 'type' => 'text',
], // ],
'city' => [ // 'city' => [
// 'analyzer' => 'noaccent', //// 'analyzer' => 'noaccent',
'type' => 'text', // 'type' => 'text',
], // ],
'siret' => [ // 'siret' => [
'type' => 'keyword', // 'type' => 'keyword',
], // ],
'country' => [ // 'country' => [
'type' => 'keyword', // 'type' => 'keyword',
], // ],
'connectors' => [ // 'connectors' => [
'type' => 'keyword', // 'type' => 'keyword',
], // ],
'zipcode' => [ // 'zipcode' => [
'type' => 'keyword', // 'type' => 'keyword',
], // ],
'persons' => [ // 'persons' => [
// 'analyzer' => 'noaccent', //// 'analyzer' => 'noaccent',
'type' => 'text', // 'type' => 'text',
], // ],
'activities' => [ // 'activities' => [
// 'analyzer' => 'noaccent', //// 'analyzer' => 'noaccent',
'type' => 'text', // 'type' => 'text',
], // ],
] // ]
] // ]
] // ]
] // ]
] // ]
); // );
} catch (\Exception $e) { // } catch (\Exception $e) {
throw new OscarException("Impossible de créer l'index de recherche : \n---\n" . $e->getMessage()); // throw new OscarException("Impossible de créer l'index de recherche : \n---\n" . $e->getMessage());
} // }
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment