Commit 869a4e84 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix : Reconstruction d'index des organisations et configuration des commandes PHP

parent 14e8bed3
Loading
Loading
Loading
Loading
+22 −0
Changes for module/Oscar/config/module.config.php: 22 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -520,6 +520,26 @@ return array(
                    ),
                ),

                'oscar_persons_search_build' => array(
                    'options' => array(
                        'route' => 'oscar persons:search:build',
                        'defaults' => array(
                            'controller' => 'Console',
                            'action' => 'buildSearchPerson',
                        ),
                    ),
                ),

                'oscar_organizations_search_build' => array(
                    'options' => array(
                        'route' => 'oscar organizations:search:build',
                        'defaults' => array(
                            'controller' => 'Console',
                            'action' => 'buildSearchOrganization',
                        ),
                    ),
                ),

                'oscar_organizations_sync' => [
                    'options' => [
                        'route' => 'oscar organizations:sync <connectorkey> [--force|-f] [--verbose|-v]',
@@ -531,6 +551,8 @@ return array(
                ],




                // -------------------------------------------------------------

                'oscar_search_update' => array(
+31 −30
Changes for module/Oscar/src/Oscar/Strategy/Search/OrganizationElasticSearch.php: 31 added lines, 30 removed lines.
Original line number Diff line number Diff line
@@ -147,36 +147,37 @@ class OrganizationElasticSearch implements OrganizationSearchStrategy
//        'persons' => $persons,
//        'activities' => $activities,
//        'connectors' => $connectors
        /******** CONFIGURATION DU MAPPING ***/
        $params = [
            'index' => $this->getIndex(),
            'type' => $this->getType(),
            'body' => [
                $this->getType() => [
                    '_source' => [
                        'enabled' => true
                    ],
                    'properties' => [
                        'code' => [
                            'type' => 'text'
                        ],
                        'shortname' => [
                            'type' => 'text',
                            'boost' => 5
                        ],
                        'fullname' => [
                            'type' => 'text',
                            'boost' => 5
                        ],
                        'email' => [
                            'type' => 'text'
                        ],
                    ]
                ]
            ]
        ];

        $response = $this->getClient()->indices()->putMapping($params);
//        /******** CONFIGURATION DU MAPPING ***/
//        $params = [
//            'index' => $this->getIndex(),
//            'type' => $this->getType(),
//            'body' => [
//                $this->getType() => [
//                    '_source' => [
//                        'enabled' => true
//                    ],
//                    'properties' => [
//                        'code' => [
//                            'type' => 'text'
//                        ],
//                        'shortname' => [
//                            'type' => 'text',
//                            'boost' => 5
//                        ],
//                        'fullname' => [
//                            'type' => 'text',
//                            'boost' => 5
//                        ],
//                        'email' => [
//                            'type' => 'text'
//                        ],
//                    ]
//                ]
//            ]
//        ];
//
//        $response = $this->getClient()->indices()->putMapping($params);


        return $repport;
@@ -215,7 +216,7 @@ class OrganizationElasticSearch implements OrganizationSearchStrategy

        return [
            'id' => $organization->getId(),
            'code' => $organization->getCode(),
            'code' => $organization->getCode() ? $organization->getCode() : "",
            'shortname' => $organization->getShortName(),
            'fullname' => $organization->getFullName(),
            'email' => $organization->getEmail(),
+1 −1

File changed.

Contains only whitespace changes.