summaryrefslogtreecommitdiff
path: root/src/engine/VyOSElasticModernFulltextStorageEngine.php
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-22 12:00:28 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-05-23 13:48:42 +0300
commit51ceab16c95efc5527445788cb83f0289675d0bf (patch)
tree4a8c66a9d741155b7f4e21945b85e6d645ecfbac /src/engine/VyOSElasticModernFulltextStorageEngine.php
parent58ab9f6cacf8735adec2413e7404b34fc129f8a5 (diff)
downloadphorge-elasticsearch-modern-51ceab16c95efc5527445788cb83f0289675d0bf.tar.gz
phorge-elasticsearch-modern-51ceab16c95efc5527445788cb83f0289675d0bf.zip
E6-E8: Apply code-quality fixes from review
- Remove dead $fields assignment in buildSpec() (copy-paste artifact from bundled engine; never actually used). - Revert executeSearch catch from Throwable back to Exception. The earlier lint-driven widening was over-broad: Error subclasses (TypeError, etc.) should propagate immediately, not be aggregated into the per-host failover loop. Comment added explaining the intent. 🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php')
-rw-r--r--src/engine/VyOSElasticModernFulltextStorageEngine.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/engine/VyOSElasticModernFulltextStorageEngine.php b/src/engine/VyOSElasticModernFulltextStorageEngine.php
index 199f2c8..c49ff5e 100644
--- a/src/engine/VyOSElasticModernFulltextStorageEngine.php
+++ b/src/engine/VyOSElasticModernFulltextStorageEngine.php
@@ -296,7 +296,12 @@ abstract class VyOSElasticModernFulltextStorageEngine
$response = $this->executeRequest($host, $uri, $spec);
$phids = ipull($response['hits']['hits'], '_id');
return $phids;
- } catch (Throwable $e) {
+ } catch (Exception $e) {
+ // Catches HTTPFutureResponseStatus and other network/HTTP exceptions
+ // raised by executeRequest(). PHP Error subclasses (TypeError, etc.)
+ // are intentionally NOT caught -- they indicate programming bugs that
+ // should propagate immediately, not get aggregated into the per-host
+ // failover.
$exceptions[] = $e;
}
}
@@ -309,7 +314,6 @@ abstract class VyOSElasticModernFulltextStorageEngine
$q = new PhabricatorElasticsearchQueryBuilder();
$query_string = $query->getParameter('query');
if (strlen($query_string)) {
- $fields = $this->getTypeConstants('PhabricatorSearchDocumentFieldType');
$q->addMustClause(array(
'simple_query_string' => array(
'query' => $query_string,