├── .gradle ├── 2.1 │ └── taskArtifacts │ │ ├── cache.properties │ │ ├── cache.properties.lock │ │ ├── fileHashes.bin │ │ ├── fileSnapshots.bin │ │ ├── outputFileStates.bin │ │ └── taskArtifacts.bin └── 2.2 │ └── taskArtifacts │ ├── cache.properties │ ├── cache.properties.lock │ ├── fileHashes.bin │ ├── fileSnapshots.bin │ ├── outputFileStates.bin │ └── taskArtifacts.bin ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── libraries │ ├── Gradle__aopalliance_aopalliance_1_0.xml │ ├── Gradle__ch_qos_logback_logback_classic_1_1_2.xml │ ├── Gradle__ch_qos_logback_logback_core_1_1_2.xml │ ├── Gradle__com_codahale_metrics_metrics_core_3_0_2.xml │ ├── Gradle__com_datastax_cassandra_cassandra_driver_core_2_0_4.xml │ ├── Gradle__com_datastax_cassandra_cassandra_driver_dse_2_0_4.xml │ ├── Gradle__com_fasterxml_classmate_1_0_0.xml │ ├── Gradle__com_fasterxml_jackson_core_jackson_annotations_2_4_0.xml │ ├── Gradle__com_fasterxml_jackson_core_jackson_core_2_4_4.xml │ ├── Gradle__com_fasterxml_jackson_core_jackson_databind_2_4_4.xml │ ├── Gradle__com_google_guava_guava_15_0.xml │ ├── Gradle__com_spatial4j_spatial4j_0_4_1.xml │ ├── Gradle__commons_collections_commons_collections_3_2_1.xml │ ├── Gradle__commons_lang_commons_lang_2_6.xml │ ├── Gradle__commons_logging_commons_logging_1_2.xml │ ├── Gradle__io_netty_netty_3_9_0_Final.xml │ ├── Gradle__javax_validation_validation_api_1_1_0_Final.xml │ ├── Gradle__joda_time_joda_time_2_4.xml │ ├── Gradle__junit_junit_4_11.xml │ ├── Gradle__org_antlr_antlr_runtime_3_5.xml │ ├── Gradle__org_apache_lucene_lucene_analyzers_common_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_codecs_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_core_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_grouping_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_highlighter_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_join_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_memory_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_misc_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_queries_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_queryparser_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_sandbox_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_spatial_4_9_0.xml │ ├── Gradle__org_apache_lucene_lucene_suggest_4_9_0.xml │ ├── Gradle__org_apache_tomcat_embed_tomcat_embed_core_8_0_15.xml │ ├── Gradle__org_apache_tomcat_embed_tomcat_embed_el_8_0_15.xml │ ├── Gradle__org_apache_tomcat_embed_tomcat_embed_logging_juli_8_0_15.xml │ ├── Gradle__org_apache_tomcat_embed_tomcat_embed_websocket_8_0_15.xml │ ├── Gradle__org_elasticsearch_elasticsearch_1_3_2.xml │ ├── Gradle__org_hamcrest_hamcrest_core_1_3.xml │ ├── Gradle__org_hibernate_hibernate_validator_5_1_3_Final.xml │ ├── Gradle__org_jboss_logging_jboss_logging_3_1_3_GA.xml │ ├── Gradle__org_liquibase_liquibase_core_3_1_1.xml │ ├── Gradle__org_ow2_asm_asm_4_1.xml │ ├── Gradle__org_ow2_asm_asm_commons_4_1.xml │ ├── Gradle__org_slf4j_jcl_over_slf4j_1_7_7.xml │ ├── Gradle__org_slf4j_jul_to_slf4j_1_7_7.xml │ ├── Gradle__org_slf4j_log4j_over_slf4j_1_7_7.xml │ ├── Gradle__org_slf4j_slf4j_api_1_7_7.xml │ ├── Gradle__org_springframework_boot_spring_boot_1_2_0_RELEASE.xml │ ├── Gradle__org_springframework_boot_spring_boot_actuator_1_2_0_RELEASE.xml │ ├── Gradle__org_springframework_boot_spring_boot_autoconfigure_1_2_0_RELEASE.xml │ ├── Gradle__org_springframework_boot_spring_boot_starter_1_2_0_RELEASE.xml │ ├── Gradle__org_springframework_boot_spring_boot_starter_actuator_1_2_0_RELEASE.xml │ ├── Gradle__org_springframework_boot_spring_boot_starter_data_elasticsearch_1_2_0_RELEASE.xml │ ├── Gradle__org_springframework_boot_spring_boot_starter_logging_1_2_0_RELEASE.xml │ ├── Gradle__org_springframework_boot_spring_boot_starter_tomcat_1_2_0_RELEASE.xml │ ├── Gradle__org_springframework_boot_spring_boot_starter_web_1_2_0_RELEASE.xml │ ├── Gradle__org_springframework_data_spring_cql_1_1_1_RELEASE.xml │ ├── Gradle__org_springframework_data_spring_data_cassandra_1_1_1_RELEASE.xml │ ├── Gradle__org_springframework_data_spring_data_commons_1_9_1_RELEASE.xml │ ├── Gradle__org_springframework_data_spring_data_elasticsearch_1_1_1_RELEASE.xml │ ├── Gradle__org_springframework_spring_aop_4_1_3_RELEASE.xml │ ├── Gradle__org_springframework_spring_beans_4_1_3_RELEASE.xml │ ├── Gradle__org_springframework_spring_context_4_1_3_RELEASE.xml │ ├── Gradle__org_springframework_spring_core_4_1_3_RELEASE.xml │ ├── Gradle__org_springframework_spring_expression_4_1_3_RELEASE.xml │ ├── Gradle__org_springframework_spring_test_4_1_2_RELEASE.xml │ ├── Gradle__org_springframework_spring_tx_4_1_3_RELEASE.xml │ ├── Gradle__org_springframework_spring_web_4_1_3_RELEASE.xml │ ├── Gradle__org_springframework_spring_webmvc_4_1_3_RELEASE.xml │ └── Gradle__org_yaml_snakeyaml_1_14.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml ├── vcs.xml └── workspace.xml ├── Demo.java ├── README.md ├── build.gradle ├── build ├── classes │ ├── main │ │ └── co │ │ │ └── paan │ │ │ ├── application │ │ │ └── Application.class │ │ │ ├── configuration │ │ │ └── ElasticsearchConfiguration.class │ │ │ ├── entities │ │ │ ├── Post.class │ │ │ └── Tag.class │ │ │ ├── repository │ │ │ └── PostRepository.class │ │ │ └── service │ │ │ ├── PostService.class │ │ │ └── impl │ │ │ └── PostServiceImpl.class │ └── test │ │ └── co │ │ └── paan │ │ └── service │ │ └── impl │ │ └── PostServiceImplTest.class ├── libs │ └── spring-data-elasticsearch-sample-1.0.jar ├── reports │ └── tests │ │ ├── classes │ │ └── co.paan.service.impl.PostServiceImplTest.html │ │ ├── css │ │ ├── base-style.css │ │ └── style.css │ │ ├── index.html │ │ ├── js │ │ └── report.js │ │ └── packages │ │ └── co.paan.service.impl.html ├── resources │ └── main │ │ └── elasticsearch.properties ├── test-results │ ├── TEST-co.paan.service.impl.PostServiceImplTest.xml │ └── binary │ │ └── test │ │ ├── output.bin │ │ ├── output.bin.idx │ │ └── results.bin └── tmp │ └── jar │ └── MANIFEST.MF ├── data └── elasticsearch │ └── nodes │ └── 0 │ ├── _state │ └── global-8 │ └── node.lock ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle ├── spring-data-elasticsearch-sample.iml └── src ├── main ├── java │ └── co │ │ └── paan │ │ ├── application │ │ └── Application.java │ │ ├── configuration │ │ └── ElasticsearchConfiguration.java │ │ ├── entities │ │ ├── Post.java │ │ └── Tag.java │ │ ├── repository │ │ └── PostRepository.java │ │ └── service │ │ ├── PostService.java │ │ └── impl │ │ └── PostServiceImpl.java └── resources │ └── elasticsearch.properties └── test └── java └── co └── paan └── service └── impl └── PostServiceImplTest.java /.gradle/2.1/taskArtifacts/cache.properties: -------------------------------------------------------------------------------- 1 | #Sun Dec 28 15:11:36 ICT 2014 2 | -------------------------------------------------------------------------------- /.gradle/2.1/taskArtifacts/cache.properties.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.1/taskArtifacts/cache.properties.lock -------------------------------------------------------------------------------- /.gradle/2.1/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.1/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/2.1/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.1/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /.gradle/2.1/taskArtifacts/outputFileStates.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.1/taskArtifacts/outputFileStates.bin -------------------------------------------------------------------------------- /.gradle/2.1/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.1/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /.gradle/2.2/taskArtifacts/cache.properties: -------------------------------------------------------------------------------- 1 | #Sun Dec 28 15:51:35 ICT 2014 2 | -------------------------------------------------------------------------------- /.gradle/2.2/taskArtifacts/cache.properties.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.2/taskArtifacts/cache.properties.lock -------------------------------------------------------------------------------- /.gradle/2.2/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.2/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/2.2/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.2/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /.gradle/2.2/taskArtifacts/outputFileStates.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.2/taskArtifacts/outputFileStates.bin -------------------------------------------------------------------------------- /.gradle/2.2/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/.gradle/2.2/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | spring-data-elasticsearch-sample -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__aopalliance_aopalliance_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__ch_qos_logback_logback_classic_1_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__ch_qos_logback_logback_core_1_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_codahale_metrics_metrics_core_3_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_datastax_cassandra_cassandra_driver_core_2_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_datastax_cassandra_cassandra_driver_dse_2_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_fasterxml_classmate_1_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_annotations_2_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_4_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_databind_2_4_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_google_guava_guava_15_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_spatial4j_spatial4j_0_4_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__commons_collections_commons_collections_3_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__commons_lang_commons_lang_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__commons_logging_commons_logging_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__io_netty_netty_3_9_0_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__javax_validation_validation_api_1_1_0_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__joda_time_joda_time_2_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__junit_junit_4_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_antlr_antlr_runtime_3_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_analyzers_common_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_codecs_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_core_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_grouping_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_highlighter_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_join_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_memory_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_misc_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_queries_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_queryparser_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_sandbox_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_spatial_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_lucene_lucene_suggest_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_tomcat_embed_tomcat_embed_core_8_0_15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_tomcat_embed_tomcat_embed_el_8_0_15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_tomcat_embed_tomcat_embed_logging_juli_8_0_15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_apache_tomcat_embed_tomcat_embed_websocket_8_0_15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_elasticsearch_elasticsearch_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_hibernate_hibernate_validator_5_1_3_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_jboss_logging_jboss_logging_3_1_3_GA.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_liquibase_liquibase_core_3_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_ow2_asm_asm_4_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_ow2_asm_asm_commons_4_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_slf4j_jcl_over_slf4j_1_7_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_slf4j_jul_to_slf4j_1_7_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_slf4j_log4j_over_slf4j_1_7_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_boot_spring_boot_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_boot_spring_boot_actuator_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_boot_spring_boot_autoconfigure_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_boot_spring_boot_starter_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_boot_spring_boot_starter_actuator_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_boot_spring_boot_starter_data_elasticsearch_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_boot_spring_boot_starter_logging_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_boot_spring_boot_starter_tomcat_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_boot_spring_boot_starter_web_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_data_spring_cql_1_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_data_spring_data_cassandra_1_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_data_spring_data_commons_1_9_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_data_spring_data_elasticsearch_1_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_spring_aop_4_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_spring_beans_4_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_spring_context_4_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_spring_core_4_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_spring_expression_4_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_spring_test_4_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_spring_tx_4_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_spring_web_4_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_springframework_spring_webmvc_4_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_yaml_snakeyaml_1_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 78 | 79 | 86 | 87 | 88 | 99 | 100 | 101 | 102 | 120 | 127 | 128 | 129 | 142 | 143 | 144 | 145 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 1.8 170 | 171 | 176 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Demo.java: -------------------------------------------------------------------------------- 1 | public class Demo { 2 | public static int sum(int n, int[] memo) { 3 | if(n <= 1) 4 | return n; 5 | if(n <= 9) { 6 | memo[n] = sum(n - 1, memo) + n; 7 | return memo[n]; 8 | } 9 | else { 10 | memo[n] = sum(n - 1, memo) + 1; 11 | return memo[n]; 12 | } 13 | } 14 | public static int sumDP(int n) { 15 | int[] dp = new int[n +1]; 16 | int sum = 0; 17 | for(int i = 1; i<=n; i++) { 18 | if(i <=9) { 19 | sum += i; 20 | dp[i] = sum; 21 | } else { 22 | dp[i] = dp[i - 1] + 1; 23 | } 24 | } 25 | return dp[n]; 26 | } 27 | public static void main(String args[]) { 28 | // 1,2,3,4,5,6,7,8,9,10,11,12 29 | int n = 12; 30 | System.out.println(sum(n + 1, new int[n + 1])); //10 = 1, 11 = 2 1 + 2 = 3 + 45 = 48 31 | 32 | System.out.println(sumDP(n + 1)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | spring-data-elasticsearch-sample 2 | ================================ 3 | 4 | spring boot elasticsearch sample 5 | 6 | 7 | 1. Install Elasticsearch 8 | 9 | 2. Install Gradle 10 | 11 | 3. IDE Eclipse or Intellij IDEA 12 | 13 | Step by Step Coding 14 | 15 | 16 | En: 17 | http://java.dzone.com/articles/first-step-spring-boot-and 18 | 19 | Vi: 20 | http://javadanang.com/497/spring-boot-ket-hop-voi-elasticsearch.html 21 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | sourceCompatibility = 1.5 4 | version = '1.0' 5 | 6 | repositories { 7 | mavenCentral() 8 | } 9 | 10 | dependencies { 11 | testCompile group: 'junit', name: 'junit', version: '4.11' 12 | compile 'org.springframework.boot:spring-boot-starter-data-elasticsearch:1.2.0.RELEASE' 13 | compile 'org.springframework.data:spring-data-cassandra:1.1.1.RELEASE' 14 | compile 'org.springframework:spring-test:4.1.2.RELEASE' 15 | compile 'org.springframework.boot:spring-boot-starter-logging:1.2.0.RELEASE' 16 | compile 'org.springframework.boot:spring-boot-starter-web:1.2.0.RELEASE' 17 | compile 'org.springframework.boot:spring-boot-starter-actuator:1.2.0.RELEASE' 18 | } -------------------------------------------------------------------------------- /build/classes/main/co/paan/application/Application.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/classes/main/co/paan/application/Application.class -------------------------------------------------------------------------------- /build/classes/main/co/paan/configuration/ElasticsearchConfiguration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/classes/main/co/paan/configuration/ElasticsearchConfiguration.class -------------------------------------------------------------------------------- /build/classes/main/co/paan/entities/Post.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/classes/main/co/paan/entities/Post.class -------------------------------------------------------------------------------- /build/classes/main/co/paan/entities/Tag.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/classes/main/co/paan/entities/Tag.class -------------------------------------------------------------------------------- /build/classes/main/co/paan/repository/PostRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/classes/main/co/paan/repository/PostRepository.class -------------------------------------------------------------------------------- /build/classes/main/co/paan/service/PostService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/classes/main/co/paan/service/PostService.class -------------------------------------------------------------------------------- /build/classes/main/co/paan/service/impl/PostServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/classes/main/co/paan/service/impl/PostServiceImpl.class -------------------------------------------------------------------------------- /build/classes/test/co/paan/service/impl/PostServiceImplTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/classes/test/co/paan/service/impl/PostServiceImplTest.class -------------------------------------------------------------------------------- /build/libs/spring-data-elasticsearch-sample-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/libs/spring-data-elasticsearch-sample-1.0.jar -------------------------------------------------------------------------------- /build/reports/tests/classes/co.paan.service.impl.PostServiceImplTest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Test results - Class co.paan.service.impl.PostServiceImplTest 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Class co.paan.service.impl.PostServiceImplTest

