summaryrefslogtreecommitdiff
path: root/src/engine/VyOSElasticModernFulltextStorageEngine.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php')
-rw-r--r--src/engine/VyOSElasticModernFulltextStorageEngine.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/engine/VyOSElasticModernFulltextStorageEngine.php b/src/engine/VyOSElasticModernFulltextStorageEngine.php
index f11eeab..60683b1 100644
--- a/src/engine/VyOSElasticModernFulltextStorageEngine.php
+++ b/src/engine/VyOSElasticModernFulltextStorageEngine.php
@@ -7,6 +7,27 @@
abstract class VyOSElasticModernFulltextStorageEngine
extends PhabricatorFulltextStorageEngine {
+ private $version;
+
+ public function setVersion($version) {
+ $version = (int)$version;
+ if ($version < 7) {
+ throw new Exception(
+ pht(
+ 'Unsupported Elasticsearch version "%d" for the '.
+ '"elasticsearch-modern" engine. This engine supports version 7 '.
+ 'and above (Elasticsearch 7.x, 8.x, or OpenSearch 1.x/2.x/3.x). '.
+ 'For ES 5.x, use the bundled "elasticsearch" engine instead.',
+ $version));
+ }
+ $this->version = $version;
+ return $this;
+ }
+
+ public function getVersion() {
+ return $this->version;
+ }
+
public function getEngineIdentifier() {
return 'elasticsearch-modern';
}