From 75387ca9b7216811f06684b698cf9ac6e7962802 Mon Sep 17 00:00:00 2001 From: Romain Ruaud Date: Wed, 11 Dec 2024 17:05:05 +0100 Subject: [PATCH] Adding Unit tests for the suggested terms provider --- .../etc/config.xml | 5 - .../Helper/Autocomplete.php | 13 + .../Autocomplete/SuggestedTermsProvider.php | 35 +- .../Unit/Model/SuggestedTermsProviderTest.php | 347 ++++++++++++++++++ .../etc/adminhtml/system.xml | 10 +- src/module-elasticsuite-core/etc/config.xml | 6 + src/module-elasticsuite-core/i18n/de_DE.csv | 2 + src/module-elasticsuite-core/i18n/en_US.csv | 2 + src/module-elasticsuite-core/i18n/fr_FR.csv | 2 + src/module-elasticsuite-core/i18n/nl_NL.csv | 2 + 10 files changed, 409 insertions(+), 15 deletions(-) create mode 100644 src/module-elasticsuite-core/Test/Unit/Model/SuggestedTermsProviderTest.php diff --git a/src/module-elasticsuite-catalog/etc/config.xml b/src/module-elasticsuite-catalog/etc/config.xml index dfd18e7db..f53713d97 100644 --- a/src/module-elasticsuite-catalog/etc/config.xml +++ b/src/module-elasticsuite-catalog/etc/config.xml @@ -33,11 +33,6 @@ 3 - - 1 - 0 - 0 - diff --git a/src/module-elasticsuite-core/Helper/Autocomplete.php b/src/module-elasticsuite-core/Helper/Autocomplete.php index 3e607f74b..67ff9037e 100644 --- a/src/module-elasticsuite-core/Helper/Autocomplete.php +++ b/src/module-elasticsuite-core/Helper/Autocomplete.php @@ -100,6 +100,19 @@ public function isExtensionStoppedOnMatch() ); } + /** + * Check if Autocomplete is supposed to always use the user raw query or not. + * + * @return bool + */ + public function isPreservingBaseQuery() + { + return (bool) $this->scopeConfig->isSetFlag( + self::AUTOCOMPLETE_SETTINGS_CONFIG_XML_PREFIX . "/advanced/preserve_base_query", + \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ); + } + /** * Retrieve a configuration value by its key * diff --git a/src/module-elasticsuite-core/Model/Autocomplete/SuggestedTermsProvider.php b/src/module-elasticsuite-core/Model/Autocomplete/SuggestedTermsProvider.php index 5f11b0a1a..4f7fc703d 100644 --- a/src/module-elasticsuite-core/Model/Autocomplete/SuggestedTermsProvider.php +++ b/src/module-elasticsuite-core/Model/Autocomplete/SuggestedTermsProvider.php @@ -6,7 +6,7 @@ * versions in the future. * * @category Smile - * @package Smile\ElasticsuiteCatalog + * @package Smile\ElasticsuiteCore * @author Romain Ruaud * @copyright 2024 Smile * @license Open Software License ("OSL") v. 3.0 @@ -24,7 +24,7 @@ * Based on the Term provider but will manipulate it according to configuration. * * @category Smile - * @package Smile\ElasticsuiteCatalog + * @package Smile\ElasticsuiteCore * @author Romain Ruaud */ class SuggestedTermsProvider @@ -44,6 +44,11 @@ class SuggestedTermsProvider */ private $queryStringProviderFactory; + /** + * @var null|string + */ + private $queryString = null; + /** * @var null */ @@ -67,6 +72,8 @@ public function __construct( /** * List of search terms suggested by the search terms data provider, and reworked according to configuration. * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * * @return array|string[] */ public function getSuggestedTerms() @@ -84,8 +91,8 @@ function (TermItem $termItem) { $hasAlreadyStoppedExtending = false; if ($this->helper->isExtensionStoppedOnMatch()) { - if (array_search(trim($this->getQueryStringProvider()->get()), $terms) !== false) { - $terms = [$this->getQueryStringProvider()->get()]; + if (array_search(trim($this->getQueryString()), $terms) !== false) { + $terms = [$this->getQueryString()]; $hasAlreadyStoppedExtending = true; } } @@ -93,23 +100,33 @@ function (TermItem $termItem) { if ($this->helper->isExtensionLimited() && !$hasAlreadyStoppedExtending) { $terms = array_slice($terms, 0, (int) $this->helper->getExtensionSize()); } + + if ($this->helper->isPreservingBaseQuery() && !$hasAlreadyStoppedExtending) { + array_unshift($terms, $this->getQueryString()); + } } if (empty($terms)) { - $terms = [$this->getQueryStringProvider()->get()]; + $terms = [$this->getQueryString()]; } - $this->terms = array_unique($terms); + $this->terms = array_values(array_unique($terms)); } return $this->terms; } /** - * @return \Smile\ElasticsuiteCore\Model\Search\QueryStringProvider + * Retrieve current query string + * + * @return string */ - private function getQueryStringProvider() + private function getQueryString() { - return $this->queryStringProviderFactory->create(); + if ($this->queryString === null) { + $this->queryString = $this->queryStringProviderFactory->create()->get(); + } + + return $this->queryString; } } diff --git a/src/module-elasticsuite-core/Test/Unit/Model/SuggestedTermsProviderTest.php b/src/module-elasticsuite-core/Test/Unit/Model/SuggestedTermsProviderTest.php new file mode 100644 index 000000000..3e1b19c64 --- /dev/null +++ b/src/module-elasticsuite-core/Test/Unit/Model/SuggestedTermsProviderTest.php @@ -0,0 +1,347 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ +namespace Smile\ElasticsuiteCore\Test\Unit\Model; + +use PHPUnit\Framework\TestCase; +use Smile\ElasticsuiteCore\Model\Autocomplete\SuggestedTermsProvider; +use Smile\ElasticsuiteCore\Helper\Autocomplete; +use Smile\ElasticsuiteCore\Model\Autocomplete\Terms\DataProvider as TermDataProvider; +use Smile\ElasticsuiteCore\Model\Search\QueryStringProvider; +use Magento\Search\Model\Autocomplete\Item as TermItem; + +/** + * Search API unit testing. + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * + * @category Smile + * @package Smile\ElasticsuiteCore + * @author Romain Ruaud + */ +class SuggestedTermsProviderTest extends TestCase +{ + /** + * @var (\object&\PHPUnit\Framework\MockObject\MockObject) + */ + private $helperMock; + + /** + * @var (\object&\PHPUnit\Framework\MockObject\MockObject) + */ + private $termDataProviderMock; + + /** + * @var (\object&\PHPUnit\Framework\MockObject\MockObject) + */ + private $queryStringProviderFactoryMock; + + /** + * @var (\object&\PHPUnit\Framework\MockObject\MockObject) + */ + private $suggestedTermsProvider; + + /** + * Test setup + * + * @return void + */ + protected function setUp(): void + { + $this->helperMock = $this->createMock(Autocomplete::class); + $this->termDataProviderMock = $this->createMock(TermDataProvider::class); + $this->queryStringProviderFactoryMock = $this->getMockBuilder(QueryStringProvider::class. 'Factory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->suggestedTermsProvider = new SuggestedTermsProvider( + $this->helperMock, + $this->termDataProviderMock, + $this->queryStringProviderFactoryMock + ); + } + + /** + * Test case when extension is enabled and no limit on the number of suggested terms. + * It should return all available terms. + */ + public function testGetSuggestedTermsWithExtensionEnabledAndNoLimit() + { + $this->helperMock->method('isExtensionEnabled')->willReturn(true); + $this->helperMock->method('isExtensionStoppedOnMatch')->willReturn(false); + $this->helperMock->method('isExtensionLimited')->willReturn(false); + + // Create mock TermItems with terms starting with 'top'. + $termItem1 = $this->createMock(TermItem::class); + $termItem1->method('getTitle')->willReturn('top'); + + $termItem2 = $this->createMock(TermItem::class); + $termItem2->method('getTitle')->willReturn('top blouse'); + + $termItem3 = $this->createMock(TermItem::class); + $termItem3->method('getTitle')->willReturn('top tank'); + + $this->termDataProviderMock->method('getItems')->willReturn([$termItem1, $termItem2, $termItem3]); + + $expectedTerms = ['top', 'top blouse', 'top tank']; + + $terms = $this->suggestedTermsProvider->getSuggestedTerms(); + + $this->assertEquals($expectedTerms, $terms); + } + + /** + * Test case when extension is enabled, and results are limited to one term. + * It should return only the first term. + */ + public function testGetSuggestedTermsWithLimitedResultsOneTerm() + { + $this->helperMock->method('isExtensionEnabled')->willReturn(true); + $this->helperMock->method('isExtensionStoppedOnMatch')->willReturn(false); + $this->helperMock->method('isExtensionLimited')->willReturn(true); + $this->helperMock->method('getExtensionSize')->willReturn(1); + + // Create mock TermItems with terms starting with 'top'. + $termItem1 = $this->createMock(TermItem::class); + $termItem1->method('getTitle')->willReturn('top'); + + $termItem2 = $this->createMock(TermItem::class); + $termItem2->method('getTitle')->willReturn('top blouse'); + + $termItem3 = $this->createMock(TermItem::class); + $termItem3->method('getTitle')->willReturn('top tank'); + + $this->termDataProviderMock->method('getItems')->willReturn([$termItem1, $termItem2, $termItem3]); + + // Expect the terms to be limited to only one item. + $expectedTerms = ['top']; + + $terms = $this->suggestedTermsProvider->getSuggestedTerms(); + + $this->assertEquals($expectedTerms, $terms); + } + + /** + * Test case when extension is enabled, and results are limited to two terms. + * It should return the first two terms. + */ + public function testGetSuggestedTermsWithLimitedResultsTwoTerms() + { + $this->helperMock->method('isExtensionEnabled')->willReturn(true); + $this->helperMock->method('isExtensionStoppedOnMatch')->willReturn(false); + $this->helperMock->method('isExtensionLimited')->willReturn(true); + $this->helperMock->method('getExtensionSize')->willReturn(2); + + // Create mock TermItems with terms starting with 'top'. + $termItem1 = $this->createMock(TermItem::class); + $termItem1->method('getTitle')->willReturn('top'); + + $termItem2 = $this->createMock(TermItem::class); + $termItem2->method('getTitle')->willReturn('top blouse'); + + $termItem3 = $this->createMock(TermItem::class); + $termItem3->method('getTitle')->willReturn('top tank'); + + $this->termDataProviderMock->method('getItems')->willReturn([$termItem1, $termItem2, $termItem3]); + + $expectedTerms = ['top', 'top blouse']; + + $terms = $this->suggestedTermsProvider->getSuggestedTerms(); + + $this->assertEquals($expectedTerms, $terms); + } + + /** + * Test case when extension is enabled, and results are limited to three terms. + * It should return the first three terms. + */ + public function testGetSuggestedTermsWithLimitedResultsThreeTerms() + { + $this->helperMock->method('isExtensionEnabled')->willReturn(true); + $this->helperMock->method('isExtensionStoppedOnMatch')->willReturn(false); + $this->helperMock->method('isExtensionLimited')->willReturn(true); + $this->helperMock->method('getExtensionSize')->willReturn(3); + + // Create mock TermItems with terms starting with 'top'. + $termItem1 = $this->createMock(TermItem::class); + $termItem1->method('getTitle')->willReturn('top'); + + $termItem2 = $this->createMock(TermItem::class); + $termItem2->method('getTitle')->willReturn('top blouse'); + + $termItem3 = $this->createMock(TermItem::class); + $termItem3->method('getTitle')->willReturn('top tank'); + + $this->termDataProviderMock->method('getItems')->willReturn([$termItem1, $termItem2, $termItem3]); + + $expectedTerms = ['top', 'top blouse', 'top tank']; + + $terms = $this->suggestedTermsProvider->getSuggestedTerms(); + + $this->assertEquals($expectedTerms, $terms); + } + + /** + * Test case when extension is enabled, and limit is greater than the number of available terms. + * It should return all available terms. + */ + public function testGetSuggestedTermsWithLimitedResultsLessThanSize() + { + $this->helperMock->method('isExtensionEnabled')->willReturn(true); + $this->helperMock->method('isExtensionStoppedOnMatch')->willReturn(false); + $this->helperMock->method('isExtensionLimited')->willReturn(true); + // Limit set to 5, but only 3 items are available. + $this->helperMock->method('getExtensionSize')->willReturn(5); + + // Create mock TermItems with terms starting with 'top'. + $termItem1 = $this->createMock(TermItem::class); + $termItem1->method('getTitle')->willReturn('top'); + + $termItem2 = $this->createMock(TermItem::class); + $termItem2->method('getTitle')->willReturn('top blouse'); + + $termItem3 = $this->createMock(TermItem::class); + $termItem3->method('getTitle')->willReturn('top tank'); + + $this->termDataProviderMock->method('getItems')->willReturn([$termItem1, $termItem2, $termItem3]); + + $expectedTerms = ['top', 'top blouse', 'top tank']; + + $terms = $this->suggestedTermsProvider->getSuggestedTerms(); + + $this->assertEquals($expectedTerms, $terms); + } + + /** + * Test case when extension is disabled. + * It should return the query string as the term. + */ + public function testGetSuggestedTermsWhenExtensionDisabled() + { + $this->helperMock->method('isExtensionEnabled')->willReturn(false); + + $queryStringProviderMock = $this->createMock(\Smile\ElasticsuiteCore\Model\Search\QueryStringProvider::class); + $queryStringProviderMock->method('get')->willReturn('top'); + $this->queryStringProviderFactoryMock->method('create')->willReturn($queryStringProviderMock); + + $termItem1 = $this->createMock(TermItem::class); + $termItem1->method('getTitle')->willReturn('top'); + + $termItem2 = $this->createMock(TermItem::class); + $termItem2->method('getTitle')->willReturn('top blouse'); + + $termItem3 = $this->createMock(TermItem::class); + $termItem3->method('getTitle')->willReturn('top tank'); + + $this->termDataProviderMock->method('getItems')->willReturn([$termItem1, $termItem2, $termItem3]); + + // Expect the terms to be the query string since the extension is disabled. + $expectedTerms = ['top']; + + $terms = $this->suggestedTermsProvider->getSuggestedTerms(); + + $this->assertEquals($expectedTerms, $terms); + } + + /** + * Test case when extension is enabled and stopped on match. + * It should return only the term that matches the query string. + */ + public function testGetSuggestedTermsWithExtensionStoppedOnMatch() + { + $this->helperMock->method('isExtensionEnabled')->willReturn(true); + $this->helperMock->method('isExtensionStoppedOnMatch')->willReturn(true); + $this->helperMock->method('isExtensionLimited')->willReturn(false); + + $queryStringProviderMock = $this->createMock(\Smile\ElasticsuiteCore\Model\Search\QueryStringProvider::class); + $queryStringProviderMock->method('get')->willReturn('top'); + $this->queryStringProviderFactoryMock->method('create')->willReturn($queryStringProviderMock); + + $termItem1 = $this->createMock(TermItem::class); + $termItem1->method('getTitle')->willReturn('top'); + + $termItem2 = $this->createMock(TermItem::class); + $termItem2->method('getTitle')->willReturn('top blouse'); + + $this->termDataProviderMock->method('getItems')->willReturn([$termItem1, $termItem2]); + + // Expect the terms to be only 'top' because of the stop on match logic. + $expectedTerms = ['top']; + + $terms = $this->suggestedTermsProvider->getSuggestedTerms(); + + $this->assertEquals($expectedTerms, $terms); + } + + /** + * Tests the scenario where the base query is preserved and added to the suggestions. + * + * @return void + */ + public function testGetSuggestedTermsWithBaseQueryPreserved() + { + $this->helperMock->method('isExtensionEnabled')->willReturn(true); + $this->helperMock->method('isExtensionStoppedOnMatch')->willReturn(false); + $this->helperMock->method('isExtensionLimited')->willReturn(false); + $this->helperMock->method('isPreservingBaseQuery')->willReturn(true); + + $queryStringProviderMock = $this->createMock(QueryStringProvider::class); + $queryStringProviderMock->method('get')->willReturn('to'); + $this->queryStringProviderFactoryMock->method('create')->willReturn($queryStringProviderMock); + + $termItem1 = $this->createMock(TermItem::class); + $termItem1->method('getTitle')->willReturn('top'); + + $termItem2 = $this->createMock(TermItem::class); + $termItem2->method('getTitle')->willReturn('top blouse'); + + $this->termDataProviderMock->method('getItems')->willReturn([$termItem1, $termItem2]); + + $expectedTerms = ['to', 'top', 'top blouse']; + + $terms = $this->suggestedTermsProvider->getSuggestedTerms(); + + $this->assertEquals($expectedTerms, $terms); + } + + /** + * Tests the case where the base query matches one of the suggested terms, ensuring duplicates are removed. + * + * @return void + */ + public function testGetSuggestedTermsWithBaseQueryPreservedAndDuplicate() + { + $this->helperMock->method('isExtensionEnabled')->willReturn(true); + $this->helperMock->method('isExtensionStoppedOnMatch')->willReturn(false); + $this->helperMock->method('isExtensionLimited')->willReturn(false); + $this->helperMock->method('isPreservingBaseQuery')->willReturn(true); + + $queryStringProviderMock = $this->createMock(QueryStringProvider::class); + $queryStringProviderMock->method('get')->willReturn('top'); + $this->queryStringProviderFactoryMock->method('create')->willReturn($queryStringProviderMock); + + $termItem1 = $this->createMock(TermItem::class); + $termItem1->method('getTitle')->willReturn('top'); + + $termItem2 = $this->createMock(TermItem::class); + $termItem2->method('getTitle')->willReturn('top blouse'); + + $this->termDataProviderMock->method('getItems')->willReturn([$termItem1, $termItem2]); + + $expectedTerms = ['top', 'top blouse']; + + $terms = $this->suggestedTermsProvider->getSuggestedTerms(); + + $this->assertEquals($expectedTerms, $terms); + } +} diff --git a/src/module-elasticsuite-core/etc/adminhtml/system.xml b/src/module-elasticsuite-core/etc/adminhtml/system.xml index 71df55e22..00d0537b7 100644 --- a/src/module-elasticsuite-core/etc/adminhtml/system.xml +++ b/src/module-elasticsuite-core/etc/adminhtml/system.xml @@ -186,7 +186,15 @@ Magento\Config\Model\Config\Source\Yesno - + + + + + Magento\Config\Model\Config\Source\Yesno + + 1 + + diff --git a/src/module-elasticsuite-core/etc/config.xml b/src/module-elasticsuite-core/etc/config.xml index cef8eaa21..50b3d9d84 100644 --- a/src/module-elasticsuite-core/etc/config.xml +++ b/src/module-elasticsuite-core/etc/config.xml @@ -53,6 +53,12 @@ 3 + + 1 + 0 + 0 + 0 + diff --git a/src/module-elasticsuite-core/i18n/de_DE.csv b/src/module-elasticsuite-core/i18n/de_DE.csv index 6cfa479f3..5fbb5ef0b 100644 --- a/src/module-elasticsuite-core/i18n/de_DE.csv +++ b/src/module-elasticsuite-core/i18n/de_DE.csv @@ -129,3 +129,5 @@ "The number of suggested search terms that will be used for fetching results in the autocompletion box.","Die Anzahl der vorgeschlagenen Suchbegriffe, die in der Autovervollständigungsbox verwendet werden sollen, um Ergebnisse abzurufen." "Stop the extension mechanism when the current search term of the user is suggested.","Stoppen Sie den Erweiterungsmechanismus, wenn der aktuelle Suchbegriff des Benutzers vorgeschlagen wird." "Default: No. When set to ""Yes"", this setting will discard the extension mechanism as soon as the exact search term entered by the user is part of the suggestions. Eg : When the user has finished to type ""computer"", if the list of suggested search terms is ""computer"", ""apple computer"", ""computer for kids"", only ""computer"" will be considered as it's exactly what the user has written.","Standard: Nein. Wenn auf ""Ja"" gesetzt, wird dieser Mechanismus deaktiviert, sobald der genaue Suchbegriff, den der Benutzer eingegeben hat, Teil der Vorschläge ist. Beispiel: Wenn der Benutzer ""computer"" fertig eingegeben hat und die Liste der vorgeschlagenen Suchbegriffe ""computer"", ""apple computer"", ""computer für Kinder"" enthält, wird nur ""computer"" berücksichtigt, da es genau das ist, was der Benutzer eingegeben hat." +"Always use the user raw input for suggestions.","Immer die Rohdaten des Benutzers für Vorschläge verwenden." +"Default: No. When set to ""Yes"", this setting will always proceed to fetch suggestions on the query typed by the user in addition to the extended terms. Eg : When the user is typing ""comp"", the popular search term ""computer"" will be suggested, but products or categories matching either ""comp"" or ""computer"" will be shown.","Standard: Nein. Wenn diese Option auf ""Ja"" gesetzt ist, werden immer Vorschläge basierend auf der eingegebenen Benutzereingabe sowie den erweiterten Begriffen abgerufen. Beispiel: Wenn der Benutzer ""comp"" eingibt, wird der beliebte Suchbegriff ""computer"" vorgeschlagen, aber Produkte oder Kategorien, die entweder ""comp"" oder ""computer"" entsprechen, werden angezeigt." diff --git a/src/module-elasticsuite-core/i18n/en_US.csv b/src/module-elasticsuite-core/i18n/en_US.csv index d84d3b9b8..e5b10685e 100644 --- a/src/module-elasticsuite-core/i18n/en_US.csv +++ b/src/module-elasticsuite-core/i18n/en_US.csv @@ -139,3 +139,5 @@ Autocomplete,Autocomplete "The number of suggested search terms that will be used for fetching results in the autocompletion box.","The number of suggested search terms that will be used for fetching results in the autocompletion box." "Stop the extension mechanism when the current search term of the user is suggested.","Stop the extension mechanism when the current search term of the user is suggested." "Default: No. When set to ""Yes"", this setting will discard the extension mechanism as soon as the exact search term entered by the user is part of the suggestions. Eg : When the user has finished to type ""computer"", if the list of suggested search terms is ""computer"", ""apple computer"", ""computer for kids"", only ""computer"" will be considered as it's exactly what the user has written.","Default: No. When set to ""Yes"", this setting will discard the extension mechanism as soon as the exact search term entered by the user is part of the suggestions. Eg : When the user has finished to type ""computer"", if the list of suggested search terms is ""computer"", ""apple computer"", ""computer for kids"", only ""computer"" will be considered as it's exactly what the user has written." +"Always use the user raw input for suggestions.","Always use the user raw input for suggestions." +"Default: No. When set to ""Yes"", this setting will always proceed to fetch suggestions on the query typed by the user in addition to the extended terms. Eg : When the user is typing ""comp"", the popular search term ""computer"" will be suggested, but products or categories matching either ""comp"" or ""computer"" will be shown.","Default: No. When set to ""Yes"", this setting will always proceed to fetch suggestions on the query typed by the user in addition to the extended terms. Eg : When the user is typing ""comp"", the popular search term ""computer"" will be suggested, but products or categories matching either ""comp"" or ""computer"" will be shown." diff --git a/src/module-elasticsuite-core/i18n/fr_FR.csv b/src/module-elasticsuite-core/i18n/fr_FR.csv index b88037a7e..0abf160d6 100644 --- a/src/module-elasticsuite-core/i18n/fr_FR.csv +++ b/src/module-elasticsuite-core/i18n/fr_FR.csv @@ -139,3 +139,5 @@ General,Général "The number of suggested search terms that will be used for fetching results in the autocompletion box.","Le nombre de termes de recherche suggérés qui seront utilisés pour obtenir des résultats dans l'autocomplétion'." "Stop the extension mechanism when the current search term of the user is suggested.","Arrêter le mécanisme d'extension lorsque le terme de recherche actuel de l'utilisateur fait partie des suggestions." "Default: No. When set to ""Yes"", this setting will discard the extension mechanism as soon as the exact search term entered by the user is part of the suggestions. Eg : When the user has finished to type ""computer"", if the list of suggested search terms is ""computer"", ""apple computer"", ""computer for kids"", only ""computer"" will be considered as it's exactly what the user has written.","Par défaut : Non. Lorsqu'il est défini sur ""Oui"", ce paramètre arrêtera le mécanisme d'extension dès que le terme de recherche exact saisi par l'utilisateur fait partie des suggestions. Exemple : lorsque l'utilisateur a terminé de taper ""ordinateur"", si la liste des termes de recherche suggérés est ""ordinateur"", ""ordinateur Apple"", ""ordinateur pour enfants"", seul ""ordinateur"" sera pris en compte car c'est exactement ce que l'utilisateur a écrit." +"Always use the user raw input for suggestions.","Toujours utiliser la saisie brute de l'utilisateur pour les suggestions." +"Default: No. When set to ""Yes"", this setting will always proceed to fetch suggestions on the query typed by the user in addition to the extended terms. Eg : When the user is typing ""comp"", the popular search term ""computer"" will be suggested, but products or categories matching either ""comp"" or ""computer"" will be shown.","Par défaut : Non. Lorsqu'il est défini sur ""Oui"", ce paramètre permettra toujours d'obtenir des suggestions basées sur la saisie utilisateur brute en plus des termes étendus. Par exemple : Lorsque l'utilisateur tape ""ord"", le terme populaire ""ordinateur"" sera suggéré, mais les produits ou catégories correspondant à ""ord"" ou ""ordinateur"" seront affichés." diff --git a/src/module-elasticsuite-core/i18n/nl_NL.csv b/src/module-elasticsuite-core/i18n/nl_NL.csv index f42871e9d..61b4bf025 100644 --- a/src/module-elasticsuite-core/i18n/nl_NL.csv +++ b/src/module-elasticsuite-core/i18n/nl_NL.csv @@ -129,3 +129,5 @@ "The number of suggested search terms that will be used for fetching results in the autocompletion box.","Het aantal voorgestelde zoektermen dat zal worden gebruikt om resultaten in het autocompletie-venster op te halen." "Stop the extension mechanism when the current search term of the user is suggested.","Stop het uitbreidingsmechanisme wanneer de huidige zoekterm van de gebruiker wordt voorgesteld." "Default: No. When set to ""Yes"", this setting will discard the extension mechanism as soon as the exact search term entered by the user is part of the suggestions. Eg : When the user has finished to type ""computer"", if the list of suggested search terms is ""computer"", ""apple computer"", ""computer for kids"", only ""computer"" will be considered as it's exactly what the user has written.","Standaard: Nee. Als ingesteld op ""Ja"", zal deze instelling het uitbreidingsmechanisme negeren zodra de exacte zoekterm die door de gebruiker is ingevoerd, deel uitmaakt van de suggesties. Bijv.: Wanneer de gebruiker klaar is met typen van ""computer"", en de lijst met voorgestelde zoektermen is ""computer"", ""apple computer"", ""computer voor kinderen"", wordt alleen ""computer"" overwogen omdat dat precies is wat de gebruiker heeft geschreven." +"Always use the user raw input for suggestions.","Altijd de ruwe invoer van de gebruiker gebruiken voor suggesties." +"Default: No. When set to ""Yes"", this setting will always proceed to fetch suggestions on the query typed by the user in addition to the extended terms. Eg : When the user is typing ""comp"", the popular search term ""computer"" will be suggested, but products or categories matching either ""comp"" or ""computer"" will be shown.","Standaard: Nee. Wanneer deze instelling op ""Ja"" is ingesteld, worden altijd suggesties opgehaald op basis van de ingevoerde zoekopdracht van de gebruiker naast de uitgebreide termen. Bijvoorbeeld: Wanneer de gebruiker ""comp"" typt, wordt de populaire zoekterm ""computer"" voorgesteld, maar producten of categorieën die overeenkomen met ""comp"" of ""computer"" worden weergegeven."