Commit d5e5838e authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Modifification du système de recherche, devrait améliorer les réponses pour...

Modifification du système de recherche, devrait améliorer les réponses pour les recherches sur les personnes/organisations
parent fb501e15
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -198,12 +198,13 @@ class ActivityElasticSearch implements ActivitySearchStrategy
                            'numbers^9',
                            'oscar^9',
                            'label^7',
                            'description^7',
                            'description^2',
                            'project^5',
                            'disciplines^5',
                            'activitytype^2',
                            'partners^5',
                            'members^5']
                            'members^5'],
                        "fuzziness"=> "auto"
                    ]
                ]
            ]
+9 −8
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ class OrganizationElasticSearch implements OrganizationSearchStrategy
            'body' => [
                'size' => 10000,
                "query" => [
                    'query_string' => [
                    'multi_match' => [
                        'fields' => [
                            'code^7',
                            'shortname^9',
@@ -206,6 +206,7 @@ class OrganizationElasticSearch implements OrganizationSearchStrategy
                            'persons',
                            'activities'
                        ],
                        "fuzziness"=> "auto",
                        'query' => $search,

                    ]
@@ -289,22 +290,22 @@ class OrganizationElasticSearch implements OrganizationSearchStrategy
                                    ],
                                    'shortname' => [
                                        'type' => 'text',
                                        'analyzer' => 'noaccent'
//                                        'analyzer' => 'noaccent'
                                    ],
                                    'fullname' => [
                                        'analyzer' => 'noaccent',
//                                        'analyzer' => 'noaccent',
                                        'type' => 'text',
                                    ],
                                    'description' => [
                                        'analyzer' => 'noaccent',
//                                        'analyzer' => 'noaccent',
                                        'type' => 'text',
                                    ],
                                    'email' => [
                                        'analyzer' => 'noaccent',
//                                        'analyzer' => 'noaccent',
                                        'type' => 'text',
                                    ],
                                    'city' => [
                                        'analyzer' => 'noaccent',
//                                        'analyzer' => 'noaccent',
                                        'type' => 'text',
                                    ],
                                    'siret' => [
@@ -320,11 +321,11 @@ class OrganizationElasticSearch implements OrganizationSearchStrategy
                                        'type' => 'keyword',
                                    ],
                                    'persons' => [
                                        'analyzer' => 'noaccent',
//                                        'analyzer' => 'noaccent',
                                        'type' => 'text',
                                    ],
                                    'activities' => [
                                        'analyzer' => 'noaccent',
//                                        'analyzer' => 'noaccent',
                                        'type' => 'text',
                                    ],
                                ]
+4 −15
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ class PersonElasticSearch implements PersonSearchStrategy
            'body' => [
                'size' => 10000,
                'query' => [
                    'query_string' => [
                    'multi_match' => [
                        'query' => $searchQuery,
                        'fields' => [
                            'fullname^4',
@@ -102,23 +102,12 @@ class PersonElasticSearch implements PersonSearchStrategy
                            'affectation^5',
                            'organizations^5',
                            'activities^5',
                            'connectors']
                            'connectors'
                        ],
                        "fuzziness"=> "auto"
                    ]
                ]
            ]

//            'body' => [
//                'size' => $limit,
//                'query' => [
//                    'multi_match' => [
//                        'query' => $searchQuery,
//                        'type' => 'phrase_prefix',
//                        'fields' => ['fullname^6','lastname^5', 'firstname^2', 'email', 'affectation^3', 'location^3', 'organizations', 'activities', 'connectors'],
//                       /* 'max_expansions' => 20,*/
//                        /*'fuzziness' => 1*/
//                    ]
//                ]
//            ]
        ];

        $response = $this->getClient()->search($params);