14 | 17 |
18 | 19 | 20 | 52 | 58 | 59 |
21 |
22 | 23 | 24 | 30 | 36 | 42 | 48 | 49 |
25 |
26 |
1
27 |

tests

28 |
29 |
31 |
32 |
0
33 |

failures

34 |
35 |
37 |
38 |
0
39 |

ignored

40 |
41 |
43 |
44 |
0.431s
45 |

duration

46 |
47 |
50 |
51 |
53 |
54 |
100%
55 |

successful

56 |
57 |
60 |
61 |
62 | 70 |
71 |

Tests

72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 |
TestDurationResult
testFindByTagsName0.431spassed
86 |
87 |
88 |

Standard output

89 | 90 |
16:05:47.530 [Test worker] DEBUG o.s.t.c.j.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class co.paan.service.impl.PostServiceImplTest].
 91 | 16:05:47.572 [Test worker] DEBUG o.s.test.context.BootstrapUtils - Instantiating TestContextBootstrapper from class [org.springframework.test.context.support.DefaultTestContextBootstrapper]
 92 | 16:05:47.598 [Test worker] DEBUG o.s.t.c.s.DefaultTestContextBootstrapper - Found explicit ContextLoader class [org.springframework.boot.test.SpringApplicationContextLoader] for context configuration attributes [ContextConfigurationAttributes@3e9f8eba declaringClass = 'co.paan.service.impl.PostServiceImplTest', classes = '{class co.paan.application.Application}', locations = '{}', inheritLocations = true, initializers = '{}', inheritInitializers = true, name = [null], contextLoaderClass = 'org.springframework.boot.test.SpringApplicationContextLoader']
 93 | 16:05:47.608 [Test worker] DEBUG o.s.t.c.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [co.paan.service.impl.PostServiceImplTest]
 94 | 16:05:47.615 [Test worker] DEBUG o.s.t.c.s.DefaultTestContextBootstrapper - @TestExecutionListeners is not present for class [co.paan.service.impl.PostServiceImplTest]: using defaults.
 95 | 16:05:47.632 [Test worker] INFO  o.s.t.c.s.DefaultTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
 96 | 16:05:47.676 [Test worker] INFO  o.s.t.c.s.DefaultTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@4976d53b, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@1571c663, org.springframework.test.context.support.DirtiesContextTestExecutionListener@77cbadb9, org.springframework.test.context.transaction.TransactionalTestExecutionListener@2612e74d, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@593221b9]
 97 | 16:05:47.699 [Test worker] DEBUG o.s.t.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [co.paan.service.impl.PostServiceImplTest]
 98 | 16:05:47.703 [Test worker] DEBUG o.s.t.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [co.paan.service.impl.PostServiceImplTest]
 99 | 16:05:47.707 [Test worker] DEBUG o.s.t.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [co.paan.service.impl.PostServiceImplTest]
