[gatewiki-commits] SF.net SVN: gatewiki:[1759] trunk/cow/grails-app/services/IndexingService. groovy

View: New views
1 Messages — Rating Filter:   Alert me  

[gatewiki-commits] SF.net SVN: gatewiki:[1759] trunk/cow/grails-app/services/IndexingService. groovy

by markagreenwood :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Revision: 1759
          http://gatewiki.svn.sourceforge.net/gatewiki/?rev=1759&view=rev
Author:   markagreenwood
Date:     2009-10-27 13:05:26 +0000 (Tue, 27 Oct 2009)

Log Message:
-----------
make suyre the solr indexing service uses the right port after proxying

Modified Paths:
--------------
    trunk/cow/grails-app/services/IndexingService.groovy

Modified: trunk/cow/grails-app/services/IndexingService.groovy
===================================================================
--- trunk/cow/grails-app/services/IndexingService.groovy 2009-10-27 12:47:20 UTC (rev 1758)
+++ trunk/cow/grails-app/services/IndexingService.groovy 2009-10-27 13:05:26 UTC (rev 1759)
@@ -38,9 +38,6 @@
   static final int INDEX_CMD = 0
   static final int DELETE_CMD = 1
   static final int UPDATE_CMD = 2
-
-  /** port that the solr server is running on */
-  int port
     
   /**
    *  Indexes the given url. If folder, it iterates through all documents
@@ -148,12 +145,7 @@
   boolean executeAnt(
     ServletRequest request, List<String> toIndex, String wikiId, int command,
     boolean asynchronousMode
-  ) {
-  
-    // assumming that the solr will have only one instance running
-    //TODO change this such that we support multiple instances
-    port = request.getServerPort()
-    
+  ) {  
     // command description
     String cmdDesc = "Indexing"
     switch(command) {
@@ -176,7 +168,7 @@
       }
       return true;
     } else {
-      return callAnt(port, toIndex, wikiId, command);
+      return callAnt(toIndex, wikiId, command);
     }
   } // executeAnt
 
@@ -193,7 +185,7 @@
    *          is started in the asynchronous mode, it will always return true.
    */
   public boolean callAnt(List<String> toIndex, String wikiId, int command) {
-    return callAnt(port, toIndex, wikiId, command)
+    return callAnt(toIndex, wikiId, command)
   }
 
   /**
@@ -208,13 +200,13 @@
    *          is started in the asynchronous mode, it will always return true.
    */
   private boolean callAnt(
-    int port, List<String> toIndex, String wikiId, int command
+    List<String> toIndex, String wikiId, int command
   ) {
     /** ant builder to start indexing in a different JVM */
     AntBuilder ant = new AntBuilder()
     
     // solrUrl
-    def solrUrl = "http://localhost:" + port + conf.gate.cow.solr.context
+    def solrUrl = conf.gate.cow.solr.baseUrl + conf.gate.cow.solr.context
     
     // command string
     def cmd = "index"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gatewiki-commits mailing list
gatewiki-commits@...
https://lists.sourceforge.net/lists/listinfo/gatewiki-commits