diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-23 15:14:02 +0300 |
|---|---|---|
| committer | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-23 15:14:02 +0300 |
| commit | 4d27ac74aff1ca47db53510bf07e9d083635175b (patch) | |
| tree | 894f7fe9f7c0afa7a590add770ca3c033c189221 /src/engine/VyOSElasticModernFulltextStorageEngine.php | |
| parent | e36bce7dee75eccf67ae4737452275a6a01d7bb9 (diff) | |
| download | phorge-elasticsearch-modern-4d27ac74aff1ca47db53510bf07e9d083635175b.tar.gz phorge-elasticsearch-modern-4d27ac74aff1ca47db53510bf07e9d083635175b.zip | |
fix: correct Phase-0 findings from promotion PR review (3 issues)
1. TestDouble signatures: indexExists() and getIndexStats() in
VyOSElasticModernFulltextStorageEngineTestDouble were missing the
nullable host parameter added in E7/E8, causing a PHP fatal on
'arc unit --everything'.
2. buildSpec() zero-query sort bug: the falsy check
(!$query->getParameter('query')) incorrectly treats the string '0'
as empty (PHP falsy), enabling date-sorted path for a real search
term. Changed to explicit null/empty-string checks to match the
existing must-clause guard on line 316.
All 22 unit tests now pass.
🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php')
| -rw-r--r-- | src/engine/VyOSElasticModernFulltextStorageEngine.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/engine/VyOSElasticModernFulltextStorageEngine.php b/src/engine/VyOSElasticModernFulltextStorageEngine.php index 4c14ce0..7fc7fd7 100644 --- a/src/engine/VyOSElasticModernFulltextStorageEngine.php +++ b/src/engine/VyOSElasticModernFulltextStorageEngine.php @@ -410,7 +410,8 @@ abstract class VyOSElasticModernFulltextStorageEngine ), ); - if (!$query->getParameter('query')) { + $sort_query_string = $query->getParameter('query'); + if ($sort_query_string === null || $sort_query_string === '') { $spec['sort'] = array( array('dateCreated' => 'desc'), ); |
