{"id":17328359,"url":"https://github.com/dadoonet/spring-elasticsearch","last_synced_at":"2025-04-04T15:10:07.181Z","repository":{"id":636252,"uuid":"3410563","full_name":"dadoonet/spring-elasticsearch","owner":"dadoonet","description":"Spring factories for elasticsearch","archived":false,"fork":false,"pushed_at":"2023-11-08T04:48:28.000Z","size":1174,"stargazers_count":287,"open_issues_count":18,"forks_count":116,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-03-28T14:07:59.247Z","etag":null,"topics":["elasticsearch","spring","spring-factories"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dadoonet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-02-10T20:02:15.000Z","updated_at":"2025-01-03T21:43:17.000Z","dependencies_parsed_at":"2024-12-13T20:10:36.800Z","dependency_job_id":"e676fb92-9672-4bca-9f47-b7a508b313bf","html_url":"https://github.com/dadoonet/spring-elasticsearch","commit_stats":{"total_commits":609,"total_committers":15,"mean_commits":40.6,"dds":"0.40886699507389157","last_synced_commit":"af74637f04f0b9a6cc781b305adf80537c5b55af"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadoonet%2Fspring-elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadoonet%2Fspring-elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadoonet%2Fspring-elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadoonet%2Fspring-elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dadoonet","download_url":"https://codeload.github.com/dadoonet/spring-elasticsearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198463,"owners_count":20900080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","spring","spring-factories"],"created_at":"2024-10-15T14:23:42.546Z","updated_at":"2025-04-04T15:10:07.157Z","avatar_url":"https://github.com/dadoonet.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring factories for Elasticsearch\n\nWelcome to the Spring factories for [Elasticsearch](https://www.elastic.co/elasticsearch/) project.\n\nThe factory provides a [Java Rest Client for Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/)\nand automatically create index settings and templates based on what is found in the classpath:\n\n* `/es/_index_lifecycles/` for [index lifecycles policies](#index-lifecycles-policies)\n* `/es/INDEXNAME/_settings.json` for [index settings and mappings](#indices) for a given index `INDEXNAME`\n* `/es/INDEXNAME/_update_settings.json` to [update existing index settings and mappings](#indices) for a given index `INDEXNAME`\n* `/es/_component_templates/` for [component templates](#component-templates)\n* `/es/_index_templates/` for [index templates](#index-templates)\n* `/es/_pipelines/` for [ingest pipelines](#ingest-pipelines)\n* `/es/_aliases.json` for [aliases](#aliases)\n\n## Documentation\n\n* For 8.x elasticsearch versions, you are reading the latest documentation.\n* For 7.x elasticsearch versions, look at [es-7.x branch](https://github.com/dadoonet/spring-elasticsearch/tree/es-7.x).\n* For 6.x elasticsearch versions, look at [es-6.x branch](https://github.com/dadoonet/spring-elasticsearch/tree/es-6.x).\n* For 5.x elasticsearch versions, look at [es-5.x branch](https://github.com/dadoonet/spring-elasticsearch/tree/es-5.x).\n* For 2.x elasticsearch versions, look at [es-2.x branch](https://github.com/dadoonet/spring-elasticsearch/tree/es-2.x).\n* For 1.x elasticsearch versions, look at [es-1.4 branch](https://github.com/dadoonet/spring-elasticsearch/tree/es-1.4).\n* For 0.x elasticsearch versions, look at [0.x branch](https://github.com/dadoonet/spring-elasticsearch/tree/0.x).\n\n| spring-elasticsearch | elasticsearch | Spring | Release date |\n|:--------------------:|:-------------:|:------:|:------------:|\n|     8.7-SNAPSHOT     |     8.x       | 6.0.7  |              |\n|         7.1          |   7.0 - 7.x   | 5.3.15 |  2022-01-13  |\n|         7.0          |   7.0 - 7.x   | 5.3.8  |  2021-06-21  |\n|         6.7          |   6.7 - 6.x   | 5.1.3  |  2019-04-13  |\n|         6.2          |   6.0 - 6.x   | 5.1.3  |  2019-01-08  |\n|         6.1          |   6.0 - 6.x   | 5.0.7  |  2018-07-22  |\n|         6.0          |   6.0 - 6.x   | 5.0.3  |  2018-02-08  |\n|         5.0          |   5.0 - 5.x   | 4.3.10 |  2018-02-04  |\n|        2.2.0         |   2.0 - 2.4   | 4.2.3  |  2017-03-09  |\n|        2.1.0         |   2.0, 2.1    | 4.2.3  |  2015-11-25  |\n|        2.0.0         |      2.0      | 4.1.4  |  2015-10-25  |\n|        1.4.2         |     \u003c 2.0     | 4.1.4  |  2015-03-03  |\n|        1.4.1         |      1.4      | 4.1.4  |  2015-02-28  |\n|        1.4.0         |      1.4      | 4.1.4  |  2015-01-03  |\n|        1.3.0         |      1.3      | 4.0.6  |  2014-09-01  |\n|        1.0.0         |      1.0      | 3.2.2  |  2014-02-14  |\n\n## Build Status\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/fr.pilato.spring/spring-elasticsearch/badge.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/fr.pilato.spring/spring-elasticsearch/)\n[![Build Status](https://github.com/dadoonet/spring-elasticsearch/actions/workflows/maven.yml/badge.svg)](https://github.com/dadoonet/spring-elasticsearch/actions/workflows/maven.yml)\n\n## Release notes\n\n### Changes in 8.7\n\n* Update to Spring 6.0.7\n* Update to Java 17 (needed by Spring 6)\n* Update to Beyonder 8.6\n* Provides now the new official [Java Rest Client for Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/)\n* Removed deprecated templates\n* Removed deprecated XML support\n* As a side effect of a previous removal (TransportClient), async initialization of the client has been removed.\n* Deprecated `setProperties(Properties)` method.\n* Add a wait for yellow health when creating a new index\n\n### Changes in 7.1\n\n* Update to Beyonder 7.16 which brings in support for index lifecycles. \nYou can add your index lifecycles policies in the `_index_lifecycles` dir.\n\n### Major (breaking) changes in 7.0\n\n* The `TransportClient` has been removed.\n\n* As in Elasticsearch 7.x, only one single type is supported, you need to provide the mapping within\n  the index settings ( `_settings.json` file). As a consequence:\n * `forceMapping` setting has been replaced by `forceIndex`.\n * `mappings` setting has been replaced by `indices`.\n * `mergeMapping` setting has been removed.\n\n* `forceTemplate` setting has been removed. A template should be always updated.\n\n* `_template` dir has been deprecated by `_templates` dir.\n\n## Getting Started\n\n### Maven dependency\n\nImport spring-elasticsearch in you project `pom.xml` file:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003efr.pilato.spring\u003c/groupId\u003e\n  \u003cartifactId\u003espring-elasticsearch\u003c/artifactId\u003e\n  \u003cversion\u003e8.7\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nIf you want to set a specific version of the Elasticsearch Java client, add it to your `pom.xml` file:\n\n```xml\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eco.elastic.clients\u003c/groupId\u003e\n    \u003cartifactId\u003eelasticsearch-java\u003c/artifactId\u003e\n    \u003cversion\u003e${elasticsearch.version}\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eorg.elasticsearch.client\u003c/groupId\u003e\n    \u003cartifactId\u003eelasticsearch-rest-client\u003c/artifactId\u003e\n    \u003cversion\u003e${elasticsearch.version}\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nIf you want to try out the most recent SNAPSHOT version [deployed on Sonatype](https://oss.sonatype.org/content/repositories/snapshots/fr/pilato/spring/spring-elasticsearch/):\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003efr.pilato.spring\u003c/groupId\u003e\n  \u003cartifactId\u003espring-elasticsearch\u003c/artifactId\u003e\n  \u003cversion\u003e8.8-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nDon't forget to add if needed the following repository in your `pom.xml`:\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003eoss-snapshots\u003c/id\u003e\n        \u003cname\u003eSonatype OSS Snapshots\u003c/name\u003e\n        \u003curl\u003ehttps://s01.oss.sonatype.org/content/repositories/snapshots/\u003c/url\u003e\n        \u003creleases\u003e\u003cenabled\u003efalse\u003c/enabled\u003e\u003c/releases\u003e\n        \u003csnapshots\u003e\u003cenabled\u003etrue\u003c/enabled\u003e\u003c/snapshots\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\nIf you depend on an elasticsearch SNAPSHOT version, you need to add the following repository to your `pom.xml`:\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003eelastic-snapshots\u003c/id\u003e\n        \u003cname\u003eElastic Snapshots\u003c/name\u003e\n        \u003curl\u003ehttp://snapshots.elastic.co/maven/\u003c/url\u003e\n        \u003creleases\u003e\u003cenabled\u003efalse\u003c/enabled\u003e\u003c/releases\u003e\n        \u003csnapshots\u003e\u003cenabled\u003etrue\u003c/enabled\u003e\u003c/snapshots\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n### Logger\n\nWe are using [slf4j](http://www.slf4j.org/) for logging but you have to provide the logging implementation\nyou want to use and bind it.\n\nFor example for this project we are using for tests [log4j2](http://logging.apache.org/log4j/). \nIf you want to do so, add to your `pom.xml`:\n\n```xml\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n      \u003cgroupId\u003eorg.apache.logging.log4j\u003c/groupId\u003e\n      \u003cartifactId\u003elog4j-api\u003c/artifactId\u003e\n      \u003cversion\u003e2.20.0\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n      \u003cgroupId\u003eorg.apache.logging.log4j\u003c/groupId\u003e\n      \u003cartifactId\u003elog4j-slf4j2-impl\u003c/artifactId\u003e\n      \u003cversion\u003e2.20.0\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n      \u003cgroupId\u003eorg.apache.logging.log4j\u003c/groupId\u003e\n      \u003cartifactId\u003elog4j-core\u003c/artifactId\u003e\n      \u003cversion\u003e2.20.0\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n## Using Java Annotations\n\nLet's say you want to use Spring Java Annotations, here is a typical application you can build.\n\n`pom.xml`:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u003e\n    \u003cmodelVersion\u003e4.0.0\u003c/modelVersion\u003e\n\n    \u003cgroupId\u003efr.pilato.tests\u003c/groupId\u003e\n    \u003cartifactId\u003espring-elasticsearch-test\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003efr.pilato.spring\u003c/groupId\u003e\n            \u003cartifactId\u003espring-elasticsearch\u003c/artifactId\u003e\n            \u003cversion\u003e8.7\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\u003c/project\u003e\n```\n\n`App.java`:\n\n```java\npackage fr.pilato.tests;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.context.annotation.AnnotationConfigApplicationContext;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.stereotype.Component;\n\nimport java.io.IOException;\n\n@Component\npublic class RestApp {\n\n  @Configuration\n  public class AppConfig {\n    @Bean\n    public ElasticsearchClient esClient() {\n      ElasticsearchClientFactoryBean factory = new ElasticsearchClientFactoryBean();\n      factory.setEsNodes(new String[]{\"https://127.0.0.1:9200\"});\n      factory.setUsername(\"elastic\");\n      factory.setPassword(\"changeme\");\n      factory.afterPropertiesSet();\n      return factory.getObject();\n    }\n  }\n\n  @Autowired\n  private ElasticsearchClient client;\n\n  public static void main(String[] args) {\n    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();\n    context.scan(\"fr.pilato.tests\");\n    context.refresh();\n\n    RestApp p = context.getBean(RestApp.class);\n    p.run();\n\n    context.close();\n  }\n\n  private void run() {\n    // Run an advanced request\n    client.info();\n\n    // You still have access to the Low Level client\n    client.getLowLevel().performRequest(new Request(\"GET\", \"/\"));\n  }\n}\n```\n\n## Features\n\nThe factory provides a [Java Rest Client for Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/)\nand automatically create index settings and templates based on what is found in the classpath:\n\n* `/es/INDEXNAME/_settings.json` for [index settings and mappings](#indices) for a given index `INDEXNAME`\n* `/es/INDEXNAME/_update_settings.json` to [update existing index settings and mappings](#indices) for a given index `INDEXNAME`\n* `/es/_component_templates/` for [component templates](#component-templates)\n* `/es/_index_templates/` for [index templates](#index-templates)\n* `/es/_pipelines/` for [ingest pipelines](#ingest-pipelines)\n* `/es/_aliases.json` for [aliases](#aliases)\n* `/es/_index_lifecycles/` for [index lifecycles policies](#index-lifecycles-policies)\n\n### Autoscan\n\nBy default, the factory will scan the classpath inside the default `/es` directory.\nYou can disable the autoscan and then provide manually every name for indices, templates...\n\n```java\nElasticsearchClientFactoryBean factory = new ElasticsearchClientFactoryBean();\nfactory.setAutoscan(false);\nfactory.setIndices(new String[]{\"twitter\"});\n```\n\n### Default directory\n\nYou can change the default directory from `/es` to something else. The factory will look into this\ndirectory to find the indices and the settings for the indices, templates...\n\n```java\nElasticsearchClientFactoryBean factory = new ElasticsearchClientFactoryBean();\nfactory.setClasspathRoot(\"/foo\");\n```\n\n### Indices\n\nIf you add in your classpath a file named `/es/twitter/_settings.json`, it will be automatically applied to define\nsettings for your `twitter` index.\n\nFor example, create the following file `src/main/resources/es/twitter/_settings.json` in your project:\n\n```json\n{\n  \"settings\" : {\n    \"number_of_shards\" : 3,\n    \"number_of_replicas\" : 2\n  },\n  \"mappings\": {\n    \"properties\" : {\n      \"message\" : {\"type\" : \"text\", \"store\" : \"yes\"}\n    }\n  }\n}\n```\n\nIf you need to update settings for an existing index, let say `twitter`, add a file named  `/es/twitter/_update_settings.json` \nin your classpath. The factory will detect it and will try to update the settings:\n\n```json\n{\n  \"index\" : {\n    \"number_of_replicas\" : 1\n  }\n}\n```\n\nIf you want to remove the existing indices every time the factory starts, you can use the `forceIndex` option:\n\n```java\nElasticsearchClientFactoryBean factory = new ElasticsearchClientFactoryBean();\n// Be careful: IT WILL REMOVE ALL EXISTING DATA FOR THE MANAGED INDICES.\nfactory.setForceIndex(true);\n```\n\nBe careful: **IT WILL REMOVE ALL EXISTING DATA** FOR THE MANAGED INDICES.\n\n\n### Component templates\n\nThis feature will call the [Component Templates APIs](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-component-template.html).\nIt's very common to use it with [index templates](#index-templates).\n\nLet say you want to create a component template named `component1`. Just create a file named\n`/es/_component_templates/component1.json`:\n\n```json\n{\n  \"template\": {\n    \"mappings\": {\n      \"properties\": {\n        \"@timestamp\": {\n          \"type\": \"date\"\n        }\n      }\n    }\n  }\n}\n```\n\nLet say you want to create a component template named `component2`. Just create a file named\n`/es/_component_templates/component2.json`:\n\n```json\n{\n  \"template\": {\n    \"mappings\": {\n      \"runtime\": {\n        \"day_of_week\": {\n          \"type\": \"keyword\",\n          \"script\": {\n            \"source\": \"emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nYou can use then the 2 component templates in an index template as shown below.\n\n### Index templates\n\nThis feature will call the [Index Templates APIs](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html).\nIt can be used with [component templates](#component-templates).\n\nLet say you want to create an index template named `template_1`. Just create a file named \n`/es/_index_templates/template_1.json`:\n\n```json\n{\n  \"index_patterns\": [\"te*\", \"bar*\"],\n  \"template\": {\n    \"settings\": {\n      \"number_of_shards\": 1\n    },\n    \"mappings\": {\n      \"_source\": {\n        \"enabled\": true\n      },\n      \"properties\": {\n        \"host_name\": {\n          \"type\": \"keyword\"\n        },\n        \"created_at\": {\n          \"type\": \"date\",\n          \"format\": \"EEE MMM dd HH:mm:ss Z yyyy\"\n        }\n      }\n    },\n    \"aliases\": {\n      \"mydata\": { }\n    }\n  },\n  \"priority\": 500,\n  \"composed_of\": [\"component1\", \"component2\"],\n  \"version\": 3,\n  \"_meta\": {\n    \"description\": \"my custom\"\n  }\n}\n```\n\nNote that this index template is using the 2 component templates that have been defined in the previous section.\n\n### Aliases\n\nAn alias is helpful to define or remove an alias to a given index. You could also use an [index templates](#index-templates)\nto do that automatically when at index creation time, but you can also define a file `/es/_aliases.json`:\n\n```json\n{\n  \"actions\" : [\n    { \"remove\": { \"index\": \"test_1\", \"alias\": \"test\" } },\n    { \"add\":  { \"index\": \"test_2\", \"alias\": \"test\" } }\n  ]\n}\n```\n\nWhen the factory starts, it will automatically send the content to the [Aliases API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html)\nand move the alias `test` from index `test_1` to index `test_2`.\n\n### Ingest Pipelines\n\nThis feature will call the [Ingest Pipelines APIs](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html)\n\nLet say you want to create an ingest pipeline named `pipeline1`. Just create a file named\n`/es/_pipeline/pipeline1.json`:\n\n```json\n{\n  \"description\": \"My optional pipeline description\",\n  \"processors\": [\n    {\n      \"set\": {\n        \"description\": \"My optional processor description\",\n        \"field\": \"my-long-field\",\n        \"value\": 10\n      }\n    },\n    {\n      \"set\": {\n        \"description\": \"Set 'my-boolean-field' to true\",\n        \"field\": \"my-boolean-field\",\n        \"value\": true\n      }\n    },\n    {\n      \"lowercase\": {\n        \"field\": \"my-keyword-field\"\n      }\n    }\n  ]\n}\n```\n\n### Index Lifecycles Policies\n\nThis feature will call the [Index Lifecycle APIs](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html).\n\nLet say you want to create a policy named `policy1`. Just create a file named\n`/es/_index_lifecycles/policy1.json`:\n\n```json\n{\n  \"policy\": {\n    \"phases\": {\n      \"warm\": {\n        \"min_age\": \"10d\",\n        \"actions\": {\n          \"forcemerge\": {\n            \"max_num_segments\": 1\n          }\n        }\n      },\n      \"delete\": {\n        \"min_age\": \"30d\",\n        \"actions\": {\n          \"delete\": {}\n        }\n      }\n    }\n  }\n}\n```\n\nIt will be automatically loaded into elasticsearch when you start the factory.\nIf you want to apply this policy to your index, you can define the following settings for the index in\n`/es/twitter/_settings.json`:\n\n```json\n{\n\t\"settings\" : {\n\t\t\"index.lifecycle.name\": \"policy1\"\n\t}\n}\n```\n\n### SSL certificates\n\nIf you need to specify your own SSL certificates (self-signed certificates), you can use the `setSSLContext(SSLContext)`\nmethod to do this.\nYou can refer to the Elasticsearch [Low Level client documentation](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/_encrypted_communication.html)\nto see some examples. Once you have created a SSLContext, you can use it in the factory:\n\n```java\nPath trustStorePath = Paths.get(\"/path/to/truststore.p12\");\nKeyStore truststore = KeyStore.getInstance(\"pkcs12\");\ntry (InputStream is = Files.newInputStream(trustStorePath)) {\n    truststore.load(is, keyStorePass.toCharArray());\n}\nSSLContextBuilder sslBuilder = SSLContexts.custom().loadTrustMaterial(truststore, null);\nfinal SSLContext sslContext = sslBuilder.build();\n\nElasticsearchClientFactoryBean factory = new ElasticsearchClientFactoryBean();\nfactory.setSslContext(sslContext);\n```\n\n# Thanks\n\nSpecial thanks to\n\n- [Nicolas Huray](https://github.com/nhuray) for his contribution about\n[templates](https://github.com/dadoonet/spring-elasticsearch/pull/4)\n- [Nicolas Labrot](https://github.com/nithril) for his contribution about\n[async](https://github.com/dadoonet/spring-elasticsearch/pull/30)\n\n# Running tests\n\nIf you want to run tests (integration tests) from your IDE, you need to start first an elasticsearch instance.\nTests are expecting a node running at `https://localhost:9200` with the user `elastic` and `changeme` as the password.\n\nTo run the tests using Maven (on the CLI), just run:\n\n```sh\nmvn clean install\n```\n\nYou can change the target to run the tests. For example, if you want to run the tests against an elastic cloud instance:\n\n```shell\nmvn clean install -Dtests.cluster=https://ID.es.ZONE.PROVIDER.cloud.es.io -Dtests.cluster.user=myuser -Dtests.cluster.pass=YOURPASSWORD\n```\n\n# Release guide\n\nTo release the project you need to run the release plugin with the `release` profile as you need to sign the artifacts:\n\n```sh\nmvn release:prepare\ngit push --tags\ngit push\nmvn release:perform -Prelease\n```\n\nIf you need to skip the tests, run:\n\n```sh\nmvn release:perform -Prelease -Darguments=\"-DskipTests\"\n```\n\nIf everything is ok in https://s01.oss.sonatype.org/#stagingRepositories, you can perform the release with:\n\n```sh\nmvn nexus-staging:release\nmvn nexus-staging:drop\n```\n\nTo announce the release, run:\n\n```sh\ncd target/checkout\n# Run the following command if you want to check the announcement email\nmvn changes:announcement-generate\ncat target/announcement/announcement.vm\n\n# Announce the release (change your smtp username and password)\nmvn changes:announcement-mail -Dchanges.username='YourSmtpUserName' -Dchanges.password='YourSmtpUserPassword'\n```\n\n# License\n\nThis software is licensed under the Apache 2 license, quoted below.\n\n\tCopyright 2011-2023 David Pilato\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\"); you may not\n\tuse this file except in compliance with the License. You may obtain a copy of\n\tthe License at\n\t\n\t    http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n\tWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n\tLicense for the specific language governing permissions and limitations under\n\tthe License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadoonet%2Fspring-elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdadoonet%2Fspring-elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadoonet%2Fspring-elasticsearch/lists"}