Commit 04c41d4d authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix : Exception (OrganizationElasticSearch->add)

parent 5ee17834
Loading
Loading
Loading
Loading
+15 −59
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ class OrganizationElasticSearch extends ElasticSearchEngine implements IOrganiza

    public function add(Organization $organization): callable|array
    {
        $this->addItem($organization);
        return $this->addItem($organization);
    }

    public function getIndexableDatas(mixed $organization): array
@@ -84,50 +84,6 @@ class OrganizationElasticSearch extends ElasticSearchEngine implements IOrganiza
        ];
    }

//    public function search($search)
//    {
//        $params = [
//            'index' => $this->getIndex(),
//            'type' => $this->getType(),
//            'body' => [
//                'size' => 10000,
//                "query" => [
//                    'multi_match' => [
//                        'fields' => [
//                            'code^7',
//                            'shortname^9',
//                            'fullname^5',
//                            'description',
//                            'email',
//                            'city',
//                            'siret',
//                            'country',
//                            'connectors',
//                            'zipcode',
//                            'persons',
//                            'activities'
//                        ],
//                        "fuzziness"=> "auto",
//                        'query' => $search,
//
//                    ]
//                ]
//            ]
//        ];
//
//        $response = $this->getClient()->search($params);
//        $ids = [];
//
//        if ($response && $response['hits'] && $response['hits']['total'] > 0) {
//            foreach ($response['hits']['hits'] as $hit) {
//                $ids[] = $hit["_id"];
//            }
//        }
//
//        return $ids;
//    }


    public function getFieldsSearchedWeighted(): array
    {
        return [