Loading module/Oscar/src/Oscar/Strategy/Search/OrganizationElasticSearch.php +62 −89 Original line number Diff line number Diff line Loading @@ -97,108 +97,81 @@ class OrganizationElasticSearch extends ElasticSearchEngine implements IOrganiza return [ "bool" => [ "should" => [ [ "match" => [ "code" => [ "query" => $search, "boost" => 9 // Favoriser les correspondances ] ] ], [ "match" => [ "shortname" => [ "query" => $search, "boost" => 9 // Favoriser les correspondances ] ] ], [ "match" => [ "fullname" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes "boost" => 5 // Favoriser les correspondances ] ] ], [ "match" => [ "description" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, ] ] ], [ "match" => [ "email" => [ "query" => $search, 'fuzziness' => "AUTO" ] ] ], [ "match" => [ "city" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, ] ] ], [ "match" => [ "siret" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, ] ] ], [ "match" => [ "country" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, ] ] ], /** * 'duns' => $object->getDuns(), * 'rnsr' => $object->getRnsr(), * 'tvaintra' => $object->getTvaintra(), * 'labintel' => $object->getLabintel(), */ ["match" => ["code" => ["query" => $search, "boost" => 9 ]]], ["prefix" => ["code" => ["value" => $search,"boost" => 10]]], ["match" => ["shortname" => ["query" => $search, "boost" => 9 ]]], ["prefix" => ["shortname" => ["value" => $search,"boost" => 10]]], ["match" => ["fullname" => ["query" => $search, 'fuzziness' => "AUTO", "boost" => 5 ]]], ["match" => ["description" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => ["email" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => ["city" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => ["siret" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => ["country" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => [ "connectors" => [ "query" => $search, "boost" => 9]]], ["match" => [ "duns" => [ "query" => $search, "boost" => 9]]], ["match" => [ "rnsr" => [ "query" => $search, "boost" => 9]]], ["match" => [ "tvaintra" => [ "query" => $search, "boost" => 9]]], ["match" => [ "labintel" => [ "query" => $search, "boost" => 9]]], ["match" => [ "zipcode" => [ "query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => [ "persons" => [ "query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => [ "activities" => [ "query" => $search, 'fuzziness' => "AUTO" ]]], [ "match" => [ "zipcode" => [ "match_phrase_prefix" => [ "fullname" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, "slop" => 2, // tolère inversion prénom/nom "max_expansions" => 20, "boost" => 12 ] ] ], [ "match" => [ "persons" => [ "multi_match" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, "type" => "cross_fields", "fields" => ["code^4", "shortname^2", "fullname^3"], "operator" => "and", "boost" => 9 ] ] ], [ "match" => [ "activities" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, "minimum_should_match" => 1 ] ]; } protected function indicesCreateBody(): array { return [ 'settings' => [ 'analysis' => [ 'analyzer' => [ 'folding_analyzer' => [ 'tokenizer' => 'standard', 'filter' => ['lowercase', 'asciifolding'] ] ] ] ], ], "minimum_should_match" => 1 'mappings' => [ 'properties' => [ 'id' => ['type' => 'keyword'], 'shortname' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'fullname' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'description' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'email' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'city' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'siret' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'country' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'duns' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'rnsr' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'tvaintra' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'labintel' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'connectors' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'zipcode' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'persons' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'activities' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], ] ] ]; } Loading module/Oscar/src/Oscar/Strategy/Search/PersonElasticSearch.php +10 −10 Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ class PersonElasticSearch extends ElasticSearchEngine implements IPersonISearchS return $this->addItem($person); } protected function indicesCreateBody(): array { protected function indicesCreateBody(): array { return [ 'settings' => [ 'analysis' => [ Loading Loading @@ -103,8 +104,7 @@ class PersonElasticSearch extends ElasticSearchEngine implements IPersonISearchS /** @var ActivityPerson $activityPerson */ foreach ($person->getActivities() as $activityPerson) { if ($activityPerson->getActivity()->getProject()) { $project = (string)$activityPerson->getActivity()->getProject()->getAcronym( ) . " " . (string)$activityPerson->getActivity()->getProject()->getLabel(); $project = (string)$activityPerson->getActivity()->getProject()->getAcronym() . " " . (string)$activityPerson->getActivity()->getProject()->getLabel(); if (!in_array($project, $projects)) { $projects[] = $project; } Loading Loading
module/Oscar/src/Oscar/Strategy/Search/OrganizationElasticSearch.php +62 −89 Original line number Diff line number Diff line Loading @@ -97,108 +97,81 @@ class OrganizationElasticSearch extends ElasticSearchEngine implements IOrganiza return [ "bool" => [ "should" => [ [ "match" => [ "code" => [ "query" => $search, "boost" => 9 // Favoriser les correspondances ] ] ], [ "match" => [ "shortname" => [ "query" => $search, "boost" => 9 // Favoriser les correspondances ] ] ], [ "match" => [ "fullname" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes "boost" => 5 // Favoriser les correspondances ] ] ], [ "match" => [ "description" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, ] ] ], [ "match" => [ "email" => [ "query" => $search, 'fuzziness' => "AUTO" ] ] ], [ "match" => [ "city" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, ] ] ], [ "match" => [ "siret" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, ] ] ], [ "match" => [ "country" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, ] ] ], /** * 'duns' => $object->getDuns(), * 'rnsr' => $object->getRnsr(), * 'tvaintra' => $object->getTvaintra(), * 'labintel' => $object->getLabintel(), */ ["match" => ["code" => ["query" => $search, "boost" => 9 ]]], ["prefix" => ["code" => ["value" => $search,"boost" => 10]]], ["match" => ["shortname" => ["query" => $search, "boost" => 9 ]]], ["prefix" => ["shortname" => ["value" => $search,"boost" => 10]]], ["match" => ["fullname" => ["query" => $search, 'fuzziness' => "AUTO", "boost" => 5 ]]], ["match" => ["description" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => ["email" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => ["city" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => ["siret" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => ["country" => ["query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => [ "connectors" => [ "query" => $search, "boost" => 9]]], ["match" => [ "duns" => [ "query" => $search, "boost" => 9]]], ["match" => [ "rnsr" => [ "query" => $search, "boost" => 9]]], ["match" => [ "tvaintra" => [ "query" => $search, "boost" => 9]]], ["match" => [ "labintel" => [ "query" => $search, "boost" => 9]]], ["match" => [ "zipcode" => [ "query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => [ "persons" => [ "query" => $search, 'fuzziness' => "AUTO" ]]], ["match" => [ "activities" => [ "query" => $search, 'fuzziness' => "AUTO" ]]], [ "match" => [ "zipcode" => [ "match_phrase_prefix" => [ "fullname" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, "slop" => 2, // tolère inversion prénom/nom "max_expansions" => 20, "boost" => 12 ] ] ], [ "match" => [ "persons" => [ "multi_match" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, "type" => "cross_fields", "fields" => ["code^4", "shortname^2", "fullname^3"], "operator" => "and", "boost" => 9 ] ] ], [ "match" => [ "activities" => [ "query" => $search, 'fuzziness' => "AUTO", // "Tolérance" aux fautes, "minimum_should_match" => 1 ] ]; } protected function indicesCreateBody(): array { return [ 'settings' => [ 'analysis' => [ 'analyzer' => [ 'folding_analyzer' => [ 'tokenizer' => 'standard', 'filter' => ['lowercase', 'asciifolding'] ] ] ] ], ], "minimum_should_match" => 1 'mappings' => [ 'properties' => [ 'id' => ['type' => 'keyword'], 'shortname' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'fullname' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'description' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'email' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'city' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'siret' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'country' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'duns' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'rnsr' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'tvaintra' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'labintel' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'connectors' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'zipcode' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'persons' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], 'activities' => ['type' => 'text', 'analyzer' => 'folding_analyzer'], ] ] ]; } Loading
module/Oscar/src/Oscar/Strategy/Search/PersonElasticSearch.php +10 −10 Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ class PersonElasticSearch extends ElasticSearchEngine implements IPersonISearchS return $this->addItem($person); } protected function indicesCreateBody(): array { protected function indicesCreateBody(): array { return [ 'settings' => [ 'analysis' => [ Loading Loading @@ -103,8 +104,7 @@ class PersonElasticSearch extends ElasticSearchEngine implements IPersonISearchS /** @var ActivityPerson $activityPerson */ foreach ($person->getActivities() as $activityPerson) { if ($activityPerson->getActivity()->getProject()) { $project = (string)$activityPerson->getActivity()->getProject()->getAcronym( ) . " " . (string)$activityPerson->getActivity()->getProject()->getLabel(); $project = (string)$activityPerson->getActivity()->getProject()->getAcronym() . " " . (string)$activityPerson->getActivity()->getProject()->getLabel(); if (!in_array($project, $projects)) { $projects[] = $project; } Loading