如何停止AEM中运行的/oak:index/cqTagLucene等OOTB索引并重新索引
How to Stop a Running OOTB Index in AEM
If you've got an out-of-the-box index like /oak:index/cqTagLucene chugging along for 4 days (thanks to those millions of PDF assets), here are the reliable ways to halt it cleanly before updating your exclude paths:
Method 1: Use the JMX Console (Most Straightforward)
This is the go-to method for stopping in-progress index builds:
- Navigate to your AEM instance's JMX console at
http://<your-aem-host>:<port>/system/console/jmx - Search for the
org.apache.jackrabbit.oak:name=IndexStats,type=QueryEngineMBean - Find the operation named
stopIndexing(String indexPath) - Enter the full path of your index (e.g.,
/oak:index/cqTagLucene) in the parameter field and click Invoke - Verify the index status by checking the
getIndexStatus(String indexPath)operation—it should returnIDLEonce stopped
Method 2: Directly Modify the Index Node via CRXDE Lite
If JMX isn't accessible or you prefer working with repository nodes:
- Open CRXDE Lite at
http://<your-aem-host>:<port>/crx/de - Navigate to the index node:
/oak:index/cqTagLucene - Locate the
reindexproperty (it's set totruesince the index is running) - Change
reindextofalseand save the node - Optional but recommended: Check the
/oak:index/cqTagLucene:asyncchild node—if it exists, delete it to clear any pending indexing tasks
Method 3: Run a Groovy Script (For Automation/Bulk Operations)
If you're comfortable with scripting, this works well for repeat tasks:
- Open the Groovy Console at
http://<your-aem-host>:<port>/groovyconsole - Paste the following script, replacing the index path with yours:
import org.apache.jackrabbit.oak.api.QueryEngine import org.apache.jackrabbit.oak.spi.query.QueryIndex def indexPath = "/oak:index/cqTagLucene" def queryEngine = osgi.getService(QueryEngine.class) queryEngine.stopIndexing(indexPath) println "Index ${indexPath} has been stopped. Current status: ${queryEngine.getIndexStatus(indexPath)}"
- Click Run Script to execute it
Post-Stop Tips Before Re-Running the Index
- Double-check that the index status is
IDLEusing JMX or CRXDE (look for theindexStatusproperty on the index node) - Add your
excludePathsproperty to the index node (e.g., exclude large PDF asset folders that don't need tagging indexing) - When you're ready to re-trigger, set
reindexback totrue—this will start the index build with your new exclude paths, which should be much faster
内容的提问来源于stack exchange,提问作者Mukesh Jha
相关产品推荐
相关产品推荐