100 | 16:05:47.711 [Test worker] DEBUG o.s.t.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [co.paan.service.impl.PostServiceImplTest]
101 | 16:05:47.716 [Test worker] DEBUG o.s.t.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [co.paan.service.impl.PostServiceImplTest]
102 | 16:05:47.729 [Test worker] DEBUG o.s.t.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [co.paan.service.impl.PostServiceImplTest]
103 | 16:05:47.757 [Test worker] DEBUG o.s.t.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [co.paan.service.impl.PostServiceImplTest]
104 | 16:05:47.758 [Test worker] DEBUG o.s.t.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [co.paan.service.impl.PostServiceImplTest]
105 | 16:05:47.766 [Test worker] DEBUG o.s.t.c.s.DependencyInjectionTestExecutionListener - Performing dependency injection for test context [[DefaultTestContext@78e499c7 testClass = PostServiceImplTest, testInstance = co.paan.service.impl.PostServiceImplTest@6cbc5ac5, testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@3cb2ce95 testClass = PostServiceImplTest, locations = '{}', classes = '{class co.paan.application.Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.boot.test.SpringApplicationContextLoader', parent = [null]]]].
106 | 16:05:47.847 [Test worker] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
107 | 16:05:47.849 [Test worker] DEBUG o.s.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
108 | 16:05:47.849 [Test worker] DEBUG o.s.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
109 | 16:05:47.851 [Test worker] DEBUG o.s.core.env.StandardEnvironment - Adding [integrationTest] PropertySource with search precedence immediately lower than [systemEnvironment]
110 | 
111 |   .   ____          _            __ _ _
112 |  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
113 | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
114 |  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
115 |   '  |____| .__|_| |_|_| |_\__, | / / / /
116 |  =========|_|==============|___/=/_/_/_/
117 |  :: Spring Boot ::        (v1.2.0.RELEASE)
118 | 
119 | 2014-12-28 16:05:48.229  INFO 751 --- [    Test worker] o.s.boot.SpringApplication               : Starting application on Nguyens-MacBook-Pro.local with PID 751 (/Users/hungnguyen/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/1.2.0.RELEASE/78ab52b3b5ec74ee88c608719f26989fbdf7ee5b/spring-boot-1.2.0.RELEASE.jar started by hungnguyen in /Users/hungnguyen/GitHub/spring-data-elasticsearch-sample)
120 | 2014-12-28 16:05:48.295  INFO 751 --- [    Test worker] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@12192971: startup date [Sun Dec 28 16:05:48 ICT 2014]; root of context hierarchy
121 | 2014-12-28 16:05:49.497  INFO 751 --- [    Test worker] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'elasticsearchTemplate': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=elasticsearchConfiguration; factoryMethodName=elasticsearchTemplate; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [co/paan/configuration/ElasticsearchConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchDataAutoConfiguration; factoryMethodName=elasticsearchTemplate; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchDataAutoConfiguration.class]]
122 | 2014-12-28 16:05:49.949  INFO 751 --- [    Test worker] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration' of type [class org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
123 | 2014-12-28 16:05:50.255  INFO 751 --- [    Test worker] org.elasticsearch.plugins                : [Hellrazor] loaded [], sites []
124 | 2014-12-28 16:05:51.521  INFO 751 --- [    Test worker] org.elasticsearch.node                   : [Caiera] version[1.3.2], pid[751], build[dee175d/2014-08-13T14:29:30Z]
125 | 2014-12-28 16:05:51.521  INFO 751 --- [    Test worker] org.elasticsearch.node                   : [Caiera] initializing ...
126 | 2014-12-28 16:05:51.522  INFO 751 --- [    Test worker] org.elasticsearch.plugins                : [Caiera] loaded [], sites []
127 | 2014-12-28 16:05:53.387  INFO 751 --- [    Test worker] org.elasticsearch.node                   : [Caiera] initialized
128 | 2014-12-28 16:05:53.388  INFO 751 --- [    Test worker] org.elasticsearch.node                   : [Caiera] starting ...
129 | 2014-12-28 16:05:53.398  INFO 751 --- [    Test worker] org.elasticsearch.transport              : [Caiera] bound_address {local[1]}, publish_address {local[1]}
130 | 2014-12-28 16:05:53.413  INFO 751 --- [    Test worker] org.elasticsearch.discovery              : [Caiera] elasticsearch/VAinUcpDSwmFjADm24gQjw
131 | 2014-12-28 16:05:53.417  INFO 751 --- [pdateTask][T#1]] org.elasticsearch.cluster.service        : [Caiera] new_master [Caiera][VAinUcpDSwmFjADm24gQjw][Nguyens-MacBook-Pro.local][local[1]]{local=true}, reason: local-disco-initial_connect(master)
132 | 2014-12-28 16:05:53.444  INFO 751 --- [    Test worker] org.elasticsearch.node                   : [Caiera] started
133 | 2014-12-28 16:05:53.521  INFO 751 --- [pdateTask][T#1]] org.elasticsearch.gateway                : [Caiera] recovered [0] indices into cluster_state
134 | 2014-12-28 16:05:54.785  INFO 751 --- [    Test worker] o.s.boot.SpringApplication               : Started application in 6.928 seconds (JVM running for 8.348)
135 | 
136 |
137 |
138 |
139 | 143 |
144 | -------------------------------------------------------------------------------- /build/reports/tests/css/base-style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | margin: 0; 4 | padding: 0; 5 | font-family: sans-serif; 6 | font-size: 12pt; 7 | } 8 | 9 | body, a, a:visited { 10 | color: #303030; 11 | } 12 | 13 | #content { 14 | padding-left: 50px; 15 | padding-right: 50px; 16 | padding-top: 30px; 17 | padding-bottom: 30px; 18 | } 19 | 20 | #content h1 { 21 | font-size: 160%; 22 | margin-bottom: 10px; 23 | } 24 | 25 | #footer { 26 | margin-top: 100px; 27 | font-size: 80%; 28 | white-space: nowrap; 29 | } 30 | 31 | #footer, #footer a { 32 | color: #a0a0a0; 33 | } 34 | 35 | ul { 36 | margin-left: 0; 37 | } 38 | 39 | h1, h2, h3 { 40 | white-space: nowrap; 41 | } 42 | 43 | h2 { 44 | font-size: 120%; 45 | } 46 | 47 | ul.tabLinks { 48 | padding-left: 0; 49 | padding-top: 10px; 50 | padding-bottom: 10px; 51 | overflow: auto; 52 | min-width: 800px; 53 | width: auto !important; 54 | width: 800px; 55 | } 56 | 57 | ul.tabLinks li { 58 | float: left; 59 | height: 100%; 60 | list-style: none; 61 | padding-left: 10px; 62 | padding-right: 10px; 63 | padding-top: 5px; 64 | padding-bottom: 5px; 65 | margin-bottom: 0; 66 | -moz-border-radius: 7px; 67 | border-radius: 7px; 68 | margin-right: 25px; 69 | border: solid 1px #d4d4d4; 70 | background-color: #f0f0f0; 71 | } 72 | 73 | ul.tabLinks li:hover { 74 | background-color: #fafafa; 75 | } 76 | 77 | ul.tabLinks li.selected { 78 | background-color: #c5f0f5; 79 | border-color: #c5f0f5; 80 | } 81 | 82 | ul.tabLinks a { 83 | font-size: 120%; 84 | display: block; 85 | outline: none; 86 | text-decoration: none; 87 | margin: 0; 88 | padding: 0; 89 | } 90 | 91 | ul.tabLinks li h2 { 92 | margin: 0; 93 | padding: 0; 94 | } 95 | 96 | div.tab { 97 | } 98 | 99 | div.selected { 100 | display: block; 101 | } 102 | 103 | div.deselected { 104 | display: none; 105 | } 106 | 107 | div.tab table { 108 | min-width: 350px; 109 | width: auto !important; 110 | width: 350px; 111 | border-collapse: collapse; 112 | } 113 | 114 | div.tab th, div.tab table { 115 | border-bottom: solid #d0d0d0 1px; 116 | } 117 | 118 | div.tab th { 119 | text-align: left; 120 | white-space: nowrap; 121 | padding-left: 6em; 122 | } 123 | 124 | div.tab th:first-child { 125 | padding-left: 0; 126 | } 127 | 128 | div.tab td { 129 | white-space: nowrap; 130 | padding-left: 6em; 131 | padding-top: 5px; 132 | padding-bottom: 5px; 133 | } 134 | 135 | div.tab td:first-child { 136 | padding-left: 0; 137 | } 138 | 139 | div.tab td.numeric, div.tab th.numeric { 140 | text-align: right; 141 | } 142 | 143 | span.code { 144 | display: inline-block; 145 | margin-top: 0em; 146 | margin-bottom: 1em; 147 | } 148 | 149 | span.code pre { 150 | font-size: 11pt; 151 | padding-top: 10px; 152 | padding-bottom: 10px; 153 | padding-left: 10px; 154 | padding-right: 10px; 155 | margin: 0; 156 | background-color: #f7f7f7; 157 | border: solid 1px #d0d0d0; 158 | min-width: 700px; 159 | width: auto !important; 160 | width: 700px; 161 | } 162 | -------------------------------------------------------------------------------- /build/reports/tests/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | #summary { 3 | margin-top: 30px; 4 | margin-bottom: 40px; 5 | } 6 | 7 | #summary table { 8 | border-collapse: collapse; 9 | } 10 | 11 | #summary td { 12 | vertical-align: top; 13 | } 14 | 15 | .breadcrumbs, .breadcrumbs a { 16 | color: #606060; 17 | } 18 | 19 | .infoBox { 20 | width: 110px; 21 | padding-top: 15px; 22 | padding-bottom: 15px; 23 | text-align: center; 24 | } 25 | 26 | .infoBox p { 27 | margin: 0; 28 | } 29 | 30 | .counter, .percent { 31 | font-size: 120%; 32 | font-weight: bold; 33 | margin-bottom: 8px; 34 | } 35 | 36 | #duration { 37 | width: 125px; 38 | } 39 | 40 | #successRate, .summaryGroup { 41 | border: solid 2px #d0d0d0; 42 | -moz-border-radius: 10px; 43 | border-radius: 10px; 44 | } 45 | 46 | #successRate { 47 | width: 140px; 48 | margin-left: 35px; 49 | } 50 | 51 | #successRate .percent { 52 | font-size: 180%; 53 | } 54 | 55 | .success, .success a { 56 | color: #008000; 57 | } 58 | 59 | div.success, #successRate.success { 60 | background-color: #bbd9bb; 61 | border-color: #008000; 62 | } 63 | 64 | .failures, .failures a { 65 | color: #b60808; 66 | } 67 | 68 | .skipped, .skipped a { 69 | color: #c09853; 70 | } 71 | 72 | div.failures, #successRate.failures { 73 | background-color: #ecdada; 74 | border-color: #b60808; 75 | } 76 | 77 | ul.linkList { 78 | padding-left: 0; 79 | } 80 | 81 | ul.linkList li { 82 | list-style: none; 83 | margin-bottom: 5px; 84 | } 85 | -------------------------------------------------------------------------------- /build/reports/tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Test results - Test Summary 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Test Summary

14 |
15 | 16 | 17 | 49 | 55 | 56 |
18 |
19 | 20 | 21 | 27 | 33 | 39 | 45 | 46 |
22 |
23 |
1
24 |

tests

25 |
26 |
28 |
29 |
0
30 |

failures

31 |
32 |
34 |
35 |
0
36 |

ignored

37 |
38 |
40 |
41 |
0.431s
42 |

duration

43 |
44 |
47 |
48 |
50 |
51 |
100%
52 |

successful

53 |
54 |
57 |
58 |
59 | 67 |
68 |

Packages

69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |
PackageTestsFailuresIgnoredDurationSuccess rate
83 | co.paan.service.impl 84 | 1000.431s100%
93 |
94 |
95 |

Classes

96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 112 | 113 | 114 | 115 | 116 | 117 | 118 |
ClassTestsFailuresIgnoredDurationSuccess rate
110 | co.paan.service.impl.PostServiceImplTest 111 | 1000.431s100%
119 |
120 |
121 | 125 |
126 | -------------------------------------------------------------------------------- /build/reports/tests/js/report.js: -------------------------------------------------------------------------------- 1 | var tabs = new Object(); 2 | 3 | function initTabs() { 4 | var container = document.getElementById('tabs'); 5 | tabs.tabs = findTabs(container); 6 | tabs.titles = findTitles(tabs.tabs); 7 | tabs.headers = findHeaders(container); 8 | tabs.select = select; 9 | tabs.deselectAll = deselectAll; 10 | tabs.select(0); 11 | return true; 12 | } 13 | 14 | window.onload = initTabs; 15 | 16 | function switchTab() { 17 | var id = this.id.substr(1); 18 | for (var i = 0; i < tabs.tabs.length; i++) { 19 | if (tabs.tabs[i].id == id) { 20 | tabs.select(i); 21 | break; 22 | } 23 | } 24 | return false; 25 | } 26 | 27 | function select(i) { 28 | this.deselectAll(); 29 | changeElementClass(this.tabs[i], 'tab selected'); 30 | changeElementClass(this.headers[i], 'selected'); 31 | while (this.headers[i].firstChild) { 32 | this.headers[i].removeChild(this.headers[i].firstChild); 33 | } 34 | var h2 = document.createElement('H2'); 35 | h2.appendChild(document.createTextNode(this.titles[i])); 36 | this.headers[i].appendChild(h2); 37 | } 38 | 39 | function deselectAll() { 40 | for (var i = 0; i < this.tabs.length; i++) { 41 | changeElementClass(this.tabs[i], 'tab deselected'); 42 | changeElementClass(this.headers[i], 'deselected'); 43 | while (this.headers[i].firstChild) { 44 | this.headers[i].removeChild(this.headers[i].firstChild); 45 | } 46 | var a = document.createElement('A'); 47 | a.setAttribute('id', 'ltab' + i); 48 | a.setAttribute('href', '#tab' + i); 49 | a.onclick = switchTab; 50 | a.appendChild(document.createTextNode(this.titles[i])); 51 | this.headers[i].appendChild(a); 52 | } 53 | } 54 | 55 | function changeElementClass(element, classValue) { 56 | if (element.getAttribute('className')) { 57 | /* IE */ 58 | element.setAttribute('className', classValue) 59 | } else { 60 | element.setAttribute('class', classValue) 61 | } 62 | } 63 | 64 | function findTabs(container) { 65 | return findChildElements(container, 'DIV', 'tab'); 66 | } 67 | 68 | function findHeaders(container) { 69 | var owner = findChildElements(container, 'UL', 'tabLinks'); 70 | return findChildElements(owner[0], 'LI', null); 71 | } 72 | 73 | function findTitles(tabs) { 74 | var titles = new Array(); 75 | for (var i = 0; i < tabs.length; i++) { 76 | var tab = tabs[i]; 77 | var header = findChildElements(tab, 'H2', null)[0]; 78 | header.parentNode.removeChild(header); 79 | if (header.innerText) { 80 | titles.push(header.innerText) 81 | } else { 82 | titles.push(header.textContent) 83 | } 84 | } 85 | return titles; 86 | } 87 | 88 | function findChildElements(container, name, targetClass) { 89 | var elements = new Array(); 90 | var children = container.childNodes; 91 | for (var i = 0; i < children.length; i++) { 92 | var child = children.item(i); 93 | if (child.nodeType == 1 && child.nodeName == name) { 94 | if (targetClass && child.className.indexOf(targetClass) < 0) { 95 | continue; 96 | } 97 | elements.push(child); 98 | } 99 | } 100 | return elements; 101 | } 102 | -------------------------------------------------------------------------------- /build/reports/tests/packages/co.paan.service.impl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Test results - Package co.paan.service.impl 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Package co.paan.service.impl

14 | 16 |
17 | 18 | 19 | 51 | 57 | 58 |
20 |
21 | 22 | 23 | 29 | 35 | 41 | 47 | 48 |
24 |
25 |
1
26 |

tests

27 |
28 |
30 |
31 |
0
32 |

failures

33 |
34 |
36 |
37 |
0
38 |

ignored

39 |
40 |
42 |
43 |
0.431s
44 |

duration

45 |
46 |
49 |
50 |
52 |
53 |
100%
54 |

successful

55 |
56 |
59 |
60 |
61 | 66 |
67 |

Classes

68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 83 | 84 | 85 | 86 | 87 | 88 | 89 |
ClassTestsFailuresIgnoredDurationSuccess rate
81 | PostServiceImplTest 82 | 1000.431s100%
90 |
91 |
92 | 96 |
97 | -------------------------------------------------------------------------------- /build/resources/main/elasticsearch.properties: -------------------------------------------------------------------------------- 1 | elasticsearch.host = localhost 2 | elasticsearch.port = 9300 -------------------------------------------------------------------------------- /build/test-results/TEST-co.paan.service.impl.PostServiceImplTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /build/test-results/binary/test/output.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/test-results/binary/test/output.bin -------------------------------------------------------------------------------- /build/test-results/binary/test/output.bin.idx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/test-results/binary/test/output.bin.idx -------------------------------------------------------------------------------- /build/test-results/binary/test/results.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/build/test-results/binary/test/results.bin -------------------------------------------------------------------------------- /build/tmp/jar/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /data/elasticsearch/nodes/0/_state/global-8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/data/elasticsearch/nodes/0/_state/global-8 -------------------------------------------------------------------------------- /data/elasticsearch/nodes/0/node.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/data/elasticsearch/nodes/0/node.lock -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cooleo/spring-data-elasticsearch-sample/5dcd34997e06dea3e137a472369cc67db6956123/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Dec 28 15:16:32 GMT+07:00 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-data-elasticsearch-sample' 2 | 3 | -------------------------------------------------------------------------------- /spring-data-elasticsearch-sample.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/main/java/co/paan/application/Application.java: -------------------------------------------------------------------------------- 1 | package co.paan.application; 2 | 3 | import co.paan.configuration.ElasticsearchConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 6 | import org.springframework.context.annotation.ComponentScan; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * Created by hungnguyen on 12/28/14. 11 | */ 12 | @Configuration 13 | @ComponentScan(basePackages = "co.paan") 14 | @EnableAutoConfiguration(exclude = {ElasticsearchConfiguration.class}) 15 | public class Application { 16 | public static void main(String args[]){ 17 | SpringApplication.run(Application.class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/co/paan/configuration/ElasticsearchConfiguration.java: -------------------------------------------------------------------------------- 1 | package co.paan.configuration; 2 | 3 | import org.elasticsearch.client.Client; 4 | import org.elasticsearch.client.transport.TransportClient; 5 | import org.elasticsearch.common.transport.InetSocketTransportAddress; 6 | import org.elasticsearch.common.transport.TransportAddress; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.context.annotation.PropertySource; 10 | import org.springframework.core.env.Environment; 11 | import org.springframework.data.elasticsearch.core.ElasticsearchOperations; 12 | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; 13 | import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; 14 | 15 | import javax.annotation.Resource; 16 | 17 | /** 18 | * Created by hungnguyen on 12/16/14. 19 | */ 20 | @Configuration 21 | @PropertySource(value = "classpath:elasticsearch.properties") 22 | @EnableElasticsearchRepositories(basePackages = "co.paan.repository") 23 | public class ElasticsearchConfiguration { 24 | @Resource 25 | private Environment environment; 26 | @Bean 27 | public Client client() { 28 | TransportClient client = new TransportClient(); 29 | TransportAddress address = new InetSocketTransportAddress(environment.getProperty("elasticsearch.host"), Integer.parseInt(environment.getProperty("elasticsearch.port"))); 30 | client.addTransportAddress(address); 31 | return client; 32 | } 33 | 34 | @Bean 35 | public ElasticsearchOperations elasticsearchTemplate() { 36 | return new ElasticsearchTemplate(client()); 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/co/paan/entities/Post.java: -------------------------------------------------------------------------------- 1 | package co.paan.entities; 2 | 3 | import org.springframework.data.annotation.Id; 4 | import org.springframework.data.elasticsearch.annotations.Document; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by hungnguyen on 12/28/14. 10 | */ 11 | @Document(indexName = "post", type = "post", shards = 1, replicas = 0) 12 | public class Post { 13 | @Id 14 | private String id; 15 | private String title; 16 | // @Field(type= FieldType.Nested) 17 | private List tags; 18 | 19 | public String getId() { 20 | return id; 21 | } 22 | 23 | public void setId(String id) { 24 | this.id = id; 25 | } 26 | 27 | public String getTitle() { 28 | return title; 29 | } 30 | 31 | public void setTitle(String title) { 32 | this.title = title; 33 | } 34 | 35 | public List getTags() { 36 | return tags; 37 | } 38 | 39 | public void setTags(List tags) { 40 | this.tags = tags; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/co/paan/entities/Tag.java: -------------------------------------------------------------------------------- 1 | package co.paan.entities; 2 | 3 | /** 4 | * Created by hungnguyen on 12/28/14. 5 | */ 6 | public class Tag { 7 | private String id; 8 | private String name; 9 | 10 | public String getId() { 11 | return id; 12 | } 13 | 14 | public void setId(String id) { 15 | this.id = id; 16 | } 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/co/paan/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package co.paan.repository; 2 | 3 | import co.paan.entities.Post; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 7 | 8 | /** 9 | * Created by hungnguyen on 12/28/14. 10 | */ 11 | public interface PostRepository extends ElasticsearchRepository{ 12 | 13 | Page findByTagsName(String name, Pageable pageable); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/co/paan/service/PostService.java: -------------------------------------------------------------------------------- 1 | package co.paan.service; 2 | 3 | import co.paan.entities.Post; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.PageRequest; 6 | 7 | /** 8 | * Created by hungnguyen on 12/28/14. 9 | */ 10 | public interface PostService { 11 | Post save(Post post); 12 | Post findOne(String id); 13 | Iterable findAll(); 14 | 15 | Page findByTagsName(String tagName, PageRequest pageRequest); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/co/paan/service/impl/PostServiceImpl.java: -------------------------------------------------------------------------------- 1 | package co.paan.service.impl; 2 | 3 | import co.paan.entities.Post; 4 | import co.paan.repository.PostRepository; 5 | import co.paan.service.PostService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.data.domain.Page; 8 | import org.springframework.data.domain.PageRequest; 9 | import org.springframework.stereotype.Service; 10 | 11 | /** 12 | * Created by hungnguyen on 12/28/14. 13 | */ 14 | @Service 15 | public class PostServiceImpl implements PostService{ 16 | @Autowired 17 | private PostRepository postRepository; 18 | 19 | @Override 20 | public Post save(Post post) { 21 | postRepository.save(post); 22 | return post; 23 | } 24 | 25 | @Override 26 | public Post findOne(String id) { 27 | return postRepository.findOne(id); 28 | } 29 | 30 | @Override 31 | public Iterable findAll() { 32 | return postRepository.findAll(); 33 | } 34 | 35 | @Override 36 | public Page findByTagsName(String tagName, PageRequest pageRequest) { 37 | return postRepository.findByTagsName(tagName, pageRequest); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/resources/elasticsearch.properties: -------------------------------------------------------------------------------- 1 | elasticsearch.host = localhost 2 | elasticsearch.port = 9300 -------------------------------------------------------------------------------- /src/test/java/co/paan/service/impl/PostServiceImplTest.java: -------------------------------------------------------------------------------- 1 | package co.paan.service.impl; 2 | 3 | import co.paan.application.Application; 4 | import co.paan.entities.Post; 5 | import co.paan.entities.Tag; 6 | import co.paan.service.PostService; 7 | import org.junit.Before; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.boot.test.SpringApplicationConfiguration; 12 | import org.springframework.data.domain.Page; 13 | import org.springframework.data.domain.PageRequest; 14 | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; 15 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 16 | 17 | import java.util.Arrays; 18 | 19 | import static org.hamcrest.CoreMatchers.notNullValue; 20 | import static org.hamcrest.core.Is.is; 21 | import static org.junit.Assert.assertThat; 22 | 23 | 24 | @RunWith(SpringJUnit4ClassRunner.class) 25 | @SpringApplicationConfiguration(classes = Application.class) 26 | public class PostServiceImplTest{ 27 | @Autowired 28 | private PostService postService; 29 | @Autowired 30 | private ElasticsearchTemplate elasticsearchTemplate; 31 | 32 | @Before 33 | public void before() { 34 | elasticsearchTemplate.deleteIndex(Post.class); 35 | elasticsearchTemplate.createIndex(Post.class); 36 | elasticsearchTemplate.putMapping(Post.class); 37 | elasticsearchTemplate.refresh(Post.class, true); 38 | } 39 | 40 | //@Test 41 | public void testSave() throws Exception { 42 | Tag tag = new Tag(); 43 | tag.setId("1"); 44 | tag.setName("tech"); 45 | Tag tag2 = new Tag(); 46 | tag2.setId("2"); 47 | tag2.setName("elasticsearch"); 48 | 49 | Post post = new Post(); 50 | post.setId("1"); 51 | post.setTitle("Bigining with spring boot application and elasticsearch"); 52 | post.setTags(Arrays.asList(tag, tag2)); 53 | postService.save(post); 54 | 55 | assertThat(post.getId(), notNullValue()); 56 | 57 | Post post2 = new Post(); 58 | post2.setId("1"); 59 | post2.setTitle("Bigining with spring boot application"); 60 | post2.setTags(Arrays.asList(tag)); 61 | postService.save(post); 62 | assertThat(post2.getId(), notNullValue()); 63 | 64 | 65 | 66 | 67 | } 68 | 69 | public void testFindOne() throws Exception { 70 | 71 | } 72 | 73 | public void testFindAll() throws Exception { 74 | 75 | } 76 | @Test 77 | public void testFindByTagsName() throws Exception { 78 | Tag tag = new Tag(); 79 | tag.setId("1"); 80 | tag.setName("tech"); 81 | Tag tag2 = new Tag(); 82 | tag2.setId("2"); 83 | tag2.setName("elasticsearch"); 84 | 85 | Post post = new Post(); 86 | post.setId("1"); 87 | post.setTitle("Bigining with spring boot application and elasticsearch"); 88 | post.setTags(Arrays.asList(tag, tag2)); 89 | postService.save(post); 90 | 91 | 92 | 93 | Post post2 = new Post(); 94 | post2.setId("1"); 95 | post2.setTitle("Bigining with spring boot application"); 96 | post2.setTags(Arrays.asList(tag)); 97 | postService.save(post); 98 | 99 | Page posts = postService.findByTagsName("tech", new PageRequest(0,10)); 100 | Page posts2 = postService.findByTagsName("tech", new PageRequest(0,10)); 101 | Page posts3 = postService.findByTagsName("maz", new PageRequest(0,10)); 102 | 103 | 104 | assertThat(posts.getTotalElements(), is(1L)); 105 | assertThat(posts2.getTotalElements(), is(1L)); 106 | assertThat(posts3.getTotalElements(), is(0L)); 107 | } 108 | } --------------------------------------------------------------------------------