-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Open-MBEE/feature/MMS-1002
Feature/mms 1002
- Loading branch information
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
crud/src/main/java/org/openmbee/sdvc/crud/config/ElasticsearchConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.openmbee.sdvc.crud.config; | ||
|
||
import org.apache.http.HttpHost; | ||
import org.openmbee.sdvc.core.config.PersistenceJPAConfig; | ||
import org.openmbee.sdvc.core.domains.Project; | ||
import org.openmbee.sdvc.core.repositories.ProjectRepository; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.core.env.Environment; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.elasticsearch.client.RestClientBuilder; | ||
import org.elasticsearch.client.RestHighLevelClient; | ||
import org.elasticsearch.client.RestClient; | ||
|
||
|
||
@Configuration | ||
public class ElasticsearchConfig { | ||
|
||
@Value("${elasticsearch.host}") | ||
private String elasticsearchHost; | ||
|
||
@Bean(destroyMethod = "close") | ||
public RestHighLevelClient restClient() { | ||
RestHighLevelClient client = new RestHighLevelClient( | ||
RestClient.builder(new HttpHost(elasticsearchHost))); | ||
// :TODO can pass other params to config here, like loading the schema..to be over thought later | ||
return client; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters