+ if (!($search_engine instanceof PhabricatorSearchEngineElastic)) {
+ throw new PhutilArgumentUsageException(
+ "This script currently only works if elasticsearch is enabled as a search backend\n".
+ "Please make sure that all your tasks have been indexed!");
+ }
+
+ $transactionTable = new ManiphestTransaction();
+ $taskTable = new ManiphestTask();
+
+ $conn = $taskTable->establishConnection('r');
+ $data = queryfx_all(
+ $conn,
+ 'SELECT t.phid AS dupPHID, t.title AS dupTitle, t.description AS dupDescription, t2.phid AS origPHID, t2.title AS origTitle, t2.description AS origDescription FROM %T t, %T tx, %T t2