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
Branches
Tags
No related merge requests found
Pipeline #23478 passed
......@@ -265,77 +265,77 @@ class OrganizationElasticSearch implements OrganizationSearchStrategy
} catch (\Exception $e) {
throw $e;
}
try {
$this->getClient()->indices()->create(
[
'index' => $this->getIndex(),
'body' => [
'settings' => [
'analysis' => [
'analyzer' => [
'noaccent' => [
"type" => "custom",
"tokenizer" => "standard",
"filter" => ['asciifolding', "lowercase"]
]
],
]
],
'mappings' => [
"organization" => [
'properties' => [
'code' => [
'type' => 'keyword',
],
'shortname' => [
'type' => 'text',
// 'analyzer' => 'noaccent'
],
'fullname' => [
// 'analyzer' => 'noaccent',
'type' => 'text',
],
'description' => [
// 'analyzer' => 'noaccent',
'type' => 'text',
],
'email' => [
// 'analyzer' => 'noaccent',
'type' => 'text',
],
'city' => [
// 'analyzer' => 'noaccent',
'type' => 'text',
],
'siret' => [
'type' => 'keyword',
],
'country' => [
'type' => 'keyword',
],
'connectors' => [
'type' => 'keyword',
],
'zipcode' => [
'type' => 'keyword',
],
'persons' => [
// 'analyzer' => 'noaccent',
'type' => 'text',
],
'activities' => [
// 'analyzer' => 'noaccent',
'type' => 'text',
],
]
]
]
]
]
);
} catch (\Exception $e) {
throw new OscarException("Impossible de créer l'index de recherche : \n---\n" . $e->getMessage());
}
//
// try {
// $this->getClient()->indices()->create(
// [
// 'index' => $this->getIndex(),
// 'body' => [
// 'settings' => [
// 'analysis' => [
// 'analyzer' => [
// 'noaccent' => [
// "type" => "custom",
// "tokenizer" => "standard",
// "filter" => ['asciifolding', "lowercase"]
// ]
// ],
// ]
// ],
// 'mappings' => [
// "organization" => [
// 'properties' => [
// 'code' => [
// 'type' => 'keyword',
// ],
// 'shortname' => [
// 'type' => 'text',
//// 'analyzer' => 'noaccent'
// ],
// 'fullname' => [
//// 'analyzer' => 'noaccent',
// 'type' => 'text',
// ],
// 'description' => [
//// 'analyzer' => 'noaccent',
// 'type' => 'text',
// ],
// 'email' => [
//// 'analyzer' => 'noaccent',
// 'type' => 'text',
// ],
// 'city' => [
//// 'analyzer' => 'noaccent',
// 'type' => 'text',
// ],
// 'siret' => [
// 'type' => 'keyword',
// ],
// 'country' => [
// 'type' => 'keyword',
// ],
// 'connectors' => [
// 'type' => 'keyword',
// ],
// 'zipcode' => [
// 'type' => 'keyword',
// ],
// 'persons' => [
//// 'analyzer' => 'noaccent',
// 'type' => 'text',
// ],
// 'activities' => [
//// 'analyzer' => 'noaccent',
// 'type' => 'text',
// ],
// ]
// ]
// ]
// ]
// ]
// );
// } catch (\Exception $e) {
// 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