#pragma once
#include "common_action.h"

class TModifyAction: public TCommonAction {
public:
    static TFactory::TRegistrator<TModifyAction> Registrator;
    virtual void DoPrepare() {
        TString indexName = GetFirstIndexerName();
        ModifyResult = Document->GetDocument().IsNeedRestore()
            ? IndexersThread->ProcessUpdate(Document, indexName, false)
            : IndexersThread->ProcessDelete(Document, indexName);
        ModifyResult.UpdateStatus(TModifyResult::REINDEX);
    }
};
