You've got it right.  Here's a summary:

- "status" = "busy" means its in-process.  
- "status" = "idle" means its finished (success or failure).
- You can drill down further by looking at sub-elements under "statusMessages" :
 > if there is <str name="Aborted" /> , it means the last import was cancelled 
 > with "command=abort"
 > look at the body of <str name="" />.  
   o If it begins with "Indexing completed.", then it finished with a success.
   o If it begins with "Indexing failed.", then it finished with a failure.

Just be careful to test your script whenever you change DIH versions.  This 
status screen isn't the best and no doubt it will change sometime in the 
future.  Also, keep in mind that as soon as the next import begins the old 
statuses get lost so you'll need to plan your script runs around that.

Someday it'll be nice if we can come up with a better way than this to 
programitically interact with DIH...

James Dyer
E-Commerce Systems
Ingram Content Group
(615) 213-4311


-----Original Message-----
From: geeky2 [mailto:gee...@hotmail.com] 
Sent: Thursday, May 31, 2012 2:43 PM
To: solr-user@lucene.apache.org
Subject: possible status codes from solr during a (DIH) data import process

hello all,

i have been asked to write a small polling script (bash) to periodically
check the status of an import on our Master.  our import times are small,
but there are business reasons why we want to know the status of an import
after a specified amount of time.

i need to perform certain actions based on the "status" of the import, and
therefore need to quantify which tags to check and their appropriate states.

i am using the command from the DataImportHandler HTTP API to get the status
of the import:

OUTPUT=$(curl -v
http://${SERVER}:${PORT}/somecore/dataimport?command=status)




can someone tell me if i have these rules correct?

1) during an import - the status tag will have a busy state:

example:

  <str name="status">busy</str>

2) at the completion of an import (regardless of failure or success) the
status tag will have an "idle" state:

example:

  <str name="status">idle</str>


3) to determine if an import failed or succeeded - you must interrogate the
tags under   <lst name="statusMessages"> and specifically look for :

success:     
<str name="">Indexing completed. Added/Updated: 603378 documents. Deleted 0
documents.</str>

failure:     
<str name="">Indexing completed. Added/Updated: 603378 documents. Deleted 0
documents.</str>

thank you,


--
View this message in context: 
http://lucene.472066.n3.nabble.com/possible-status-codes-from-solr-during-a-DIH-data-import-process-tp3987110.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to