Skip to content

Commit

Permalink
changed property solr.server into solr.api
Browse files Browse the repository at this point in the history
Issue imixs#554
  • Loading branch information
rsoika committed Oct 3, 2019
1 parent 50bc129 commit c7e56cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public class SolrIndexService {
private EntityManager manager;

@Inject
@ConfigProperty(name = "solr.server", defaultValue = "http://solr:8983")
private String host;
@ConfigProperty(name = "solr.api", defaultValue = "http://solr:8983")
private String api;

@Inject
@ConfigProperty(name = "solr.core", defaultValue = "imixs-workflow")
Expand Down Expand Up @@ -131,7 +131,7 @@ public class SolrIndexService {
@PostConstruct
public void init() {
// create rest client
restClient = new RestClient(host);
restClient = new RestClient(api);
if (user != null && !user.isEmpty()) {
BasicAuthenticator authenticator = new BasicAuthenticator(user, password);
restClient.registerRequestFilter(authenticator);
Expand All @@ -153,7 +153,7 @@ public void setup(@Observes SetupEvent setupEvent) throws RestAPIException {

// try to get the schma of the core...
try {
String existingSchema = restClient.get(host + "/api/cores/" + core + "/schema");
String existingSchema = restClient.get(api + "/api/cores/" + core + "/schema");
logger.info("...core - OK ");

// update schema
Expand Down Expand Up @@ -188,7 +188,7 @@ public void updateSchema(String schema) throws RestAPIException {
String schemaUpdate = buildUpdateSchema(schema);
// test if the schemaUdpate contains instructions....
if (!"{}".equals(schemaUpdate)) {
String uri = host + "/api/cores/" + core + "/schema";
String uri = api + "/api/cores/" + core + "/schema";
logger.info("...updating schema '" + core + "':");
logger.finest("..." + schemaUpdate);
restClient.post(uri, schemaUpdate, "application/json");
Expand Down Expand Up @@ -226,7 +226,7 @@ public void indexDocuments(List<ItemCollection> documents) throws RestAPIExcepti
logger.finest(xmlRequest);
}

String uri = host + "/solr/" + core + "/update?commit=true";
String uri = api + "/solr/" + core + "/update?commit=true";
restClient.post(uri, xmlRequest, "text/xml");
}

Expand Down Expand Up @@ -274,7 +274,7 @@ public void removeDocuments(List<String> documents) throws RestAPIException {
}
xmlDelete.append("</delete>");
String xmlRequest = xmlDelete.toString();
String uri = host + "/solr/" + core + "/update";
String uri = api + "/solr/" + core + "/update";
logger.finest("......delete documents '" + core + "':");
restClient.post(uri, xmlRequest, "text/xml");
}
Expand Down Expand Up @@ -337,7 +337,7 @@ public String query(String searchTerm, int pageSize, int pageIndex, SortOrder so

// URL Encode the query string....
try {
uri.append(host + "/solr/" + core + "/query");
uri.append(api + "/solr/" + core + "/query");

// set default operator?
if (defaultOperator == DefaultOperator.OR) {
Expand Down
4 changes: 2 additions & 2 deletions src/site/markdown/engine/luceneservice.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Apache Solr provides a lot of flexibility in configuration and offers additional

There is a set of optional properties which can be set to access the solr instance:

- _solr.server_ - solr host (default http://solr:8983);
- _solr.api_ - solr api endpoint (default host=http://solr:8983);
- _solr.core_ - the solr core (default 'imixs-workflow')
- _solr.configset_ - an optional solr config set (default set is '_default')
- _solr.user_ - optional user id to login
Expand All @@ -217,7 +217,7 @@ The optional parameter can be set together with the the index schema configurat
index.fields.analyze=
index.fields.noanalyze=datDate,txtWorkflowGroup,txtemail, datdate, datfrom, datto, numsequencenumber, txtUsername
# Solr configuration
solr.server=http://my-solr-host:8983
solr.api=http://my-solr-host:8983



Expand Down

0 comments on commit c7e56cb

Please sign in to comment.