Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14082795
D17598.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17598.diff
View Options
diff --git a/src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php b/src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php
--- a/src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php
+++ b/src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php
@@ -5,6 +5,8 @@
const EXTENSIONKEY = 'fulltext';
+ private $configurationVersion;
+
public function getExtensionName() {
return pht('Fulltext Engine');
}
@@ -12,6 +14,11 @@
public function getIndexVersion($object) {
$version = array();
+ // When "cluster.search" is reconfigured, new indexes which don't have any
+ // data yet may have been added. We err on the side of caution and assume
+ // that every document may need to be reindexed.
+ $version[] = $this->getConfigurationVersion();
+
if ($object instanceof PhabricatorApplicationTransactionInterface) {
// If this is a normal object with transactions, we only need to
// reindex it if there are new transactions (or comment edits).
@@ -88,5 +95,22 @@
return $comment_row['id'];
}
+ private function getConfigurationVersion() {
+ if ($this->configurationVersion === null) {
+ $this->configurationVersion = $this->newConfigurationVersion();
+ }
+ return $this->configurationVersion;
+ }
+
+ private function newConfigurationVersion() {
+ $raw = array(
+ 'services' => PhabricatorEnv::getEnvConfig('cluster.search'),
+ );
+
+ $json = phutil_json_encode($raw);
+
+ return PhabricatorHash::digestForIndex($json);
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 1:23 AM (16 h, 39 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6779199
Default Alt Text
D17598.diff (1 KB)
Attached To
Mode
D17598: When "cluster.search" changes, don't trust the old index versions
Attached
Detach File
Event Timeline
Log In to Comment