diff --git a/composer.lock b/composer.lock index 7833cdc..6676361 100644 --- a/composer.lock +++ b/composer.lock @@ -85,12 +85,12 @@ "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "55d1411d1c4fd867ca8585844cfc8e23dbc43682" + "reference": "7560f125c9c2912524d10434b0b8a9173a5763bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/55d1411d1c4fd867ca8585844cfc8e23dbc43682", - "reference": "55d1411d1c4fd867ca8585844cfc8e23dbc43682", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/7560f125c9c2912524d10434b0b8a9173a5763bf", + "reference": "7560f125c9c2912524d10434b0b8a9173a5763bf", "shasum": "" }, "require": { @@ -147,7 +147,7 @@ "type": "github" } ], - "time": "2026-01-02T12:22:10+00:00" + "time": "2026-03-02T15:04:31+00:00" }, { "name": "composer/composer", @@ -155,12 +155,12 @@ "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "5f9ad9f174bb07a482beb2ef8cea136960fb027e" + "reference": "f8a87966f77267f041949ca9785df6992ec4a128" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/5f9ad9f174bb07a482beb2ef8cea136960fb027e", - "reference": "5f9ad9f174bb07a482beb2ef8cea136960fb027e", + "url": "https://api.github.com/repos/composer/composer/zipball/f8a87966f77267f041949ca9785df6992ec4a128", + "reference": "f8a87966f77267f041949ca9785df6992ec4a128", "shasum": "" }, "require": { @@ -261,7 +261,7 @@ "type": "github" } ], - "time": "2026-02-23T15:19:10+00:00" + "time": "2026-03-06T11:33:52+00:00" }, { "name": "composer/metadata-minifier", @@ -1251,12 +1251,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7b1f1c37eff5910ddda2831345467e593a5120ad" + "reference": "49257c96304c508223815ee965c251e7c79e614e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7b1f1c37eff5910ddda2831345467e593a5120ad", - "reference": "7b1f1c37eff5910ddda2831345467e593a5120ad", + "url": "https://api.github.com/repos/symfony/console/zipball/49257c96304c508223815ee965c251e7c79e614e", + "reference": "49257c96304c508223815ee965c251e7c79e614e", "shasum": "" }, "require": { @@ -1341,7 +1341,7 @@ "type": "tidelift" } ], - "time": "2026-02-23T15:42:15+00:00" + "time": "2026-03-06T13:31:08+00:00" }, { "name": "symfony/dependency-injection", @@ -1349,12 +1349,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "91e49958b8a6092e48e4711894a1aeb1b151c62a" + "reference": "d95712d0e9446b9f244b64811ffb6af7b7434213" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/91e49958b8a6092e48e4711894a1aeb1b151c62a", - "reference": "91e49958b8a6092e48e4711894a1aeb1b151c62a", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/d95712d0e9446b9f244b64811ffb6af7b7434213", + "reference": "d95712d0e9446b9f244b64811ffb6af7b7434213", "shasum": "" }, "require": { @@ -1426,7 +1426,7 @@ "type": "tidelift" } ], - "time": "2026-02-24T15:33:38+00:00" + "time": "2026-02-26T12:16:01+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1506,12 +1506,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "a16175055601091ab53d485071ee68f314b40309" + "reference": "887783fbf51c9a30ac67bf751a3a8829e4d7f2db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a16175055601091ab53d485071ee68f314b40309", - "reference": "a16175055601091ab53d485071ee68f314b40309", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/887783fbf51c9a30ac67bf751a3a8829e4d7f2db", + "reference": "887783fbf51c9a30ac67bf751a3a8829e4d7f2db", "shasum": "" }, "require": { @@ -1570,7 +1570,7 @@ "type": "tidelift" } ], - "time": "2026-02-10T15:29:17+00:00" + "time": "2026-03-02T09:38:43+00:00" }, { "name": "symfony/finder", @@ -1578,12 +1578,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4009772b4f37203e952e4c47f0272312f4c151e3" + "reference": "e4b85e3592033f41426e61995f515cec73c9613b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4009772b4f37203e952e4c47f0272312f4c151e3", - "reference": "4009772b4f37203e952e4c47f0272312f4c151e3", + "url": "https://api.github.com/repos/symfony/finder/zipball/e4b85e3592033f41426e61995f515cec73c9613b", + "reference": "e4b85e3592033f41426e61995f515cec73c9613b", "shasum": "" }, "require": { @@ -1639,7 +1639,7 @@ "type": "tidelift" } ], - "time": "2026-01-29T09:42:01+00:00" + "time": "2026-01-30T22:08:33+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2868,12 +2868,12 @@ "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8c360e27327c8bd29e1c57721574709d0d706118" + "reference": "50f0d9c9d0e3cff1163c959c50aaaaa4a7115f08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8c360e27327c8bd29e1c57721574709d0d706118", - "reference": "8c360e27327c8bd29e1c57721574709d0d706118", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50f0d9c9d0e3cff1163c959c50aaaaa4a7115f08", + "reference": "50f0d9c9d0e3cff1163c959c50aaaaa4a7115f08", "shasum": "" }, "require": { @@ -2919,7 +2919,7 @@ "issues": "https://github.com/nikic/PHP-Parser/issues", "source": "https://github.com/nikic/PHP-Parser/tree/master" }, - "time": "2025-12-06T20:24:35+00:00" + "time": "2026-02-26T13:20:22+00:00" }, { "name": "phar-io/manifest", @@ -3046,12 +3046,12 @@ "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "ca8f87122c8c7e7efd649190f43eb25420ca959c" + "reference": "4d4ad14907af751b3f924d6083492c2f22a76c00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ca8f87122c8c7e7efd649190f43eb25420ca959c", - "reference": "ca8f87122c8c7e7efd649190f43eb25420ca959c", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/4d4ad14907af751b3f924d6083492c2f22a76c00", + "reference": "4d4ad14907af751b3f924d6083492c2f22a76c00", "shasum": "" }, "require": { @@ -3086,15 +3086,15 @@ "issues": "https://github.com/phpstan/phpdoc-parser/issues", "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.x" }, - "time": "2026-02-24T19:59:19+00:00" + "time": "2026-02-26T12:23:26+00:00" }, { "name": "phpstan/phpstan", "version": "1.12.x-dev", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8", - "reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/37982d6fc7cbb746dda7773530cda557cdf119e1", + "reference": "37982d6fc7cbb746dda7773530cda557cdf119e1", "shasum": "" }, "require": { @@ -3139,7 +3139,7 @@ "type": "github" } ], - "time": "2025-09-30T10:16:31+00:00" + "time": "2026-02-28T20:30:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3478,12 +3478,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a8ed8c5d85b7cb6768e2829b4ee507e880e9f22e" + "reference": "a71778ade547d17881d1039314375ec273a0b32f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a8ed8c5d85b7cb6768e2829b4ee507e880e9f22e", - "reference": "a8ed8c5d85b7cb6768e2829b4ee507e880e9f22e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a71778ade547d17881d1039314375ec273a0b32f", + "reference": "a71778ade547d17881d1039314375ec273a0b32f", "shasum": "" }, "require": { @@ -3561,27 +3561,11 @@ }, "funding": [ { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://liberapay.com/sebastianbergmann", - "type": "liberapay" - }, - { - "url": "https://thanks.dev/u/gh/sebastianbergmann", - "type": "thanks_dev" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" + "url": "https://phpunit.de/sponsoring.html", + "type": "other" } ], - "time": "2026-02-23T16:12:28+00:00" + "time": "2026-03-03T16:43:55+00:00" }, { "name": "sebastian/cli-parser", @@ -4666,12 +4650,12 @@ "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "da3e86253854944fefbd9f3558c932b58ff82f63" + "reference": "101786698b7686dc5c26aafe941e4791dbe0efee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/da3e86253854944fefbd9f3558c932b58ff82f63", - "reference": "da3e86253854944fefbd9f3558c932b58ff82f63", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/101786698b7686dc5c26aafe941e4791dbe0efee", + "reference": "101786698b7686dc5c26aafe941e4791dbe0efee", "shasum": "" }, "require": { @@ -4737,7 +4721,7 @@ "type": "thanks_dev" } ], - "time": "2026-02-21T01:49:20+00:00" + "time": "2026-03-07T04:19:43+00:00" }, { "name": "theseer/tokenizer", @@ -4792,10 +4776,10 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.6.0" + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.9.0" } diff --git a/src/ManticoreSearch/Client.php b/src/ManticoreSearch/Client.php index d115533..059d281 100755 --- a/src/ManticoreSearch/Client.php +++ b/src/ManticoreSearch/Client.php @@ -695,8 +695,12 @@ private function processSuggestion( $docMap->put($suggestWord, $suggestion['docs']); } + // If the word already has an exact match (distance=0), it's a real word — never merge it. + // Merging "how"+"to" into "howto" just because CALL SUGGEST returns something is wrong. + $hasExactMatch = (bool)array_filter($suggestions, fn($s) => $s['distance'] === 0); + // Smart merge logic - try to merge with next word if conditions are met - $mergeResult = $this->tryMergeWithNext( + $mergeResult = $hasExactMatch ? null : $this->tryMergeWithNext( $word, $i, $normalized,