ahmedifhaam commented on a change in pull request #129: Replaced Processwrapper 
indexing method with SolrIndexer
URL: https://github.com/apache/drat/pull/129#discussion_r189426160
 
 

 ##########
 File path: proteus/src/main/java/backend/ProcessDratWrapper.java
 ##########
 @@ -104,8 +115,20 @@ public void crawl() throws Exception {
   }
 
   @Override
-  public void index() throws IOException, DratWrapperException {
-    simpleDratExec(INDEX_CMD, this.path);
+  public void index() throws IOException, DratWrapperException, 
InstantiationException, SolrServerException {
+      solrIndex();
+  }
+  
+  private synchronized void solrIndex() throws InstantiationException, 
SolrServerException, IOException {
+      DratLog idl = new DratLog("INDEXING");
+      idl.logInfo("Starting", null);
+      
System.setProperty(FileConstants.SOLR_INDEXER_CONFIG,FileConstants.SOLR_INDEXER_CONFIG_PATH);
+      SolrIndexer sIndexer = new 
SolrIndexer(FileConstants.SOLR_DRAT_URL,FileConstants.FILEMGR_URL);
+      sIndexer.indexAll(false);
+      sIndexer.commit();
+      sIndexer.optimize();
+      idl.logInfo("Comepleted",null);
 
 Review comment:
   will do

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to