blob: e21021f0d00004130f0c8b6f806e769e3cb7fff1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
<?php
/**
* Placeholder for the engine class. Keep this abstract until E7/E8 land so
* it is not auto-discovered as a selectable backend before it can operate.
*/
abstract class VyOSElasticModernFulltextStorageEngine
extends PhabricatorFulltextStorageEngine {
private $version = null;
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() {
if ($this->version === null) {
throw new Exception(
pht('Version not configured; call setVersion() or setService() first.'));
}
return $this->version;
}
public function getDocumentUri($type, $phid) {
return '/_doc/'.$phid;
}
public function getSearchUri(array $types) {
return '/_search';
}
public function getEngineIdentifier() {
return 'elasticsearch-modern';
}
public function getHostType() {
return new VyOSElasticModernHost($this);
}
public function reindexAbstractDocument(
PhabricatorSearchAbstractDocument $doc) {
throw new Exception(pht(
'reindexAbstractDocument() is not yet implemented on '.
'VyOSElasticModernFulltextStorageEngine; lands in Task E7.'));
}
public function executeSearch(PhabricatorSavedQuery $query) {
throw new Exception(pht(
'executeSearch() is not yet implemented; lands in Task E8.'));
}
public function indexExists() {
throw new Exception(pht(
'indexExists() is not yet implemented; lands in Task E8.'));
}
public function getIndexStats() {
throw new Exception(pht(
'getIndexStats() is not yet implemented; lands in Task E8.'));
}
}
|