On 5/27/2013 10:20 AM, Hans-Peter Stricker wrote: > Marvelous!! > > Once again: where could/should I have read this? What kinds of > concepts/keywords are "command" and "full-import"? (Couldn't find them > in any config file. Where are they explained?) > > Anyway: Now it works like a charm!
http://wiki.apache.org/solr/DataImportHandler#Commands The CommonParams.QT syntax that you used only works with SolrJ 4.0 and newer, and those versions have a shortcut that's slightly easier to read: query.setRequestHandler("/dataimport"); The reason that there are no real examples of using DIH with SolrJ is because if you are using SolrJ, it is expected that your application will be doing the indexing itself, with the add method on the server object. I'll point you once again to the database example: http://wiki.apache.org/solr/Solrj#Reading_data_from_a_database I do use DIH on occasion - whenever I do a full rebuild of my index, DIH does the job a lot faster than my own code. I handle it from SolrJ. Sending a full-import or delta-import command to Solr returns to SolrJ immediately. You will only see a failure on that request if something major fails with the request itself, it won't tell you anything about whether the import succeeded or failed. You must periodically check the status. Interpreting the status in a program is a complicated endeavor, because the status is human readable, not machine readable, and important information is added or removed from the response at various success and error stages. There have been a number of issues on this. I filed most of them: https://issues.apache.org/jira/browse/SOLR-2728 https://issues.apache.org/jira/browse/SOLR-2729 https://issues.apache.org/jira/browse/SOLR-3319 https://issues.apache.org/jira/browse/SOLR-3689 https://issues.apache.org/jira/browse/SOLR-4241 I do have SolrJ code that interprets DIH status, but it's tied up in a larger work and will require some cleanup before I can share it. Thanks, Shawn