Commit 12af0857 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix : Recherche des organisations

parent 0cb953d4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -137,7 +137,6 @@ class OrganizationController extends AbstractOscarController implements UseOrgan
        $sort = $this->params()->fromQuery('sort', 'hit');
        $direction = $this->params()->fromQuery('direction', 'ASC');
        $error = null;
        $organizations = null;

        $sorting = [
            'hit'         => 'Pertinence (recherche textuelle)',
+5 −2
Original line number Diff line number Diff line
@@ -820,7 +820,7 @@ class OrganizationService implements UseOscarConfigurationService, UseEntityMana

            // ORDER BY de LREM
            // Permet de forcer le trie dans l'ordre des IDs fournit par Elastic Search
//            if (count($ids) > 0) {
            if (count($ids) > 0) {
                if ($filter['sort'] == 'hit') {
                    $sortSize = 25; // On ne trie que les 25 premiers
                    $this->getLoggerService()->debug("SORT BY HIT (elastic IDS)");
@@ -839,7 +839,10 @@ class OrganizationService implements UseOscarConfigurationService, UseEntityMana
                    $qb->orderBy('ORD', 'ASC');
                }
                $qb->where('o.id IN(:ids)')->setParameter('ids', $ids);
//            }
            } else {
                // Aucun résultat
                return $qb->andWhere('o.id = -1');
            }
        }

        if ($filter['sort'] != 'hit') {
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ abstract class ElasticSearchEngine

        $ids = [];
        $idsProjects = [];
        if ($response && $response['hits'] && $response['hits']['total'] > 0) {
        if ($response && $response['hits']) {
            foreach ($response['hits']['hits'] as $hit) {
                $ids[] = intval($hit["_id"]);
                if( array_key_exists('project_ids', $hit['_source']) ) {
+1 −1
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ class OrganizationElasticSearch extends ElasticSearchEngine implements IOrganiza
                    ],
                    [
                        "match" => [
                            "connector" => [
                            "connectors" => [
                                "query" => $search,
                                'fuzziness' => "AUTO", // "Tolérance" aux fautes,
                            ]