Repository navigation
Much faster snippets, custom PDO options, PHP 8.5 support and a round of fixes for string document IDs and the Redis engine.
Performance
snippet()/Highlighter::extractRelevant()is far faster on long text. Match positions are found in one regex pass instead of callingmb_stripos()with an offset in a loop, which re-counted characters from the start of the text on every match. A page of 20 snippets from ~73 KB documents drops from seconds to a few milliseconds; the snippets are unchanged. On PHP 8.4+ a few rare case pairs (e.g./ƛ,/ɤ) no longer match case-insensitively. Thanks @ChloeSartorelli. (#375, #376)
Added
- Custom PDO options through config. Pass them under the
optionskey inloadConfig(), e.g.PDO::MYSQL_ATTR_SSL_CAfor managed MySQL providers that require TLS. (#296) - PHP 8.5 support: no more deprecation notice for the MySQL buffered-query constant. Thanks @tiller1010. (#374)
- A snippet benchmark,
benchmark/bench_snippet.php.
Fixed
- String document IDs work again (e.g.
"FP_123"). Theinttype hints on the indexing and delete paths made inserting such documents throw aTypeError. (#365, #213) MySqlConnectordiscarded every PDO attribute, becausearray_merge()renumbered the integer option keys.RedisEngine:setFuzzyNoLimit(),setFuzzyMaxExpansions()andsearch()no longer raise dynamic-property and undefined-property warnings. Thanks @ChloeSartorelli. (#372, #373)RedisEngine:TNTSearch::getIndex()threwTyped property RedisEngine::$index must not be accessed before initialization, soinsert(),update()anddelete()could not be used. (#377)RedisEngine: integer document IDs are returned as integers, and results are sorted by document ID rather than in the server'sKEYSorder, as with the other engines. (#377)snippet()no longer raises a float-to-int deprecation notice when the match is near the end of the text. Thanks @ChloeSartorelli. (#370, #371)- An empty search word no longer makes
Highlighter::_extractLocations()loop forever. (#376)
Full Changelog: v5.3.0...v5.4.0