@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Stop indexing the chunk data objects for large Files stored in multiple chunks

Summary:
Ref T13164. See PHI766. Currently, when file data is stored in small chunks, we submit each chunk to the indexing engine.

However, chunks are never surfaced directly and can never be found via any search/query, so this work is pointless. Just skip it.

(It would be nice to do this a little more formally on `IndexableInterface` or similar as `isThisAnIndexableObject()`, but we'd have to add like a million empty "yes, index this always" methods to do that, and it seems unlikely that we'll end up with too many other objects like these.)

Test Plan:
- Ran `bin/harbormaster rebuild-log --id ... --force` before and after change, saw about 200 fewer queries after the change.
- Uploaded a uniquely named file and searched for it to make sure I didn't break that.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13164

Differential Revision: https://secure.phabricator.com/D19563

+13 -1
+13 -1
src/applications/files/storage/PhabricatorFile.php
··· 159 159 160 160 public function saveAndIndex() { 161 161 $this->save(); 162 - PhabricatorSearchWorker::queueDocumentForIndexing($this->getPHID()); 162 + 163 + if ($this->isIndexableFile()) { 164 + PhabricatorSearchWorker::queueDocumentForIndexing($this->getPHID()); 165 + } 166 + 163 167 return $this; 168 + } 169 + 170 + private function isIndexableFile() { 171 + if ($this->getIsChunk()) { 172 + return false; 173 + } 174 + 175 + return true; 164 176 } 165 177 166 178 public function getMonogram() {