Changeset 32378


Ignore:
Timestamp:
08/24/18 20:44:34 (3 years ago)
Author:
Georgiy Litvinov
Message:

Get solr servlet name from build properties. Fixed port number property name

Location:
gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java

    r32110 r32378  
    6262{
    6363
    64   public static final String SOLR_SERVLET_SUFFIX = "/solr";
    6564  protected static final String SORT_ORDER_PARAM = "sortOrder";
    6665  protected static final String SORT_ORDER_DESCENDING = "1";
     
    9796            globalProperties.load(Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream("global.properties"));
    9897            String host = globalProperties.getProperty("tomcat.server", "localhost");
    99             String port = globalProperties.getProperty("tomcat.port", "8383");
     98            String port = globalProperties.getProperty("tomcat.port.http", "8383");
    10099            String protocol = globalProperties.getProperty("tomcat.protocol", "http");
     100            String solrContext = globalProperties.getProperty("solr.context", "solr");
    101101           
    102102            String portStr = port.equals("80") ? "" : ":"+port;
    103             solr_servlet_base_url = protocol+"://"+host+portStr+SOLR_SERVLET_SUFFIX;
     103            solr_servlet_base_url = protocol+"://"+host+portStr+"/"+solrContext;
    104104        } catch(Exception e) {
    105105            logger.error("Error reading greenstone's tomcat solr server properties from global.properties", e);
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/SolrSearch.java

    r29711 r32378  
    3131public class SolrSearch extends LuceneSearch {
    3232
    33     public static final String SOLR_SERVLET_SUFFIX = "/solr";
    3433    static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.SolrSearch.class.getName());
    3534
     
    4746        globalProperties.load(Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream("global.properties"));
    4847        String host = globalProperties.getProperty("tomcat.server", "localhost");
    49         String port = globalProperties.getProperty("tomcat.port", "8383");
     48        String port = globalProperties.getProperty("tomcat.port.http", "8383");
    5049        String protocol = globalProperties.getProperty("tomcat.protocol", "http");
     50        String solrContext = globalProperties.getProperty("solr.context", "solr");
    5151       
    5252        String portStr = port.equals("80") ? "" : ":"+port;
    53         solr_servlet_base_url = protocol+"://"+host+portStr+SOLR_SERVLET_SUFFIX;
     53        solr_servlet_base_url = protocol+"://"+host+portStr+"/"+solrContext;
    5454    } catch(Exception e) {
    5555        logger.error("Error reading greenstone's tomcat solr server properties from global.properties", e);
Note: See TracChangeset for help on using the changeset viewer.