Compare commits

...

1550 Commits

Author SHA1 Message Date
Peter-Josef Meisch
006cda6de6
Adjust Rest5Client building by using and exposing the callbacks provided by the Elasticsearch Java client library.
Original Pull Request #3143
Closes #3129

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-08-02 18:33:04 +02:00
Peter-Josef Meisch
f51efa2cad
Cleanup nullability issues
Original Pull Request #3142
Closes #3141
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-08-02 13:20:28 +02:00
Peter-Josef Meisch
6e30801a59
Upgrade to Elasticsearch 9.0.4
Original Pull Request #3140
Closes #3139

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-08-02 07:49:32 +02:00
Peter-Josef Meisch
e64d0ada62
Polishing
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-07-22 18:36:04 +02:00
Anton
7f7cf3f52e
Fixed PrimaryTerm/SeqNo datatypes in UpdateQuery.
Original Pull Request #3137
Closes #3136

Signed-off-by: Anton Buz <buzdalkin.a@vlprojects.pro>
2025-07-22 18:35:43 +02:00
Mark Paluch
55d470fc91
After release cleanups.
See #3115
2025-07-18 13:14:47 +02:00
Mark Paluch
b7290b5d9c
Prepare next development iteration.
See #3115
2025-07-18 13:14:46 +02:00
Mark Paluch
40414f0bde
Release version 6.0 M4 (2025.1.0).
See #3115
2025-07-18 13:12:28 +02:00
Mark Paluch
cb71caa504
Prepare 6.0 M4 (2025.1.0).
See #3115
2025-07-18 13:12:11 +02:00
Mark Paluch
ed9abce7af
Upgrade to Maven Wrapper 3.9.11.
See #3130
2025-07-17 13:59:56 +02:00
Peter-Josef Meisch
12ddb74fae
Fix the calculation of the requested number of documents.
Original Pull Request #3128
Closes #3127

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-07-15 18:28:51 +02:00
Peter-Josef Meisch
6324b72707
Use the new Rest5Client as default, provide the old RestClient as optional.
Original Pull Request: #3125
Closes #3117

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-06-25 20:09:00 +02:00
Peter-Josef Meisch
6e49980c7c
Upgrade to Elasticsearch 9.0.3.
Original Pull Request #3124
Closes #3123
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-06-25 17:24:08 +02:00
Peter-Josef Meisch
f9509f2696
Upgrade to Elasticsearch 9.0.2.
Original Pull Request #3122
Closes #3121
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-06-14 17:30:22 +02:00
Mark Paluch
7f53944e1b
Adapt to generics changes in CoroutineCrudRepository.
Closes #3118
2025-06-12 09:14:22 +02:00
Peter-Josef Meisch
a9d2aaa93d
Polishing.
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-29 18:10:48 +02:00
Laura Trotta
158f5fc342
es java client major update.
Original Pull Request #3116
Closes #3110
Signed-off-by: Laura Trotta <laura.trotta@elastic.co>
2025-05-29 15:56:35 +02:00
Peter-Josef Meisch
6268133506
Update versions documentation
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-24 14:58:04 +02:00
Mark Paluch
923787c2d1
After release cleanups.
See #3097
2025-05-16 14:18:48 +02:00
Mark Paluch
62fcbd44fa
Prepare next development iteration.
See #3097
2025-05-16 14:18:47 +02:00
Mark Paluch
77ba620fc6
Release version 6.0 M3 (2025.1.0).
See #3097
2025-05-16 14:16:18 +02:00
Mark Paluch
06704d974d
Prepare 6.0 M3 (2025.1.0).
See #3097
2025-05-16 14:15:56 +02:00
Mark Paluch
897cb0a957
Add optional Querydsl dependency.
Closes #3107
2025-05-16 12:18:51 +02:00
Mark Paluch
a8557a36dc
Update CI Properties.
See #3097
2025-05-16 12:18:51 +02:00
Mark Paluch
2678cdc7b6
After release cleanups.
See #3047
2025-05-16 12:18:51 +02:00
Mark Paluch
eb42312ebe
Prepare next development iteration.
See #3047
2025-05-16 12:18:51 +02:00
Mark Paluch
af13fe0247
Release version 6.0 M2 (2025.1.0).
See #3047
2025-05-16 12:18:51 +02:00
Mark Paluch
e81810c0d7
Prepare 6.0 M2 (2025.1.0).
See #3047
2025-05-16 12:18:51 +02:00
Peter-Josef Meisch
e9c7c0ee95
Switch to jspecify nullability annotations.
Original Pull Request #3065
Closes #2984

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-16 12:18:50 +02:00
Peter-Josef Meisch
3a4425053e
Cleanup unneeded imports after deprecation removal
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-16 12:18:50 +02:00
Christoph Strobl
09984f86e6
After release cleanups.
See #3006
2025-05-16 12:18:50 +02:00
Christoph Strobl
710526c5f6
Prepare next development iteration.
See #3006
2025-05-16 12:18:50 +02:00
Christoph Strobl
1acd392af7
Release version 6.0 M1 (2025.1.0).
See #3006
2025-05-16 12:18:50 +02:00
Christoph Strobl
76fe240a24
Prepare 6.0 M1 (2025.1.0).
See #3006
2025-05-16 12:18:50 +02:00
Mark Paluch
e298bc9f7a
Adopt to changes in Spring Framework 7.
See #3038
2025-05-16 12:18:50 +02:00
Peter-Josef Meisch
49d5dee5aa
Update versions documentation
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-16 12:18:49 +02:00
Mark Paluch
df6a127629
After release cleanups.
See #3096
2025-05-16 12:18:48 +02:00
Mark Paluch
08a1ef3a28
Prepare next development iteration.
See #3096
2025-05-16 11:31:15 +02:00
Mark Paluch
62a34cf09c
Release version 5.5 GA (2025.0.0).
See #3096
2025-05-16 11:28:31 +02:00
Mark Paluch
cc5f149c5a
Prepare 5.5 GA (2025.0.0).
See #3096
2025-05-16 11:28:10 +02:00
Peter-Josef Meisch
0728c8e4aa
Update versions doc for the next release
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-15 17:39:17 +02:00
Peter-Josef Meisch
ebbe242a72
Fix missing return value in ByQueryResponse.
Original Pull Request #3109
Closes #3108

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-14 13:53:58 +02:00
Mark Paluch
0ce9a1c400
Update CI Properties.
See #3096
2025-05-12 09:33:06 +02:00
Mark Paluch
22763d17a7
Update CI Properties.
See #3096
2025-05-12 09:00:23 +02:00
Mark Paluch
9870de1e77
Update CI Properties.
See #3096
2025-05-12 08:56:22 +02:00
Mark Paluch
8c9d9ae1e7
Update CI Properties.
See #3096
2025-05-12 08:55:54 +02:00
Peter-Josef Meisch
945179e4eb
Fix handling of page size and max results in search request preparation.
Original Pull Request #3106
Closes #3089

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-10 21:21:17 +02:00
Peter-Josef Meisch
ea38ef1d41
Upgrade Elasticsearch libraries to 8.18.1.
Original Pull Request #3105
Closes #3103

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-09 20:35:30 +02:00
Mark Paluch
acbfba94ac
Exclude commons-logging dependency.
`elasticsearch-rest-client` pulls in `commons-logging` and we don't want that to happen as it conflicts with our dependency setup.

Closes #3104
2025-05-09 12:10:07 +02:00
Peter-Josef Meisch
5a0f556a3b
Upgrade Elasticsearch dependencies to 8.18.0
Original Pull request #3101
Adjust to changes in Elasticsearch.
Closes #3100

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-05-02 10:21:24 +02:00
Peter-Josef Meisch
a07ac3c93d
Fix code not terminating on repository saving an empty flux.
Original Pull Request #3099
Closes: #3039

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-04-26 10:40:31 +02:00
Mark Paluch
9d025dd469
After release cleanups.
See #3079
2025-04-22 11:41:58 +02:00
Mark Paluch
925921f174
Prepare next development iteration.
See #3079
2025-04-22 11:41:58 +02:00
Mark Paluch
2f0a259045
Release version 5.5 RC1 (2025.0.0).
See #3079
2025-04-22 11:41:58 +02:00
Mark Paluch
9ffcb092db
Prepare 5.5 RC1 (2025.0.0).
See #3079
2025-04-22 11:41:58 +02:00
Peter-Josef Meisch
0e5af90581
Fix implementation of equlas/hashcode for Criteria class.
Original Pull Request: #3088
Closes: #3083

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-04-05 20:44:01 +02:00
Peter-Josef Meisch
95059b3282
Upgrade to Elasticsearch 8.17.4.
Original Pull Request: #3085
Closes #3084

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-03-31 16:36:42 +02:00
Peter-Josef Meisch
1ae6301c2f
Fix cutting of unknown properties in property paths for search.
Original Pull Request #3082
Closes #3081

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-03-24 21:44:53 +01:00
Peter-Josef Meisch
2366f67bba
Enable scripted fields and runtime fields of collection type.
Original Pull Request #3080
Closes #3076

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-03-18 20:24:02 +01:00
Mark Paluch
6f424318ec
After release cleanups.
See #3058
2025-03-14 09:33:43 +01:00
Mark Paluch
300fe2ac8b
Prepare next development iteration.
See #3058
2025-03-14 09:33:42 +01:00
Mark Paluch
1fdee7399f
Release version 5.5 M2 (2025.0.0).
See #3058
2025-03-14 09:31:05 +01:00
Mark Paluch
ace17b9751
Prepare 5.5 M2 (2025.0.0).
See #3058
2025-03-14 09:30:46 +01:00
Peter-Josef Meisch
42383624ea
Fix mapping of property names in sort parameters.
Original Pull Request #3074
Closes #3072

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-03-09 12:31:59 +01:00
Hope Kim
35e7b45f1a
Fix syntax errors in link formatting in adoc files.
Original Pull Request: #3070
Closes #3071

Signed-off-by: esperar <s22043@gsm.hs.kr>
2025-03-04 19:25:25 +01:00
Volodymyr
89f60f2356
Fix typo.
Original Pull Request #3069
Closes: #3068

Signed-off-by: Dgray16 <vova235@gmail.com>
2025-03-02 09:45:59 +01:00
Peter-Josef Meisch
fa979249fc
Remove deprecated methods.
Original Pull Request #3067
Closes #3066

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-02-23 12:37:26 +01:00
정보교 (Bogus Jung)
8b43af2d33
optimize capacity & add assert messages in GeoJson.
Original Pull Request #3064
Closes #3063

Signed-off-by: 정보교 (Bogus Jung) <bogusjung0317@gmail.com>
2025-02-21 14:24:58 +01:00
Peter-Josef Meisch
64f88ae9ac
Add testcontainers-local.properties handling.
Original Pull Request #3062
Closes #3061

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-02-19 20:14:16 +01:00
Mark Paluch
15f086359d
After release cleanups.
See #3005
2025-02-14 12:25:09 +01:00
Mark Paluch
78ea67b6a6
Prepare next development iteration.
See #3005
2025-02-14 12:25:08 +01:00
Mark Paluch
6d0825b121
Release version 5.5 M1 (2025.0.0).
See #3005
2025-02-14 12:22:37 +01:00
Mark Paluch
846344891d
Prepare 5.5 M1 (2025.0.0).
See #3005
2025-02-14 12:22:19 +01:00
Peter-Josef Meisch
f9f64e6b39
Upgrade to Elasticsearch 8.17.2.
Closes #3054

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-02-12 07:54:06 +01:00
Mark Paluch
7fe4d8e1a4
Update CI Properties.
See #3005
2025-02-11 15:23:14 +01:00
Peter-Josef Meisch
bd87dae1a3
Upgrade to Elasticsearch 8.17.1.
Original Pull Request #3053
Closes #3052 

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-02-11 12:47:00 +01:00
Peter-Josef Meisch
ea62cf0abd
Adopt to deprecation removals in Commons.
Original Pull Request #3051
Closes #3050 

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-02-09 20:20:01 +01:00
Peter-Josef Meisch
cb77b328ae
Add repository method support for search templates.
Original Pull Request #3049
Closes #2997 

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-02-08 12:17:42 +01:00
Peter-Josef Meisch
5568c7bbc4
Add IndexQuery.builder() method.
Original Pull Request: #3041
Closes #3030

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-01-11 13:21:55 +01:00
Peter-Josef Meisch
03591326d7
Update copyright comment to 2025.
Original Pull Request #3031
Closes #3030
2025-01-02 19:12:45 +01:00
Peter-Josef Meisch
a94b74c877
Upgrade to Elasticsearch 8.17.0. (#3027)
Closes #3026
2024-12-15 19:16:38 +01:00
Alfonso
944e7e81dd
fix: use scripted field name to populate entity.
Original Pull Request: #3023
Closes: #3022
2024-12-14 18:04:06 +01:00
Peter-Josef Meisch
5f297f1dc3
Upgrade to Elasticsearch 8.16.1.
Original Pull Request #3019
Closes #3017
2024-12-01 13:49:43 +01:00
Peter-Josef Meisch
028239fbdb
Add optional fetchSource flag to the SourceFilter.
Original Pull Request #3014
Closes #3009
2024-11-28 15:37:19 +01:00
Peter-Josef Meisch
01d2d24916
Update versions documentation.
Original Pull Request #3013
Closes #3012
2024-11-24 10:43:11 +01:00
Mark Paluch
4f159d5de5
After release cleanups.
See #2990
2024-11-15 14:13:09 +01:00
Mark Paluch
00f13ac3e9
Prepare next development iteration.
See #2990
2024-11-15 14:13:08 +01:00
Mark Paluch
6f3941b43b
Release version 5.4 GA (2024.1.0).
See #2990
2024-11-15 14:10:52 +01:00
Mark Paluch
bfd3c35d93
Prepare 5.4 GA (2024.1.0).
See #2990
2024-11-15 14:10:37 +01:00
Mark Paluch
f5b29cb524
Update CI Properties.
See #2990
2024-11-15 10:39:50 +01:00
Peter-Josef Meisch
7f5bfffc34
fix geohash conversion
Original Pull Request #3002
Closes #3001
2024-11-08 18:55:15 +01:00
Mark Paluch
61176940cb
Upgrade to Maven Wrapper 3.9.9.
See #2998
2024-11-07 09:47:28 +01:00
Peter-Josef Meisch
24618ecfbe
Upgrade dependency to elasticsearch 8.15.3.
Original Pull Request #2994 
Closes #2993
2024-10-29 11:37:38 +01:00
Peter-Josef Meisch
3e2c67a39f
Update elasticsearch-new.adoc 2024-10-22 06:13:44 +02:00
El-Harrougui MOHAMED
d2ab03e6a4
Add support for retrieving request executionDuration.
Original Pull Request #2991
Closes #2986
2024-10-22 06:11:57 +02:00
Mark Paluch
172933af8e
After release cleanups.
See #2982
2024-10-18 12:49:41 +02:00
Mark Paluch
378dcabe19
Prepare next development iteration.
See #2982
2024-10-18 12:49:40 +02:00
Mark Paluch
893c9cbf92
Release version 5.4 RC1 (2024.1.0).
See #2982
2024-10-18 12:47:01 +02:00
Mark Paluch
3157c62198
Prepare 5.4 RC1 (2024.1.0).
See #2982
2024-10-18 12:46:44 +02:00
Maryanto
fe8c2b13b0
Add count methods to ELC's ReactiveElasticsearchClient.
Original Pull Request #2985
Closes #2749
2024-10-17 17:13:28 +02:00
Mark Paluch
98716a871b
Consistently run all CI steps with the same user.
See #2982
2024-10-09 09:27:13 +02:00
Jens Schauder
d55947b81e
After release cleanups.
See #2914
2024-09-13 12:42:28 +02:00
Jens Schauder
6cb5f92928
Prepare next development iteration.
See #2914
2024-09-13 12:42:27 +02:00
Jens Schauder
b4ab1f28cd
Release version 5.4 M1 (2024.1.0).
See #2914
2024-09-13 12:39:33 +02:00
Jens Schauder
aab66c9595
Prepare 5.4 M1 (2024.1.0).
See #2914
2024-09-13 12:39:15 +02:00
Peter-Josef Meisch
d06c122fd5
Remove Blockhound
Original Pull Request #2978
Closes #2977
2024-09-04 18:10:20 +02:00
HAN SEUNGWOO
b1b232d354
Set refresh on DeleteByQueryRequest by DeleteQuery.
Original Pull Request #2976
Closes #2973
2024-09-03 20:09:26 +02:00
Peter-Josef Meisch
555b570246
Add excludeFromSource handling to multifield.
Original Pull Request #2975
Closes #2971
2024-08-31 21:18:35 +02:00
Peter-Josef Meisch
81eb167981
Upgrade to Elasticsearch 8.15.0.
Ortiginal Pull Request #2974
Closes #2963
2024-08-30 21:31:07 +02:00
Peter-Josef Meisch
6ad98bf500
Polishing 2024-08-19 20:14:13 +02:00
Aouichaoui Youssef
9149c1bc2e
Allow for null and empty parameters in the MultiField annotation.
Original Pull Request #2960
Closes #2952
2024-08-19 20:06:56 +02:00
Mark Paluch
d079a59cb4
Upgrade to Maven Wrapper 3.9.8.
See #2958
2024-08-08 10:22:09 +02:00
Mark Paluch
7a7145e5b1
Update CI properties.
See #2914
2024-08-08 10:20:12 +02:00
Peter-Josef Meisch
dbf932cb20
Polishing 2024-08-06 20:39:02 +02:00
Aouichaoui Youssef
738ee54a25
Support for SQL.
Original Pull Request: #2949
Closes: #2683
2024-08-06 20:32:26 +02:00
Peter-Josef Meisch
03992ba722
Polishing 2024-08-06 18:15:57 +02:00
Andriy Redko
06de217ceb
Allow to customize the mapped type name for @InnerField and @Field annotations.
Original Pull request: #2950
Closes #2942
2024-08-06 18:04:37 +02:00
Peter-Josef Meisch
eba8eec6c3
Upgrade to Elasticsearch 8.14.3.
Original Pull Request #2953
Closes #2947
2024-08-04 11:46:04 +02:00
Eric Haag
3fc19bbe8c
Migrate build to Spring Develocity Conventions extension.
* Migrate build to Spring Develocity Conventions extension.

* Adopt Develocity environment variables.

Closes #2944
2024-08-01 14:53:14 +02:00
Mark Paluch
8f8600727c
Bundle Javadoc with Antora documentation site.
Closes #2948.
2024-07-31 14:53:15 +02:00
Peter-Josef Meisch
95e028a1e9
Dependency updates and cleanup.
Original Pull Request #2946
Closes #2945
2024-07-30 06:56:32 +02:00
Peter-Josef Meisch
dd156b9e29
Enable use of search_after with field_collapse.
Original Pull Request #2937
Closes #2935
2024-07-06 09:08:27 +02:00
Peter-Josef Meisch
8d0ecf2aa3
Update migration-guide-5.2-5.3.adoc 2024-07-04 21:02:41 +02:00
Mark Paluch
4cc80abcd8
Switch to Broadcom docker proxy.
Closes #2934
2024-06-20 11:20:58 +02:00
Peter-Josef Meisch
eca6a7ec77
Upgrade to Elasticsearch-8.14.1.
Original Pull Request #2930
Closes #2929
2024-06-13 23:34:55 +02:00
puppylpg
d9d1b73dad
Fix missing element_type when using elasticsearch-java 8.14.x
Original Pull Request #2928
Closes #2927
2024-06-12 18:27:43 +02:00
Peter-Josef Meisch
d101eebc6d
Upgrade to Elasticsearch-8.14.0.
Original Pull Request #2926
Closes #2924
2024-06-11 21:24:57 +02:00
Peter-Josef Meisch
4ef5af1f2d
Update dependencies.
Original Pull Request #2923
Closes #2922
2024-06-01 15:26:45 +02:00
Peter-Josef Meisch
fade919be6
Polishing. 2024-05-28 20:57:27 +02:00
puppylpg
687b014e70
Add knn search parameter and remove knn query.
Original Pull Rrequest #2920
Closes #2919
2024-05-28 20:52:47 +02:00
Peter-Josef Meisch
9d139299b2
Add documentation for migration 5.3 to 5.4 2024-05-27 19:38:00 +02:00
Peter-Josef Meisch
161439ae22
Polishing 2024-05-26 20:31:42 +02:00
Aouichaoui Youssef
fbe54e485b
Add support for index aliases.
Original Pull Request #2905
Closes #2599
2024-05-26 20:16:21 +02:00
Peter-Josef Meisch
86e0e660be
Upgrade to Elasticsearch 8.13.4.
Original Pull Request #2918
Closes #2915
2024-05-19 11:48:34 +02:00
Peter-Josef Meisch
5ebe9f4492
Update version document. 2024-05-18 19:15:02 +02:00
Peter-Josef Meisch
e997b39f68
Fix max dim value for dense vector.
Closes #2911
2024-05-18 18:11:43 +02:00
Mark Paluch
41e32576e3
After release cleanups.
See #2896
2024-05-17 11:51:34 +02:00
Mark Paluch
82c4ea1391
Prepare next development iteration.
See #2896
2024-05-17 11:51:33 +02:00
Mark Paluch
2b76762007
Release version 5.3 GA (2024.0.0).
See #2896
2024-05-17 11:49:25 +02:00
Mark Paluch
baec1f1419
Prepare 5.3 GA (2024.0.0).
See #2896
2024-05-17 11:49:11 +02:00
Peter-Josef Meisch
d693c4f81b
Update README.adoc 2024-05-12 17:38:17 +02:00
Peter-Josef Meisch
94a40a7a75
Fix implementation of explicit refresh policy.
Original Pull Request #2908
Closes #2907
2024-05-10 09:33:39 +02:00
Peter-Josef Meisch
dc5bf5a606
Add the filter parts of a CriteriaQuery to the query, not as post-filter.
Original Pull Request #2906
Closes #2857
2024-05-04 09:46:41 +02:00
Mingron
1d89054d12
fix scripted-and-runtime-fields.adoc
Original Pull Request #2902
Closes #2903
2024-04-27 11:13:58 +02:00
Mingron
106b513d11
Fix retrieving data in Join-Type implementation.
Original Pull request #2900
Closes #2901
2024-04-21 19:51:20 +02:00
Peter-Josef Meisch
a16782ec73
Polishing. 2024-04-16 20:40:53 +02:00
Aouichaoui Youssef
2d5f8e8219
Support has_child and has_parent queries.
Original Pull Request: #2889
Closes #1472
2024-04-16 20:33:12 +02:00
Peter-Josef Meisch
ad66510e9e
Fix parameter in Order constructor.
Closes #2897
2024-04-15 21:06:04 +02:00
Mark Paluch
e1537087bf
After release cleanups.
See #2874
2024-04-12 10:53:00 +02:00
Mark Paluch
8eecbe6a32
Prepare next development iteration.
See #2874
2024-04-12 10:52:59 +02:00
Mark Paluch
c79fe303db
Release version 5.3 RC1 (2024.0.0).
See #2874
2024-04-12 10:50:42 +02:00
Mark Paluch
b507abe327
Prepare 5.3 RC1 (2024.0.0).
See #2874
2024-04-12 10:50:27 +02:00
Peter-Josef Meisch
bec3beb1eb
Upgrade to Elasticsearch 8.13.2.
Original Pull Request #2893
Closes #2891
2024-04-11 20:11:55 +02:00
Peter-Josef Meisch
1d709f6c55
Code cleanup.
Original Pull Request #2890
Closes #2888
2024-04-09 23:24:30 +02:00
Peter-Josef Meisch
0beca99912
Update README.adoc 2024-04-02 17:32:55 +02:00
Peter-Josef Meisch
6d51e67948
Introduce MappingConversionException.
Original Pull Request #2882
Closes #2879
2024-03-31 19:27:05 +02:00
Seungheon Han
0a51dbab01
Correcting a typo in ElasticsearchAotPredicates class.
Original Pull Request #2881
Closes #2880
2024-03-30 10:36:07 +01:00
Peter-Josef Meisch
c96423d5ba
Polishing. 2024-03-26 19:53:14 +01:00
Aouichaoui Youssef
496b8d62a4
Support Delete by query with es parameters.
Original Pull Request #2875
Closes #2865
2024-03-26 19:18:26 +01:00
Peter-Josef Meisch
d2b3ba94f6
Nullability annotation cleanup. 2024-03-25 19:51:30 +01:00
Peter-Josef Meisch
33973ec839
Polishing. 2024-03-24 18:46:04 +01:00
Peter-Josef Meisch
7f178238db
Add environment variable to skip repository initialization.
Original Pull Request #2878
Closes #2876
2024-03-24 17:37:11 +01:00
mawen12
aa27bbec27
Remove unnecessary code.
Original Pull Request #2870
Closes #2869
2024-03-15 13:45:59 +01:00
Mark Paluch
bd6b6e92f4
After release cleanups.
See #2851
2024-03-15 11:09:58 +01:00
Mark Paluch
87eb36a995
Prepare next development iteration.
See #2851
2024-03-15 11:09:57 +01:00
Mark Paluch
41cab97f78
Release version 5.3 M2 (2024.0.0).
See #2851
2024-03-15 11:07:31 +01:00
Mark Paluch
f4d2ff7a99
Prepare 5.3 M2 (2024.0.0).
See #2851
2024-03-15 11:07:10 +01:00
Peter-Josef Meisch
9472161808
Add package-info.java files. 2024-03-05 20:03:42 +01:00
Peter-Josef Meisch
debf04b499
Fix setting setting id in bulkrequest.
Original Pull Request #2862
Closes #2861
2024-02-28 20:58:43 +01:00
Aouichaoui Youssef
205d74b6db
Implement the equals and hashCode contracts for Field.
Original Pull Request #2859
Closes #2858
2024-02-26 20:57:17 +01:00
Aouichaoui Youssef
7a8a9a15f1
Wrap the OrCriteria correctly.
Original Pull Request #2855
Closes #2854
2024-02-26 20:05:03 +01:00
Peter-Josef Meisch
c965862e82
Polishing. 2024-02-26 19:07:53 +01:00
puppylpg
6af099ea34
Add SpEL support for highlight query and source filter.
Original Pull Request #2853
Closes #2852
2024-02-26 18:59:47 +01:00
Peter-Josef Meisch
96185f94ef
Upgrade to Elasticsearch 8.12.2.
Original Pull Request #2856
Closes #2836
2024-02-24 12:49:06 +01:00
Christoph Strobl
ca85729ea4
After release cleanups.
See #2772
2024-02-16 14:41:25 +01:00
Christoph Strobl
f9d01df6f7
Prepare next development iteration.
See #2772
2024-02-16 14:41:24 +01:00
Christoph Strobl
d16951eace
Release version 5.3 M1 (2024.0.0).
See #2772
2024-02-16 14:37:38 +01:00
Christoph Strobl
e1730ea7cc
Prepare 5.3 M1 (2024.0.0).
See #2772
2024-02-16 14:37:01 +01:00
Peter-Josef Meisch
0f5497338a
Add support for field aliases in the index mapping.
Original Pull Request #2847
Closes #2845
2024-02-07 20:26:17 +01:00
Peter-Josef Meisch
e9ecebd9ef
Fix criteria filter in native query.
Original Pulle Request #2846
Closes #2840
2024-02-06 20:56:41 +01:00
Peter-Josef Meisch
9a3f5dc4f5
Update elasticsearch-new.adoc 2024-02-01 07:11:45 +01:00
Peter-Josef Meisch
6390aaa739
Polishing. 2024-01-31 20:43:26 +01:00
puppylpg
b391a4e844
Unify conversion services for value replacement when querying elasticsearch.
Original Pull Request #2834
Closes #2833
2024-01-31 20:08:04 +01:00
Peter-Josef Meisch
0a1e20579e
Fix store null values implementation.
Original Pull Request #2841
Closes #2839
2024-01-31 15:28:49 +01:00
Mark Paluch
1f75016977
Refine Artifactory build name.
See #2772
2024-01-31 15:13:28 +01:00
Eric Haag
3878540394
Update Revved up by Develocity badge.
Original Pull Request #2835
2024-01-23 21:11:46 +01:00
Peter-Josef Meisch
957fe0531f
Remove deprecated code; add arch unit tests.
Original Pull Request #2832
Closes #2831
2024-01-19 21:51:12 +01:00
Peter-Josef Meisch
460b4ac0f5
Polishing. 2024-01-19 19:38:56 +01:00
puppylpg
e1a2412651
Add support for SpEL in @Query.
Original Pull Request #2826
Closes #2083
2024-01-19 19:19:03 +01:00
Peter-Josef Meisch
c6041fb659
Upgrade to Elasticsearch 8.11.4.
Original Pull Request #2830
Closes #2828
2024-01-19 07:36:30 +01:00
Peter-Josef Meisch
8f745b19d1
Upgrade to Elasticsearch 8.11.3.
Original Pull Request #2822
Closes #2820
2024-01-06 17:06:17 +01:00
Mark Paluch
c16024d779
Extend license header copyright years to 2024.
See #2819
2024-01-02 14:42:08 +01:00
Peter-Josef Meisch
af1d2dd641
fix typo 2023-12-30 17:04:29 +01:00
Peter-Josef Meisch
06ede8d7ae
documentation update 2023-12-30 16:18:21 +01:00
puppylpg
1554c3c94f
Support multi search template API.
Original Pull Request #2807
Closes #2704
2023-12-30 16:10:36 +01:00
Peter-Josef Meisch
260dadd4d6
Make org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchTemplate.ClientCallback public.
Original Pull Request #2815
Closes #2814
2023-12-29 12:44:54 +01:00
Junghoon Ban
b78588eec5
Remove duplicate declaration of identifying type for repository.
Original Pull Request #2813
Closes #2812
2023-12-28 13:59:25 +01:00
Peter-Josef Meisch
b0c97ccf27
Polishing 2023-12-28 13:53:42 +01:00
puppylpg
433d52981e
Expose search shard statistics in search hits.
Original Pull Request #2806
Closes #2605
2023-12-28 12:57:44 +01:00
Peter-Josef Meisch
6350514e7e
Update documentation.
Original Pull Request #2811
Closes #2810
2023-12-24 14:47:14 +01:00
David Pilato
02bd3e60f8
ClientConfigurer is only available in MaybeSecureClientConfigurationBuilder.
The documentation code does not compile and I'm not sure if it's a bug in the code or a miss in the documentation.

When you want to configure a client, the doc says to use:

```java
ClientConfiguration.builder().withClientConfigurer( // ...
```

But `withClientConfigurer(ClientConfiguration.ClientConfigurationCallback<?> clientConfigurer)` is only available in `TerminalClientConfigurationBuilder` interface.

And `ClientConfiguration.builder()` returns a `ClientConfigurationBuilderWithRequiredEndpoint` interface.
2023-12-21 14:50:18 +01:00
Peter-Josef Meisch
21a1fbca0f
Clarified dependencies in the documentation 2023-12-18 15:18:37 +01:00
Peter-Josef Meisch
434de11f3d
Polishing. 2023-12-17 18:19:51 +01:00
puppylpg
96b38652ab
Support highlight query in @HighlightParameters annotation.
Original Pull Request #2802
2023-12-17 18:16:18 +01:00
Mark Paluch
d0ed80dfde
Update CI properties.
See #2772
2023-12-14 08:50:32 +01:00
Mark Paluch
362126e72d
Upgrade to Maven Wrapper 3.9.6.
See #2801
2023-12-14 08:40:44 +01:00
puppylpg
0e419133a2
support highlight_query (#2793)
* support highlight_query

* implement highlight query with spring data elasticsearch query

* highight query by StringQuery

* split highligh fields assertion into different parts
2023-12-13 21:03:59 +01:00
Peter-Josef Meisch
8a3df63493
Upgrade to Elasticsearch 8.11.2.
Original Pull Request #2798
Closes #2797
2023-12-12 19:27:58 +01:00
Peter-Josef Meisch
fb9ccf7b44
Polishing. 2023-12-12 18:58:34 +01:00
Junghoon Ban
1d6a1b0f2f
Use switch expressions to simplify case branches.
Original Pull Request #2795
Closes #2794
2023-12-12 18:45:03 +01:00
Patrick Baumgartner
72e8f41de5
Fixes Typo ElasticsearchHttpClientConfigurationCallback.
Original Pull Request #2790
Closes #2792
2023-12-08 10:27:23 +01:00
李潇
4edf9bee41
Update elasticsearch-repositories.adoc.
Original Pull Request #2789
Closes #2791
2023-12-08 10:24:18 +01:00
Junghoon Ban
8613eb26e0
Use pattern matching instead of type casting.
Original Pull Request #2784
Closes #2785
2023-12-03 13:22:06 +01:00
Peter-Josef Meisch
415d5e0385
Removed junk characters from code. 2023-11-30 20:34:57 +01:00
Peter-Josef Meisch
3833975a1a
Fix type of returned sort values.
Original Pull Request #2786
Closes #2777
2023-11-30 20:29:34 +01:00
Peter-Josef Meisch
05ca90ecc1
Add strict date formats.
Original Pull Requests #2782
Closes #2779
2023-11-27 22:02:17 +01:00
Mark Paluch
7af76338fc
Introduce property for Jenkins user and Artifactory server details.
Closes #2781
2023-11-27 14:23:33 +01:00
Peter-Josef Meisch
1f4479092a
Improve client ssl configuration.
Original Pull Request #2780
Closes #2778
2023-11-24 19:09:43 +01:00
Runbing
ddd795a3d3
Fixed the URL for the Spring Data Commons documentation.
I fixed broken links in the Spring Data Elasticsearch documentation for Spring Data Commons.

Closes #2776
2023-11-20 11:31:45 +01:00
Mark Paluch
612cc50b88
After release cleanups.
See #2737
2023-11-17 14:33:27 +01:00
Mark Paluch
d05b9f878a
Prepare next development iteration.
See #2737
2023-11-17 14:33:25 +01:00
Mark Paluch
7408bf5d18
Release version 5.2 GA (2023.1.0).
See #2737
2023-11-17 14:29:59 +01:00
Mark Paluch
426dee7041
Prepare 5.2 GA (2023.1.0).
See #2737
2023-11-17 14:28:30 +01:00
Peter-Josef Meisch
559953a43c
Update versions.adoc 2023-11-15 08:54:27 +01:00
Peter-Josef Meisch
d21f9f70f0
Update versions.adoc 2023-11-15 08:53:19 +01:00
Peter-Josef Meisch
d25fd52fac
Update to Elasticsearch 8.11.1.
Original Pull Request #2763
Closes #2762
2023-11-15 08:49:41 +01:00
Peter-Josef Meisch
2f6fae632b
Fix handling of @ID property in Java records.
Original Pull Request #2757
Closes #2756
2023-11-08 07:42:16 +01:00
Peter-Josef Meisch
9abcacb2e9
Use routing info on delete operations.
Original Pull Request #2755
Closes #2754
2023-11-06 21:11:35 +01:00
Peter-Josef Meisch
3b93b6aea9
Use correct overload of Flux.bufferTimeout().
Original Pull Request #2753
Closes #2607
2023-11-03 13:51:23 +01:00
Gonçalo Montalvão Marques
d281df74d1
docs: Fix typos in documentation (#2752)
* docs: Fix typos in documentation

* docs: Address PR remarks
2023-11-02 20:52:27 +01:00
Peter-Josef Meisch
73fe0869e6
Fix reactive native sort.
Original Pull Request #2746
Closes #2745
2023-10-23 21:48:44 +02:00
mawen12
a0b04a346e
The parameter in Criteria#assertNoBlankInWildcardQuery is set incorrectly.
Original Pull Request #2744
Closes #2743
2023-10-21 07:32:51 +02:00
Eric Haag
62686f3b38
Connect build to ge.spring.io.
This change publishes a build scan to ge.spring.io for every local build from an authenticated Spring committer and for CI where appropriate access tokens are available. The build will not fail if publishing fails.

This change also allows the build to benefit from local and remote build caching, providing faster builds for all contributors.

Additionally, the project will have access to all features of Gradle Enterprise such as:

- Dashboards to view all historical build scans, along with performance trends over time
- Build failure analytics for enhanced investigation and diagnosis of build failures
- Test failure analytics to better understand trends and causes around slow, failing, and flaky tests

See #2718
2023-10-20 13:48:36 -05:00
Greg L. Turnquist
dda9e9974d
Update CI properties.
See #2737
2023-10-19 09:38:56 -05:00
Junghoon Ban
ba446845e3
Use pattern matching instead of type casting.
Original Pull Request #2742
Closes #2741
2023-10-17 18:06:48 +02:00
Greg L. Turnquist
64ada11462
Update CI properties.
See #2737
2023-10-16 13:28:22 -05:00
Peter-Josef Meisch
bdcd7c82c4
Polishing. 2023-10-13 20:47:04 +02:00
mawen12
6180f596d8
Use ExistsRequest instead of GetRequest to check if documents exists.
Original Pull Re1uest #2728
Closes #2726
2023-10-13 20:42:39 +02:00
John Blum
db3ad1338c
After release cleanups.
See #2700
2023-10-13 08:52:01 -07:00
John Blum
64c5fb16da
Prepare next development iteration.
See #2700
2023-10-13 08:51:59 -07:00
John Blum
377a08cdbc
Release version 5.2 RC1 (2023.1.0).
See #2700
2023-10-13 08:44:26 -07:00
John Blum
2d87d25707
Prepare 5.2 RC1 (2023.1.0).
See #2700
2023-10-13 08:43:56 -07:00
Peter-Josef Meisch
cab94b0207
Upgrade to elasticsearch 8.10.3 (#2731)
Closes #2729
2023-10-13 08:33:35 +02:00
Peter-Josef Meisch
9f42ec965c
Enhance refresh policy handling.
Original Pull Request #2725
Closes #2722
2023-10-11 21:54:38 +02:00
Peter-Josef Meisch
0b33d7fe57
Introduce IndexOperationsAdapter.
Original Pull Request #2724
Closes #2723
2023-10-08 13:13:09 +02:00
Peter-Josef Meisch
ccb7d2387f
Consider Pageable in stream repository method.
Original Pull Request #2721
Closes #2720
2023-10-06 21:38:30 +02:00
Peter-Josef Meisch
d905c813c7
Upgrade to Elasticsearch 8.10.2.
Original Pull Request #2719
Closes #2713
2023-10-05 22:29:35 +02:00
John Blum
8e32868fb1
Update CI properties.
See #2700
2023-10-04 17:24:11 -07:00
John Blum
df31d1b7db
Upgrade to Maven Wrapper 3.9.5.
See #2714
2023-10-04 16:58:13 -07:00
Mark Paluch
fb989db635
Upgrade to OpenWebBeans 4.0.
Closes #2712
2023-09-29 10:25:06 +02:00
Peter-Josef Meisch
092306aeea
Allow explicit index mapping writing on repository startup.
Original Pull Request #2708
Closes #2465
2023-09-23 17:34:36 +02:00
Peter-Josef Meisch
3330d65edf
Fix converting of Range<?> in Lists.
Original Pull Request #2707
Closes #2706
2023-09-23 10:43:17 +02:00
Peter-Josef Meisch
bbfb6ff463
Allow providing a custom ElasticsearchTransport in the configuration classes.
Original Pull Request #2703
Closes #2702
2023-09-17 15:30:06 +02:00
Mark Paluch
de87dd42ee
After release cleanups.
See #2675
2023-09-15 11:33:23 +02:00
Mark Paluch
9902729d90
Prepare next development iteration.
See #2675
2023-09-15 11:33:20 +02:00
Mark Paluch
764b1f6faf
Release version 5.2 M3 (2023.1.0).
See #2675
2023-09-15 11:30:15 +02:00
Mark Paluch
87523d7f68
Prepare 5.2 M3 (2023.1.0).
See #2675
2023-09-15 11:29:22 +02:00
Peter-Josef Meisch
2d0aee08ce
Fix refresh policy in UpdateQuery.
Original Pull Request #2696
Closes #2692
2023-09-13 21:47:19 +02:00
Peter-Josef Meisch
50317d648e
Upgrade to Elasticsearch 8.10.0.
Original Pull Request #2693
Closes #2687
2023-09-13 19:01:40 +02:00
Mark Paluch
ddd7e67d1d
Polishing.
Use dynamic copyright year.

See #2685
2023-09-11 09:05:33 +02:00
dependabot[bot]
d97e8eca41
Bump com.github.tomakehurst:wiremock-jre8 from 2.35.0 to 2.35.1
Original Pull Request #2686
2023-09-10 19:08:50 +02:00
Peter-Josef Meisch
e6338f95c2
Update TESTING.adoc
Removed the section about mutation testing as this dependency has never really been used and was already removed
2023-09-09 08:31:35 +02:00
Greg L. Turnquist
f4a5796694
Update CI properties.
See #2675
2023-09-05 13:25:24 -05:00
Mark Paluch
1a0e147119
Migrate documentation site to Antora.
Closes #2685
2023-09-04 10:41:26 +02:00
Peter-Josef Meisch
a82952b124
Polishing. 2023-09-03 14:39:49 +02:00
Sébastien Comeau
7c466395c4
Fix: missing PhraseSuggestion.Entry.Option's score and collateMatch values.
Original Pull Request #2680
Closes #2681
2023-09-03 14:35:36 +02:00
Peter-Josef Meisch
17a09eaba7
Add strict_date_optional_time_nanos field type.
Original Pull Request #2684
Closes #2676
2023-09-03 13:53:50 +02:00
Peter-Josef Meisch
b99ca1816a
Fix adaption to PersistentProperty change. 2023-09-01 23:41:54 +02:00
Mark Paluch
1a24c3c989
Adapt to changed PersistentProperty interface.
Closes #2682
2023-08-31 09:52:45 +02:00
Peter-Josef Meisch
9adc4d2b36
Fix search_after field values (#2679)
Closes #2678
2023-08-28 19:51:41 +02:00
Peter-Josef Meisch
922c7dd4a7
Add support for parameters for runtime fields.
Original Pull Request #2677
Closes #2303
2023-08-26 22:13:26 +02:00
Julia Lee
ed898431ab
After release cleanups.
See #2630
2023-08-18 08:59:40 -04:00
Julia Lee
db2ec86185
Prepare next development iteration.
See #2630
2023-08-18 08:59:37 -04:00
Julia Lee
c39a1911d7
Release version 5.2 M2 (2023.1.0).
See #2630
2023-08-18 08:50:32 -04:00
Julia Lee
f79b010407
Prepare 5.2 M2 (2023.1.0).
See #2630
2023-08-18 08:49:40 -04:00
Julia Lee
7092e04feb
Update CI properties.
See #2630
2023-08-14 12:15:34 -04:00
Julia Lee
dcabdb19d0
Upgrade to Maven Wrapper 3.9.4.
See #2670
2023-08-14 08:53:29 -04:00
Peter-Josef Meisch
8c5ff92cd2
Fix similarity field mapping.
Original Pull Request #2666
Closes #2659
2023-08-13 21:18:35 +02:00
JKatzwinkel
a7185b1b84
Fix some typos in scripted and runtime fields doc.
Original Pull Request: #2665
Closes: #2664
2023-08-13 17:33:16 +02:00
Junghoon Ban
034bea6bb6
Fix incorrect schema version info in spring.schemas.
Original Pull Request #2662
Closes #2661
2023-08-13 07:34:28 +02:00
Peter-Josef Meisch
e23c059126
Polishing. 2023-08-11 17:00:19 +02:00
Peter-Josef Meisch
1fb034a9a8
Scripted and runtime fields improvements.
Original Pull Request #2663
Closes #2035
2023-08-11 16:12:52 +02:00
Peter-Josef Meisch
82ae11833a
Polishing. 2023-08-01 17:43:18 +02:00
Peter-Josef Meisch
412a2e2ea1
Upgrade to Elasticsearch 8.9.0.
Original Pull Request #2656
Closes #2650
2023-07-31 19:13:53 +02:00
Peter-Josef Meisch
bd71a9311c
Add support for nested sort.
Original Pull Request #2653
Closes #1783
2023-07-30 18:29:52 +02:00
Peter-Josef Meisch
076f261a7d
Enable MultiField annotation on entity getter.
Original Pull Request #2649
Closes #2600
2023-07-27 20:42:51 +02:00
Peter-Josef Meisch
ad67c00a79
Add VersionConflictException.
Original Pull Request #2643
Closes #2467
2023-07-21 14:57:52 +02:00
Peter-Josef Meisch
4e9bbe5045
Add IndicesOptions to search request.
Original Pull Request #2642
Closes #2641
Closes #2639
2023-07-21 13:52:42 +02:00
Peter-Josef Meisch
0028d7d550
fix typos in method and docs.
Original Pull Request #2640
Closes #2638
2023-07-21 08:36:36 +02:00
Peter-Josef Meisch
d9bb9911f9
Fix MappingElasticsearchConverter.
Original Pull Request #2637
Closes #2627
2023-07-18 22:49:46 +02:00
Peter-Josef Meisch
1921d3a45e
Polishing 2023-07-18 18:31:42 +02:00
ILLIA ULIANOV
c7000fc004
Extend BulkFailureException.failedDocuments return type to show more details about failure.
Original Pull Request #2633
Related tickets #2619
2023-07-18 18:27:31 +02:00
Junghoon Ban
341518d0cc
Refactoring to use spring jcl module instead of slf4j.
Original Pull Request #2635
Closes #2634
2023-07-16 21:06:38 +02:00
Mark Paluch
5b4ab0c86e
After release cleanups.
See #2549
2023-07-14 14:57:13 +02:00
Mark Paluch
ac158fd4b4
Prepare next development iteration.
See #2549
2023-07-14 14:57:11 +02:00
Mark Paluch
0ff436aad2
Release version 5.2 M1 (2023.1.0).
See #2549
2023-07-14 14:53:19 +02:00
Mark Paluch
69bafdeebe
Prepare 5.2 M1 (2023.1.0).
See #2549
2023-07-14 14:52:14 +02:00
Peter-Josef Meisch
9202f81567
Upgrade to Elasticsearch 8.8.2.
Original Pull Request #2626
Closes #2621
2023-07-12 20:32:39 +02:00
Peter-Josef Meisch
60d735c553
Add FieldTypes.
Original Pull Request #2616
Closes #2592
2023-07-03 21:59:11 +02:00
Mark Paluch
bae30ec757
Update CI properties.
See #2549
2023-07-03 09:50:19 +02:00
Mark Paluch
dca6faae95
Upgrade to Maven Wrapper 3.9.3.
See #2615
2023-07-03 09:49:51 +02:00
Hoseok
e67bb210b9
Correcting a typo in elasticsearch-repository-queries document.
Original Pull Request #2610
Closes #2611
2023-07-01 11:34:44 +02:00
Peter-Josef Meisch
b52af37879
Upgrade to Elasticsearch 8.8.1.
Original Pull Request  #2609
Closes #2608
2023-06-28 21:24:07 +02:00
Peter-Josef Meisch
d9fd722bb6
Fix IndicesBoost error.
Original Pull Request #2606
Closes #2598
2023-06-27 22:26:10 +02:00
Greg L. Turnquist
e202772744
Stop posting build status on internal Slack.
See #2603
2023-06-26 13:37:46 -05:00
Peter-Josef Meisch
b7570ffa95
Polishing 2023-06-24 09:39:22 +02:00
seunghyun.cheong
8a164b1039
Adding GeoDistanceOrder's direction in request.
Original Pull Request #2602
Closes #2601
2023-06-24 09:34:04 +02:00
Łukasz Jernaś
a2cbca57f6
Fix some typos in object mapping doc.
Original Pull Request #2596
Closes #2597
2023-06-19 19:09:03 +02:00
Mark Paluch
9f6d3f7e61
Upgrade to Maven Wrapper 3.9.2.
See #2589
2023-06-13 08:55:08 +02:00
Mark Paluch
384e95d187
Reformat pom.xml.
See #2585
2023-06-06 10:56:23 +02:00
Mark Paluch
1833feab6b
Use snapshot and milestone repositories instead of libs-snapshot and libs-milestone.
Closes #2585
2023-06-06 10:56:10 +02:00
Peter-Josef Meisch
8ad2ea9a5d
Documentation update.
Original Pull Request #2584
Closes #2583
2023-06-04 12:34:07 +02:00
Peter-Josef Meisch
1b290f6847
Upgrade to Elasticsearch 8.8.0.
Original Pull Request #2582
Closes #2577
2023-06-04 12:16:02 +02:00
Peter-Josef Meisch
d6b5540614
Fix reactive save of Flux.
Original Pull Request #2581
Closes #2576
2023-06-02 15:54:57 +02:00
Peter-Josef Meisch
11fc22566e
Polishing 2023-06-01 15:44:21 +02:00
Peter-Josef Meisch
1d8867be60
Make JsonpMapper a customizable bean.
Original Pull Request #2580
Closes #2566
2023-06-01 12:24:59 +02:00
Peter-Josef Meisch
f558822545
Extend AOT runtime hints.
Original Pull Request #2579
Closes #2575
2023-05-31 17:57:51 +02:00
Peter-Josef Meisch
cf09e57736
Add Kotlin extensions for several interfaces and CoroutineElasticsearchRepository.
Original Pull Request #2573
Closes #2545
2023-05-21 19:56:19 +00:00
Peter-Josef Meisch
f973236588
Test code cleanup.
Original Pull Request #2572
Closes #2571
2023-05-20 23:49:45 +02:00
Peter-Josef Meisch
36e3b93ea9
Make SearchType in query nullable, set to null in NativeQuery with knnQuery.
Original Pull Request #2570
Closes #2569
2023-05-20 17:31:30 +02:00
Peter-Josef Meisch
6edd3cf1fe
Polishing 2023-05-17 19:27:37 +02:00
Pierre Mazieres @Semarchy
7b527c4451
"BaseQuery" class : the "build" method does not apply to the "runtimeFields" field.
Original Pull Request #2568
Closes #2567
2023-05-17 18:52:01 +02:00
Peter-Josef Meisch
5b02364384
Remove deprecated code.
Original Pull Request #2564
Closes #2563
2023-05-13 13:29:06 +02:00
Peter-Josef Meisch
34b0181014
Fix Javadoc.
Original Pull Request: #2562
Closes #2561
2023-05-13 09:44:48 +02:00
Peter-Josef Meisch
f464f77985
Remove the integration of the deprecated RestHighLevelClient.
Original Pull Request #2560
Closes #2558
2023-05-13 09:07:52 +02:00
Peter-Josef Meisch
73e9a6f5c5
Refactoring to prepare for removal of the old deprecated RestHighLevelClient integration.
Original Pull Request #2559 
Closes #2557
2023-05-13 08:22:10 +02:00
Peter-Josef Meisch
f897dd4318
Upgrade to Elasticsearch 8.7.1.
Original Pull Request #2555
Closes #2541
2023-05-12 22:20:10 +02:00
Peter-Josef Meisch
0b0640b509
Add documentation for the new 5.2 version in main branch.
Original Pull Request #2552
Closes #2551
2023-05-12 18:50:16 +02:00
Christoph Strobl
5ab1c2505c
After release cleanups.
See #2532
2023-05-12 14:18:54 +02:00
Christoph Strobl
85aaff9d6e
Prepare next development iteration.
See #2532
2023-05-12 14:18:52 +02:00
Christoph Strobl
2f54bdec01
Release version 5.1 GA (2023.0.0).
See #2532
2023-05-12 14:14:39 +02:00
Christoph Strobl
b3d582cd93
Prepare 5.1 GA (2023.0.0).
See #2532
2023-05-12 14:14:08 +02:00
Pierre Mazieres @Semarchy
9c497c2dea
Fix assignment in NativeQueryBuilder.
Original Pull Request: #2543
Closes #2542
2023-05-10 18:31:04 +02:00
Peter-Josef Meisch
406961c13b
Allow SSL configuration with the Elasticsearch CA fingerprint.
Original Pull Request #2540
Closes #2539
2023-04-29 18:43:50 +02:00
Peter-Josef Meisch
17ecce4362
Documentation update.
Original Pull Request #2537
Closes #2536
2023-04-23 22:16:53 +02:00
Peter-Josef Meisch
bbd5e8119a
Component templates.
Original Pull Request #2534
Closes #1458
2023-04-18 20:58:07 +02:00
Peter-Josef Meisch
df7a614638
dependency updates.
Original Pull Request #2531
Closes #2530
2023-04-15 12:37:50 +02:00
Greg L. Turnquist
90db137548
After release cleanups.
See #2500
2023-04-14 12:00:04 -05:00
Greg L. Turnquist
aa3a3df2f3
Prepare next development iteration.
See #2500
2023-04-14 11:59:59 -05:00
Greg L. Turnquist
de437cd7da
Release version 5.1 RC1 (2023.0.0).
See #2500
2023-04-14 11:54:01 -05:00
Greg L. Turnquist
5ac83f696e
Prepare 5.1 RC1 (2023.0.0).
See #2500
2023-04-14 11:53:25 -05:00
Peter-Josef Meisch
6100c2491a
Cleanup.
Original Pull Request #2526
Closes #2525
2023-04-12 22:19:19 +02:00
Peter-Josef Meisch
d597baccd3
Upgrade to Elasticsearch 8.7.0.
Original Pull Request #2524
Closes #2523
2023-04-11 20:45:52 +02:00
Peter-Josef Meisch
dfc1be286c
Polishing 2023-04-10 11:22:45 +02:00
JKatzwinkel
1f7fa77c15
Fix inner hits metadata mapping.
Original Pull Request #2522
Closes #2521
2023-04-10 11:18:26 +02:00
Mark Paluch
699c0ef265
Upgrade to Maven Wrapper 3.9.1.
See #2518
2023-04-06 16:16:37 +02:00
Peter-Josef Meisch
9771b9c1d6
clarify PR submission 2023-04-05 08:07:27 +02:00
Peter-Josef Meisch
437279f637
remove erroneous linebreak 2023-04-04 17:45:28 +02:00
Peter-Josef Meisch
ed1c416cd3
Javadoc
Original Pull Request #2516
Closes #2515
2023-04-03 20:20:13 +02:00
Peter-Josef Meisch
a5fb7a3c76
Remove old methods from configuration.
Original Pull Request #2513
Closes #2512
2023-04-02 20:16:13 +02:00
Greg L. Turnquist
7f772703d3
Test against Java 20 on CI.
See #2507.
2023-03-30 11:40:56 -05:00
Greg L. Turnquist
43eb40e45e
Upgrade to BlockHound 1.0.7.RELEASE.
Closes #2510.
2023-03-30 11:39:57 -05:00
Greg L. Turnquist
75bf578b31
Update CI properties.
See #2500
2023-03-28 13:58:23 -05:00
Peter-Josef Meisch
675b77982b
Allow field names with dots.
Original Pull Request #2504
Closes #2502
2023-03-22 19:51:00 +01:00
Christoph Strobl
d95af9fcfa
After release cleanups.
See #2464
2023-03-20 15:05:35 +01:00
Christoph Strobl
96985fa14a
Prepare next development iteration.
See #2464
2023-03-20 15:05:34 +01:00
Christoph Strobl
ff1f25b0b2
Release version 5.1 M3 (2023.0.0).
See #2464
2023-03-20 15:01:48 +01:00
Christoph Strobl
d3e95815d9
Prepare 5.1 M3 (2023.0.0).
See #2464
2023-03-20 15:01:20 +01:00
Peter-Josef Meisch
797dbb5a18
Improve save(Flux<T>) implementations.
Original Pull Request #2497
Closes #2496
Closes #2492
2023-03-19 15:01:24 +01:00
Mark Paluch
a7d6b9df6d
Adopt to newly introduced ParameterAccessor.getScrollPosition().
Closes #2494
2023-03-16 15:26:47 +01:00
Peter-Josef Meisch
ade90328d3
ValueConverters can be derived from AbstractPropertyValueConverter.
Original Pull Request #2490
Closes #2489
2023-03-05 20:54:20 +01:00
Peter-Josef Meisch
ec77b3a082
Add option to not write version to document source.
Original Pull Request #2487
Closes #2466
2023-03-05 09:53:41 +01:00
Peter-Josef Meisch
63cebd7038
Fix putMapping request creation .
Original Pull Request #2483
Closes #2487
2023-02-26 15:41:12 +01:00
Peter-Josef Meisch
e7c9bf20f6
Add option to specify if empty property should not be sent to Elasticsearch.
Original Pull Request #2482
Closes #2290
2023-02-25 17:50:12 +01:00
Peter-Josef Meisch
b4c3e25a60
Move scripted fields from native query up to base query.
Original Pull Request #2481
Closes #2477
2023-02-25 14:43:32 +01:00
Peter-Josef Meisch
43ab49b5fa
refactor tests
Original Pull Request #2480
Closes #2479
2023-02-25 13:38:50 +01:00
Peter-Josef Meisch
c9b8b1af19
Adapt custom routing.
Original Pull Request #2474
Closes #2087
2023-02-21 20:17:45 +01:00
Mark Paluch
9c80dc9ae8
Upgrade to Maven Wrapper 3.9.0.
See #2471
2023-02-20 11:58:19 +01:00
Peter-Josef Meisch
03ffb07827
Upgrade to Elasticsearch 8.6.2.
Original Pull Request #2470
Closes #2468
2023-02-19 12:57:18 +01:00
Christoph Strobl
d29cf7788b
After release cleanups.
See #2463
2023-02-17 14:25:49 +01:00
Christoph Strobl
71e46c8277
Prepare next development iteration.
See #2463
2023-02-17 14:25:47 +01:00
Christoph Strobl
fc1e8d3cf6
Release version 5.1 M2 (2023.0.0).
See #2463
2023-02-17 14:22:31 +01:00
Christoph Strobl
c84a8bbc12
Prepare 5.1 M2 (2023.0.0).
See #2463
2023-02-17 14:22:18 +01:00
Christoph Strobl
97a9176775
After release cleanups.
See #2367
2023-02-17 13:31:54 +01:00
Christoph Strobl
7eff8f5dd1
Prepare next development iteration.
See #2367
2023-02-17 13:31:53 +01:00
Christoph Strobl
6d4247312d
Release version 5.1 M1 (2023.0.0).
See #2367
2023-02-17 13:27:50 +01:00
Christoph Strobl
81f52244a8
Prepare 5.1 M1 (2023.0.0).
See #2367
2023-02-17 13:27:11 +01:00
Peter-Josef Meisch
e741df9c7c
Support KNN queries in NativeQuery.
Original Pull Request #2458
Closes #2433
2023-02-14 20:45:16 +01:00
Peter-Josef Meisch
3875bb6abf
Upgrade to Elasticsearch 8.6.1.
Original Pull Request #2455

Closes #2452
2023-02-14 18:34:19 +01:00
Peter-Josef Meisch
1860d7353a
Allow for Spring Data Elasticsearch queries to be added to NativeQuery.
Original Pull Request #2451
#Closes 2391
2023-02-12 17:50:55 +01:00
Peter-Josef Meisch
4f30a492b9
@Query annotated repository method does not use Sort parameter.
Original Pull Request #2450
Closes #2449
2023-02-10 22:46:39 +01:00
Peter-Josef Meisch
6805fff1fa
Option to add docvalue_fields to a search query.
Original Pull Request #2446
#Closes 2316
2023-02-06 20:39:00 +01:00
Urs Keller
0971acfe25
Fix ReactiveIndicesTemplate: Refresh not called on bound indices.
Original Pull Request #2444
Closes #2441
2023-02-03 19:56:47 +01:00
Zhenxi
36805c3ecb
Fix typo in documentation.
Original Pull Request #2443
Closes #2442
2023-02-03 18:31:16 +01:00
Mark Paluch
b75d2eb01f
Update CI properties.
See #2367
2023-01-30 10:49:51 +01:00
Mark Paluch
f94f2b0618
Upgrade to Maven Wrapper 3.8.7.
See #2440
2023-01-30 10:48:19 +01:00
Peter-Josef Meisch
82607b3d4d
Add Option to not store the id property in the document source.
Original Pull Request #2438
Closes #2364
2023-01-29 16:51:41 +01:00
Peter-Josef Meisch
cf9b106c31
Polishing 2023-01-26 19:07:21 +01:00
Hamid Rahimi
b0c2ce3084
Overload multiSearch method to support list of IndexCoordinates.
Original Pull Request #2436
Closes #2434
2023-01-26 19:03:35 +01:00
Peter-Josef Meisch
b3f9bdb80f
Support returning the name of the index an entity was persisted to.
Original Pull Request #2435
Closes #2112
2023-01-25 20:17:26 +01:00
Peter-Josef Meisch
d9bf76fb31
Fix reading response runtime field by mapping.
Original Pull Request #2432
Closes #2431
2023-01-22 19:15:12 +01:00
Peter-Josef Meisch
4d11a56e84
Upgrade to Elasticsearch 8.6.0.
Original Pull Request #2430
Closes #2426
2023-01-20 09:05:53 +01:00
Peter-Josef Meisch
73d5d623dd
Enable custom similarity value.
Original Pull Request #2429
Closes #2424
2023-01-19 21:08:40 +01:00
ezequielantunez
5a36f5e1e8
Add Query by Example feature.
Original Pull Request #2422
Closes #2418
2023-01-11 21:50:19 +01:00
Peter-Josef Meisch
44a5c7545f
AOT/Native support.
Original Pull Request #2423
Closes #2419
2023-01-08 15:43:32 +01:00
Peter-Josef Meisch
28489ffee8
findAllById returns all requested documents.
Original Pull Request #2421
Closes #2417
2023-01-04 17:13:22 +01:00
Mark Paluch
605c83f628
Extend license header copyright years to 2023.
See #2416
2023-01-02 09:53:40 +01:00
Peter-Josef Meisch
f3a6a42b82
Upgrade Elasticsearch to 8.5.3 (old client to 7.17.8).
Original Pull Request #2411
Closes #2403
2022-12-30 23:30:51 +01:00
Peter-Josef Meisch
efd394370a
Implement search by template.
Original Pull Request #2410
Closes #1891
2022-12-30 19:11:17 +01:00
Scooby
4d7d0955f9
IndexQuery's id get ignored in bulkIndexOperation.
Original Pull Request #2407
Closdes #2405
2022-12-27 19:53:51 +01:00
Peter-Josef Meisch
2fb90621a2
Polishing. 2022-12-23 14:20:56 +01:00
Hao
bc7667fdbc
Update documentation.
Original Pull Request #2400
Closes #2404
2022-12-23 14:19:28 +01:00
Peter-Josef Meisch
2ea568d2e4
Rename QueryBuilders to avoid name clash wih Elasticsearch class.
Original Pull Request #2397
Closes #2390
2022-12-16 20:15:22 +01:00
Peter-Josef Meisch
c460a5f37d
Add update(entity, index) operation.
Original Pull Request #2394
Closes #2385
2022-12-14 08:07:48 +01:00
Peter-Josef Meisch
e1c8a2adeb
Switch reactive unpaged search from scroll to pit with search_after.
Original Pull Request #2393
Closes #1685
2022-12-12 20:23:39 +01:00
Peter-Josef Meisch
014aa3dbf6
Add reactive search batch size option to query.
Original Pull Request #2392
Closes #2061
2022-12-07 13:07:05 +01:00
Peter-Josef Meisch
9446d726bc
Fix NPE in ElasticsearchExceptionTranslator.
Original Pull Request #2389
Closes #2388
2022-12-05 13:13:27 +01:00
Peter-Josef Meisch
1fa6c9f3e5
Support Kotlin Flow as possible return type in repository functions.
Original Pull Request #2387
Closes #2386
2022-12-03 22:46:55 +01:00
Peter-Josef Meisch
3c7ce7413a
Upgrade to Elasticsearch 8.5.2.
Original Pull Request #2382
Closes #2380
2022-11-26 09:24:13 +01:00
Peter-Josef Meisch
f6c6f64f04
Change AliasData filter property to Query.
Original Pull Request #2374
Closes #2073
2022-11-19 19:38:26 +01:00
Peter-Josef Meisch
9f63369c4b
Remove all indices after testing.
Original Pull Request #2373
Closes #2372
2022-11-19 15:12:32 +01:00
Peter-Josef Meisch
bae182b162
Upgrade to Elasticsearch 8.5.1.
Original Pull Request #2370
Closes #2368
2022-11-18 19:53:54 +01:00
Mark Paluch
8db4e430d7
Update CI properties.
See #2367
2022-11-18 15:31:11 +01:00
Mark Paluch
c1de8b1e85
After release cleanups.
See #2336
2022-11-18 14:30:20 +01:00
Mark Paluch
c7b8848afe
Prepare next development iteration.
See #2336
2022-11-18 14:30:19 +01:00
Mark Paluch
0cf1c08d6e
Release version 5.0 GA (2022.0.0).
See #2336
2022-11-18 14:26:23 +01:00
Mark Paluch
81cac1f505
Prepare 5.0 GA (2022.0.0).
See #2336
2022-11-18 14:26:13 +01:00
Peter-Josef Meisch
ab8cbdf4d9
Bulk operations must prefer index set on individual query.
Original Pull Request #2363
Closes #2362
2022-11-15 20:55:21 +01:00
Peter-Josef Meisch
d7e42fcb76
Update documentation.
Original Pull Request #2361
Closes #2360
2022-11-10 21:41:10 +01:00
Tiny
f8ddf16c0c
Update Dynamic.java
Original Pull Request #2357
Closes #2359
2022-11-10 20:09:56 +01:00
Jens Schauder
f79a8016d1
Replace New and Noteworthy with links to release notes.
Closes #2358
See spring-projects/spring-data-relational#1351
2022-11-10 15:24:36 +01:00
Mark Paluch
7d38d6c615
Remove unused test dependencies.
Also, pin CDI version to 3.0.

Closes #2355
2022-11-08 10:23:38 +01:00
Peter-Josef Meisch
ceca98492b
Deprecate ClientLogger.
Original Pull Request #2354
Closes #2353
2022-11-05 17:15:24 +01:00
Mark Paluch
08f86d8c22
After release cleanups.
See #2341
2022-11-04 15:26:39 +01:00
Mark Paluch
487a599bbb
Prepare next development iteration.
See #2341
2022-11-04 15:26:38 +01:00
Mark Paluch
1f4689297e
Release version 5.0 RC2 (2022.0.0).
See #2341
2022-11-04 15:23:17 +01:00
Mark Paluch
327774b8fa
Prepare 5.0 RC2 (2022.0.0).
See #2341
2022-11-04 15:23:07 +01:00
Peter-Josef Meisch
96c9aa8af6
Remove client specific code.
Original Pull Request #2352
Closes #2351
2022-11-03 20:44:25 +01:00
Peter-Josef Meisch
049bcf504e
Use custom refresh policy in reactive repository with all clients.
Original Pull Request #2350
Closes #2349
2022-11-03 19:49:48 +01:00
Peter-Josef Meisch
744b3ed6b4
Upgrade to Elasticsearch 8.5.0.
Original Pull Request #2348
Closes #2345
Closes #2300
2022-11-03 18:31:48 +01:00
Mark Paluch
5da1994b40
Update CI properties.
See #2341
2022-10-31 10:36:35 +01:00
Peter-Josef Meisch
14ab00f5b8
adapt auditing configuration.
Original Pull Request #2344
Closes #2343
2022-10-30 22:02:45 +01:00
Peter-Josef Meisch
883741e9c1
Remove javax nullability annotations.
Original Pull Request #2342
Closes #2340
2022-10-22 16:07:03 +02:00
Peter-Josef Meisch
e67150a55b
Fix repository methods value converting.
Original Pull Request #2339
Closes #2338
2022-10-19 21:52:49 +02:00
Mark Paluch
f21285d33c
After release cleanups.
See #2298
2022-10-13 17:31:16 +02:00
Mark Paluch
657741cadd
Prepare next development iteration.
See #2298
2022-10-13 17:31:15 +02:00
Mark Paluch
73a6a1214d
Release version 5.0 RC1 (2022.0.0).
See #2298
2022-10-13 17:24:25 +02:00
Mark Paluch
bf4d730328
Prepare 5.0 RC1 (2022.0.0).
See #2298
2022-10-13 17:24:04 +02:00
Peter-Josef Meisch
03ecc48b09
Escape backslash in StringQuery.
Original Pull Request 
Closes #2326
2022-10-11 22:36:43 +02:00
Peter-Josef Meisch
c05146adce
Upgrade to Elasticsearch 8.4.3.
Original Pull Request #2329
Closes #2323
2022-10-10 20:55:28 +02:00
Peter-Josef Meisch
c59395d36d
Adapt to Junit changes.
Original Pull Request #2325
Closes #2324
2022-10-07 09:00:15 +02:00
Gonçalo Montalvão Marques
ae88ea3506
Fix typos in documentation.
Original Pull Request #2321
Closes #2320
2022-10-06 12:57:48 +02:00
Peter-Josef Meisch
cdb92f6ee4
Enable non-field-backed properties.
Original Pull Request #2319
Closes #1489
2022-10-01 18:02:29 +02:00
Peter-Josef Meisch
5a52d6136f
Fix documentation index.
Original Pull Request #2315
Closes #2299
2022-09-28 22:21:23 +02:00
Peter-Josef Meisch
fb210e338f
Fix copyright year in documentation.
Original Pull Request #2314
Closes #2313
2022-09-27 21:57:43 +02:00
Peter-Josef Meisch
05c6444b71
Internal refactoring stringRepresentation/convertId.
Original Pull Request #2312
Closes #2228
2022-09-27 20:23:33 +02:00
Peter-Josef Meisch
8a1d8deb67
Polishing.
See #2304
2022-09-25 21:43:15 +02:00
puppylpg
b038bbe778
Update document partially by specified entity.
Original Pull Request #2310 
Closes #2304
2022-09-25 21:19:14 +02:00
Peter-Josef Meisch
1396f53fde
Add search extension plugins parameters to NativeQuery.
Original Pull Request #2307
Closes #2150
2022-09-23 19:37:02 +02:00
Peter-Josef Meisch
b4fe01d09b
Adapt to Elasticsearch client fix (ES client issue 286).
Original Pull Request #2306
Closes #2165
2022-09-23 07:41:19 +02:00
Peter-Josef Meisch
eabde9c543
Adapt to Elasticsearch fix.
Original Pull Request #2302
Closes #2171
2022-09-21 22:14:31 +02:00
Peter-Josef Meisch
120ca8579f
Upgrade to Elasticsearch 8.4.2.
Original Pull Request #2301
Closes #2284
2022-09-21 21:55:53 +02:00
Spring Builds
589b2adaca
After release cleanups.
See #2222
2022-09-19 14:39:11 +00:00
Spring Builds
77c844d809
Prepare next development iteration.
See #2222
2022-09-19 14:38:59 +00:00
Spring Builds
bad6afdecc
Release version 5.0 M6 (2022.0.0).
See #2222
2022-09-19 14:15:27 +00:00
Spring Builds
a6a5e3f7f5
Prepare 5.0 M6 (2022.0.0).
See #2222
2022-09-19 14:13:03 +00:00
Peter-Josef Meisch
b3a7a44db1
Adapt xml-namespace setup to the new Elasticsearch client.
Original Pull Request #2295
Closes #21294
2022-09-10 17:05:32 +02:00
Peter-Josef Meisch
ccf136c8e2
CDI implementation uses the new Elasticsearch client.
Original Pull Request #2293
Closes #2292
2022-09-10 11:09:43 +02:00
Peter-Josef Meisch
77da22598a
Fix NPE in RequestFactory when language in UpdateQuery is not set (4.4.x).
Original Pull Request #2288
Closes #2287

(cherry picked from commit 988736dd41bf5cf2e21f3dcad3fd4539595ff9dc)
2022-09-03 08:09:19 +02:00
Peter-Josef Meisch
86634ceb38
Fix mapping of property values into a collection.
When reading from Elasticsearch into a property of type Collection<T> (List<T> or Set<T>) the MappingElasticsearchConverter now can read both from the returned JSON:

    an array of T objects - will put the objects in a corresponding collection
    a single T object will put the single object into a corrsponding colletcion

This is implemented and tested for both: entities where the properties have setters and immutable classes that only provide an all-args constructor.

Original Pull Request #2282
Closes #2280
2022-08-29 20:14:11 +02:00
Peter-Josef Meisch
8377f64a8a
Fix update call in reactive client (Elasticsearch 7 client)
Original Pull Request #2281 
Closes #2276
2022-08-26 08:06:37 +02:00
Peter-Josef Meisch
b549601d34
Polishing documentation.
Adding missing documentation about the new HttpHeaders class

Original Pull Request #2279
See #2277
2022-08-24 18:37:54 +02:00
Peter-Josef Meisch
3298ba21ce
Use custom HttpHeaders.
Original Pull Request #2278
Closes #2277
2022-08-24 13:10:27 +02:00
Peter-Josef Meisch
18be558740
Reactive implementation of the point in time API.
This PR adds the reactive implementation for the point in time API that was missing in #2273.

Original Pull Request #2275
Closes #2274
2022-08-20 18:23:50 +02:00
Peter-Josef Meisch
46cd4cd59e
Implement the point in time API.
Original Pull Request #2273
Closes #1684
2022-08-17 13:11:11 +02:00
Peter-Josef Meisch
a4ed7300d1
Code cleanup (Java 17).
Original Pull Request #2271
Closes #2270
2022-08-13 15:07:47 +02:00
Peter-Josef Meisch
b511756b2b
Polishing.
See #2265
2022-08-12 07:27:07 +02:00
Peter-Josef Meisch
68ba4cd39b
Polishing.
See #2267
2022-08-11 06:53:07 +02:00
cdalexndr
6b39b39d35
support RuntimeField with no script.
Original Pull Request #2268
Closes #2267
2022-08-11 06:31:17 +02:00
Peter-Josef Meisch
4f4c99ec1f
Fix javadoc error.
See #2265
2022-08-10 21:48:05 +02:00
Sascha Woo
6cfb8eeea6
[elc] add support for sorting results by SortOptions to NativeQuery.
Original Pull Request #2264
Closes #2263
2022-08-10 21:34:17 +02:00
Peter-Josef Meisch
c4910bf399
Polishing.
See #2265
2022-08-10 21:19:46 +02:00
Sascha Woo
c93039410a
[elc] add convenient methods to improve access to aggregations.
Original Pull Request #2266
Closes #2265
2022-08-10 21:10:17 +02:00
Peter-Josef Meisch
33c9180ccd
Reenable test for the new Elasticsearch Client.
Original Pull Request #2261
Closes #2260
2022-08-07 20:33:07 +02:00
Peter-Josef Meisch
df5fd0b97c
sourcefilter documentation.
Original Pull Request #2258
Closes #2257
2022-08-07 12:22:46 +02:00
Peter-Josef Meisch
44a79093ce
Remove deprecated code.
Original Pull request #2256
Closes #2255
2022-08-06 23:16:38 +02:00
Peter-Josef Meisch
cf135f4cdd
Implement SourceFilters annotation.
Original Pull Request #2254
Closes #1280
Closes #2062
Closes #2146
Closes #2147
Closes #2151
2022-08-06 21:04:13 +02:00
Peter-Josef Meisch
954d8b0f97
Prefix bean names created by the configuration with "elasticsearch".
Original Pull Request #2253
Closes #2252
2022-08-05 21:14:06 +02:00
Peter-Josef Meisch
e71c66949a
Add missing properties to BaseQueryBuilder.
Original Pull Request #2251
Closes #2250
2022-08-04 17:50:37 +02:00
Peter-Josef Meisch
acf02a1dc9
Don't try to write non-writeable properties.
Original Pull Request #2249
Closes #2230
2022-08-04 08:04:19 +02:00
Peter-Josef Meisch
6ad449c9f4
Polishing.
See #2247
2022-08-01 21:37:06 +02:00
lanicc
94ebc40582
Fix the JDK version required to build from the source code.
Original Pull Request #2248
Closes #2247
2022-08-01 21:25:10 +02:00
Peter-Josef Meisch
ca39c1d24c
Adapt to changes in Elasticsearch client code. (#2246)
Closes #2211
2022-07-31 18:33:43 +02:00
Peter-Josef Meisch
2049726bcb
Dependency updates.
Original Pull Request #2245
Closes #2243
2022-07-30 20:42:12 +02:00
Peter-Josef Meisch
7620222f89
Upgrade to Elasticsearch 8.3.3.
Original Pull Request #2244
Closes #2242
2022-07-30 18:34:22 +02:00
Peter-Josef Meisch
1f1076aa8b
Don't rely on collection to object conversion in spring-data-commons.
Original Pull Request #2241
Closes #2152
2022-07-28 07:41:07 +02:00
Peter-Josef Meisch
3e950b8053
SimpleElasticsearchRepository still uses erhlc code.
Original Pull Request #2239
Closes #2238
2022-07-24 22:03:01 +02:00
Peter-Josef Meisch
1c31a31e11
Refine the configuration callbacks in the ClientConfiguration.
Original Pull Request #2237
Closes #2149
2022-07-23 15:32:24 +02:00
Peter-Josef Meisch
373be49f97
Fix exists query for imperative repository implementation.
Original Pull Request #2236
Closes #2162
2022-07-22 21:56:24 +02:00
Peter-Josef Meisch
12b332223f
Replace ClassTypeInformation usages with TypeInformation.
Original Pull Request #2235
Closes #2234
2022-07-19 22:37:05 +02:00
Peter-Josef Meisch
47c0e186ec
Adapt to spring-data-commons changes.
Original Pull Request #2233
Closes #2232
2022-07-19 22:12:56 +02:00
Peter-Josef Meisch
8b69a8a030
Complete searchMsearchRequest for the new client.
Original Pull Request #2231
Closes #2156
2022-07-19 21:31:14 +02:00
Mark Paluch
8bb0d8cb41
Polishing.
Consistently use credential properties.

See #2222
2022-07-18 09:19:36 +02:00
Peter-Josef Meisch
26a2f54c0f
Change visibility of InetSocketAddressParser.
Original Pull Request #2227
Closes #2226
2022-07-17 20:15:03 +02:00
Peter-Josef Meisch
1754f59e70
Upgrade to Elasticsearch 8.3.2.
Original Pull Request #2225
Closes #2214
2022-07-17 08:02:23 +02:00
Patrick Baumgartner
8a166a1a40
Fixing Typo.
Original Pull Request #2219
Closes #2223
2022-07-16 17:55:45 +02:00
Christoph Strobl
5c029602b5
After release cleanups.
See #2167
2022-07-15 15:30:55 +02:00
Christoph Strobl
82a545912e
Prepare next development iteration.
See #2167
2022-07-15 15:30:47 +02:00
Christoph Strobl
587dd2edda
Release version 5.0 M5 (2022.0.0).
See #2167
2022-07-15 15:18:31 +02:00
Christoph Strobl
451a22614d
Prepare 5.0 M5 (2022.0.0).
See #2167
2022-07-15 15:17:57 +02:00
Peter-Josef Meisch
688f1722bd
make ReactiveElasticsearchTemplate constructor public.
Original Pull Request #2217
Closes #2216
2022-07-12 17:47:55 +02:00
Peter-Josef Meisch
b9dacc9a5e
implement getAlias variants.
Original Pull Request #2213
Closes #2209
2022-07-09 23:40:34 +02:00
Peter-Josef Meisch
e0acc5a2f9
Upgrade to Elasticsearch 8.3.1.
Original Pull Request #2212
Closes #2210
2022-07-06 22:21:47 +02:00
Peter-Josef Meisch
094e79d601
Make the new client the default.
Original Pull Request #2208
Closes #2159
2022-07-03 21:56:21 +02:00
Peter-Josef Meisch
81e2613669
Documentation fixes.
Original Pull Request #2207
Closes #2206
2022-06-28 22:06:00 +02:00
Peter-Josef Meisch
d974788ab8
no more additions currently, the new client has the same functionality as the old.
Original Pull Request #2205
Closes #2155
2022-06-28 21:57:33 +02:00
Shijie.Ma
0109a68c32
Fix document about StringQuery.
Original Pull Request #2202
Closes #2204
2022-06-28 06:44:48 +02:00
diamondT
259c43af19
Fix handling of array-of-strings parameters for @Query-annotated queries.
Original Pull Request  #2182
Closes #2135
2022-06-27 20:35:06 +02:00
Peter-Josef Meisch
a2802ce716
Upgrade to Elasticsearch 8.2.3.
Original Pull Request #2200
Closes #2198
2022-06-25 20:54:47 +02:00
Peter-Josef Meisch
f901380766
Fix updatebyquery request.
Original Pull Request #2197
Closes #2191
2022-06-25 19:55:22 +02:00
Peter-Josef Meisch
1e4b70ba6d
Refactor code using Elasticsearch libs.
Original Pull Request #2196
Closes #2157
2022-06-25 18:29:34 +02:00
Peter-Josef Meisch
f917fb7a65
Update version documentation.
Original Pull Request #2195
Closes #2194
2022-06-25 17:40:07 +02:00
Peter-Josef Meisch
bfc68699e0
Remove deprecated suggest calls from operations.
Original Pull Request #2193 
Closes #2192
2022-06-24 12:51:58 +02:00
Peter-Josef Meisch
96d0781f24
Parse returned suggest data using the new client.
Original Pull Request #2187
Closes #2154
2022-06-22 18:34:47 +02:00
Gonçalo Montalvão Marques
0a0fc75faa
fix typos in migration guides documentation.
Original Pull Request #2181
Closes #2180
2022-06-03 19:35:40 +02:00
Mark Paluch
ef880e6d3b
Update CI properties.
See #2167
2022-06-03 09:34:20 +02:00
Mark Paluch
3835e8e363
Upgrade to Maven Wrapper 3.8.5.
See #2177
2022-06-03 09:32:51 +02:00
Peter-Josef Meisch
97d0566e94
Fix msearch setup after ES fixed it's issue.
Original Pull Request #2176
Closes #2138
2022-06-01 14:48:46 +02:00
Peter-Josef Meisch
ac64a6a733
Use Elasticsearch 8.2.2.
Original Pull Request #2174
Closes #2158
2022-05-31 22:13:51 +02:00
panzhenchao
c826adb152
Fix incorrect argument check asserts.
Original Pull Request #2169 
Closes #2170
2022-05-27 16:40:38 +02:00
Christoph Strobl
1eaebdec33
Fix pom.xml formatting.
This commit reverts formatting changes introduced via 7cb46b6ab0f0fdaea323709d0a512599ccf743ad.

See #2122
2022-05-13 13:46:12 +02:00
Christoph Strobl
d37ca4d533
After release cleanups.
See #2122
2022-05-13 10:53:27 +02:00
Christoph Strobl
d676ffe066
Prepare next development iteration.
See #2122
2022-05-13 10:53:24 +02:00
Christoph Strobl
1bff5dd749
Release version 5.0 M4 (2022.0.0).
See #2122
2022-05-13 10:44:00 +02:00
Christoph Strobl
7cb46b6ab0
Prepare 5.0 M4 (2022.0.0).
See #2122
2022-05-13 10:43:21 +02:00
Peter-Josef Meisch
a86658c397
Add new Elasticsearch client as an alternative to the existing REST client.
Original Pull Request #2160
Closes #1973

(cherry picked from commit c0b26a51f1299fdc20998cc54c82ffbc7c005dae)
2022-05-12 07:38:44 +02:00
Peter-Josef Meisch
0950dd6c7a
Update to Elasticsearch 7.17.3.
Original Pull Request #2145
Closes #2144
2022-04-24 11:53:19 +02:00
Peter-Josef Meisch
e1c926e134
Use Range class from spring-data-commons.
Original Pull Request #2137
Closes #2098
2022-04-15 08:42:26 +02:00
Peter-Josef Meisch
6a201b4e34
Add more implementations using the new client.
Original Pull Request #2136
See #1973

(cherry picked from commit 8cef50347ea5a67e945b17312b9dac466fa40527)
2022-04-13 22:34:44 +02:00
Oliver Drotbohm
48e2e9dea7
Adapt to changes in Spring Framework 6.0 HttpStatus.
Fixes #2134.
2022-04-11 17:00:59 +02:00
Peter-Josef Meisch
a60f3059e1
Upgrade to Elasticsearch 7.17.2.
Original Pull Request #2131
Closes #2130
2022-04-02 21:14:20 +02:00
Peter-Josef Meisch
3154c74f94
Add info to readme about Elasticsearch versions.
Original Pull Request #2128
Closes #2127
2022-03-31 07:39:19 +02:00
Jing Wei
1407d4d3d6
Upgrade pitest version and add jvmArg.
Original Pull Request: #2126
Closes #2125
2022-03-27 18:57:54 +02:00
Peter-Josef Meisch
acd7990fac
Default Refresh policy for ReactiveElasticsearchTemplate.
Original Pull Request #2124
Closes #2110
2022-03-24 21:07:55 +01:00
Mark Paluch
b10eb75967
Update Jenkinsfile according to Java 17 build pipeline configuration.
See #2122
2022-03-24 09:29:06 +01:00
Mark Paluch
a4952a90f8
After release cleanups.
See #2121
2022-03-22 14:07:39 +01:00
Mark Paluch
50d241fcb4
Prepare next development iteration.
See #2121
2022-03-22 14:07:37 +01:00
Mark Paluch
d1412f06a4
Release version 5.0 M3 (2022.0.0).
See #2121
2022-03-22 14:00:24 +01:00
Mark Paluch
6bdeca64e2
Prepare 5.0 M3 (2022.0.0).
See #2121
2022-03-22 14:00:02 +01:00
Mark Paluch
9ef35ee46f
After release cleanups.
See #2058
2022-03-21 16:44:42 +01:00
Mark Paluch
102d654b92
Prepare next development iteration.
See #2058
2022-03-21 16:44:40 +01:00
Mark Paluch
3c0528796b
Release version 5.0 M2 (2022.0.0).
See #2058
2022-03-21 16:35:09 +01:00
Mark Paluch
6a976a666b
Prepare 5.0 M2 (2022.0.0).
See #2058
2022-03-21 16:34:38 +01:00
Peter-Josef Meisch
57920d4e27
Merge branch 'main' into 5.0.x 2022-03-20 11:10:23 +01:00
Peter-Josef Meisch
709b4c615e
Set visibility SimpleElasticsearchPersistentEntity.ContextConfiguration to public.
Original Pull Request #2116
Closes #2114
2022-03-20 11:00:06 +01:00
Peter-Josef Meisch
149535e0d3
Fix javadoc formatting
(cherry picked from commit 6f6cedf6dff2c7f7ef886d65a857b345013db628)
2022-03-19 21:04:06 +01:00
Peter-Josef Meisch
6f6cedf6df
Fix javadoc formatting 2022-03-19 20:50:18 +01:00
Peter-Josef Meisch
f91a4c18c4
Merge branch 'main' into 5.0.x 2022-03-19 19:56:05 +01:00
Peter-Josef Meisch
b5eee05e3b
Fix http headers 2022-03-19 19:29:08 +01:00
Peter-Josef Meisch
80c3a3bbc5
Merge branch 'main' into 5.0.x
# Conflicts:
#	src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java
#	src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java
2022-03-19 19:00:27 +01:00
Peter-Josef Meisch
4eb8f08ad8
Add new Elasticsearch client integration.
Original Pull Request #2115
2022-03-19 18:51:01 +01:00
Mark Paluch
126e2b972d
Update CI properties.
See #2058
2022-03-17 18:39:19 +01:00
Peter-Josef Meisch
298d4ebce7
adapt to changes in spring data 2022-03-17 18:39:19 +01:00
Greg L. Turnquist
a3414ff8e5
Update CI properties.
See #2058
2022-03-17 18:39:18 +01:00
Mark Paluch
7365111244
Polishing.
Refine build triggers.

See #2074
2022-03-17 18:39:16 +01:00
Greg L. Turnquist
f70e4f817d
Externalize build properties.
See #2074.
2022-03-17 18:38:58 +01:00
Peter-Josef Meisch
0ac56b511c
adapt after rebase on master 2022-03-17 18:38:57 +01:00
Mark Paluch
6adae6f61b
After release cleanups.
See #2053
2022-03-17 18:38:57 +01:00
Mark Paluch
6da0a78d99
Prepare next development iteration.
See #2053
2022-03-17 18:38:56 +01:00
Mark Paluch
e856b974ad
Release version 5.0 M1 (2022.0.0).
See #2053
2022-03-17 18:38:56 +01:00
Mark Paluch
bb8e593546
Prepare 5.0 M1 (2022.0.0).
See #2053
2022-03-17 18:38:55 +01:00
Peter-Josef Meisch
f0c359eb41
Branch 5.0.x. 2022-03-17 18:38:39 +01:00
Mark Paluch
4e39fb30bc
Use Java 8 to build snapshots for Artifactory.
Closes #2095
2022-03-15 14:19:47 +01:00
Peter-Josef Meisch
5875bf3b9b
Polishing. 2022-03-12 11:33:57 +01:00
Owen-q
33c4bb23b7
Add searchAfter interfaces to NativeSearchQueryBuilder.
Original Pull Request #2106 
Closes #2105
2022-03-12 11:27:35 +01:00
Peter-Josef Meisch
9c740f14bd
Upgrade to Elasticsearch 7.17.1. (#2109)
Closes #2108
2022-03-06 12:50:01 +01:00
Peter-Josef Meisch
bf080002bc
MappingBuilder must set configured date formats for date_range fields.
Original Pull Request #2103
Closes #2102
2022-02-22 21:05:51 +01:00
Mark Paluch
5eaea38ff1
Update CI properties.
See #2092
2022-02-22 14:09:32 +01:00
Mark Paluch
0b0a388f32
Upgrade to Maven Wrapper 3.8.4.
See #2101
2022-02-22 13:59:12 +01:00
Mark Paluch
d8ebf2336b
Polishing.
Fix Javadoc errors.

See #2095
2022-02-22 09:57:08 +01:00
Mark Paluch
4b53be97da
Use Java 17 to build snapshots for Artifactory.
Closes #2095
2022-02-22 08:52:51 +01:00
Peter-Josef Meisch
c1a1ea9724
Remove blocking code in SearchDocument processing.
Original Pull Request #2094
Closes #2025
2022-02-20 12:26:19 +01:00
Peter-Josef Meisch
453460fab3
Update compatibility headers documentation 2022-02-19 13:45:21 +01:00
Peter-Josef Meisch
cf380e289d
Documentation about compatibility headers.
Original Pull Request #2093
Closes #2088
2022-02-18 20:09:32 +01:00
Mark Paluch
266fb73126
After release cleanups.
See #2063
2022-02-18 11:15:41 +01:00
Mark Paluch
2b2c07ae5f
Prepare next development iteration.
See #2063
2022-02-18 11:15:39 +01:00
Mark Paluch
4495876025
Release version 4.4 M3 (2021.2.0).
See #2063
2022-02-18 11:09:11 +01:00
Mark Paluch
0fa8de1bec
Prepare 4.4 M3 (2021.2.0).
See #2063
2022-02-18 11:08:48 +01:00
Peter-Josef Meisch
d34b00e436
Polishing. 2022-02-17 07:50:57 +01:00
Houtaroy
9fa1d1ddbc
Class Completion add a parameterless constructor.
Original Pull Request #2086
Closes #2085
2022-02-17 07:48:40 +01:00
Greg L. Turnquist
d56ed88917 Update CI properties.
See #2063
2022-02-15 08:59:51 -06:00
Oliver Drotbohm
db59ac2a03
Adapt to changes in entity creation metadata APIs in Spring Data Commons. 2022-02-15 15:38:09 +01:00
Peter-Josef Meisch
32fa7391c4
Fix exception on property conversion with criteria exists/empty/non-empty.
Original Pull Request #2081
Closes #2080
2022-02-09 22:45:38 +01:00
Peter-Josef Meisch
e54c03d06a
Allow index names per query in bulk requests.
Original Pull Request #2079
Closes #2043
2022-02-06 11:35:32 +01:00
Mark Paluch
266dd573ae
Polishing.
Extract Docker and Artifactory credentials into properties file.

See #2074
2022-02-04 15:18:17 +01:00
Peter-Josef Meisch
f092d0ac19
Upgrade to Elasticsearch 7.17.0.
Original Pull Request #2078
Closes #2077
2022-02-01 22:04:15 +01:00
pnowak85
f37eec641b
Fix IllegalArgumentException when creating custom IndicesOption with empty Option or WildcardState set.
Original Pull Request #2076
Closes #2075
2022-02-01 18:32:38 +01:00
Greg L. Turnquist
14cc9ea495
Externalize build properties.
See #2074.
2022-01-31 17:09:34 -06:00
Peter-Josef Meisch
4a0e7cc56e
Polishing 2022-01-26 21:48:05 +01:00
Onizuka
c5db583048
Implement support for reindex API.
Original Pull Request #2070 
Closes #1529
2022-01-26 20:54:00 +01:00
Peter-Josef Meisch
cf3e46bf68
Improve integration test setup.
Original Pull Request #2072
Closes #2068
2022-01-23 20:24:18 +01:00
James Mudd
1331e26279
Add example and test for @Query with Collection (#2066)
Original Pull Request: #2066
2022-01-20 19:35:40 +01:00
Onizuka
056a4a76e7
Native query with ext section for SearchPlugin.
Original Pull Request #2064 
Closes #2065
2022-01-18 20:17:18 +01:00
Christoph Strobl
3c060d8891
After release cleanups.
See #2057
2022-01-18 09:21:34 +01:00
Christoph Strobl
739c6e4be9
Prepare next development iteration.
See #2057
2022-01-18 09:21:31 +01:00
Christoph Strobl
7843cd3db6
Release version 4.4 M2 (2021.2.0).
See #2057
2022-01-18 09:09:37 +01:00
Christoph Strobl
80e8a5efb4
Prepare 4.4 M2 (2021.2.0).
See #2057
2022-01-18 09:09:02 +01:00
Peter-Josef Meisch
729893f297
Upgrade to Elasticsearch 7.16.3.
Original Pull Request #2060
Closes #2059
2022-01-15 12:57:57 +01:00
Christoph Strobl
ae2905d519
After release cleanups.
See #2054
2022-01-14 11:08:04 +01:00
Christoph Strobl
e8ef6b822f
Prepare next development iteration.
See #2054
2022-01-14 11:08:01 +01:00
Christoph Strobl
ddba8007a2
Release version 4.4 M1 (2021.2.0).
See #2054
2022-01-14 10:58:18 +01:00
Christoph Strobl
8a8e2b4299
Prepare 4.4 M1 (2021.2.0).
See #2054
2022-01-14 10:57:51 +01:00
Peter-Josef Meisch
b8bda372eb
Revert breaking changes in package structure.
Original Pull Request #2052 
Closes #2051
2022-01-09 11:15:13 +01:00
Peter-Josef Meisch
09c386508e
Adapt copyright end date to 2022.
Original Pull Request #2047
Closes #2046
2022-01-01 18:50:31 +01:00
Peter-Josef Meisch
d95f62e4a4
Mappingbuilder uses the typeKey from the ElasticsearchTypeMapper instance.
Original Pull Request  #2044
2021-12-29 08:41:30 +01:00
Peter-Josef Meisch
f914d68478
Fix message in BulkFailureException. 2021-12-27 09:14:01 +01:00
Peter-Josef Meisch
25c9e9d470
Adjust documentation. 2021-12-26 13:26:31 +01:00
Peter-Josef Meisch
45e9fd7f5a
Add AfterLoad callback.
Original Pull Request #2039
Closes #2009
2021-12-26 13:11:53 +01:00
Peter-Josef Meisch
170648d467
Fix Blockhound setup for Elasticsearch 7.16, dependency version updates.
Original Pull Request #2038
2021-12-25 14:33:11 +01:00
Peter-Josef Meisch
4835df7958
Upgrade to Elasticsearch 7.16.2.
Original Pull Request #2036
Closes #2034
2021-12-19 20:52:24 +01:00
Peter-Josef Meisch
ad904e5e94
Update to log4j 2.17.0 2021-12-18 20:33:12 +01:00
Peter-Josef Meisch
3695b23948
Polishing. 2021-12-18 19:14:24 +01:00
Anton Naydenov
9d574103e2
Remove usage of java.lang.reflect in favour of use of the PersistenceEntity.
Original Pull Request #2033 
Closes #2027
2021-12-18 19:03:38 +01:00
Peter-Josef Meisch
32030043a3
Upgrade to Elasticsearch 7.16.1.
Original Pull Request #2032 
Closes #2030
2021-12-16 08:35:28 +01:00
Peter-Josef Meisch
11c6500967
update log4j dependency version 2021-12-14 13:54:23 +01:00
Peter-Josef Meisch
f7a6a97c4e
Fix FieldType mapping.
Original PullRequest #2026
Closes #2024
2021-12-13 21:32:26 +01:00
Peter-Josef Meisch
d6e966e293
Adapt to Elasticsearch 7.16.0.
Original Pull Request #2022 
Closes #2020
2021-12-10 08:58:42 +01:00
Peter-Josef Meisch
6823a18b80
Improve PropertyValueConverters on writing.
Original Pull Request #2019
Closes #2018
2021-12-05 08:41:47 +01:00
Peter-Josef Meisch
8fad48b3f9
Add reactive SearchHits implementation.
Original Pull Request #2017
Closes #2015
2021-11-30 20:47:29 +01:00
Peter-Josef Meisch
989c2807fb
Adjust @since annotation of classes moved to new package.
Original Pull Request #2014 
Closes #2010
2021-11-23 20:53:14 +01:00
Sascha Woo
49324a369a
Fix IndexOutOfBoundsException when try to map inner hits with no results returned.
Original Pull Request #1998 
Closes #1997
Co-authored-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2021-11-23 20:08:50 +01:00
Peter-Josef Meisch
44f9b29b66
Polishing. 2021-11-21 21:08:05 +01:00
vdisk-group
a22419c418
Add support for stored fields.
Original Pull Request #2005 
Closes #2004
2021-11-21 20:58:17 +01:00
Anton Naydenov
29d21000a9
Removed getting internal field via class method.
Original Pull Request #2003
Closes #2002
2021-11-20 14:41:42 +01:00
Peter-Josef Meisch
19d9830735
Remove old wrong javadoc. 2021-11-19 17:52:09 +01:00
Peter-Josef Meisch
0c7c686cb1
Migrate to Spring JCL logging.
Original Pull Request #2001
Closes #2000
2021-11-17 23:21:15 +01:00
Peter-Josef Meisch
45b4c99e95
Fix RestStatusException cause.
Original Pull Request #1996
Closes #1995
2021-11-16 07:36:41 +01:00
Peter-Josef Meisch
0b4c5b4155
Remove TransportClient.
Original Pull Request #1992 
Closes #1958
2021-11-12 20:33:29 +01:00
Peter-Josef Meisch
35c608b546
fix package name 2021-11-12 19:23:50 +01:00
Peter-Josef Meisch
94c95ee4da
Move classes using Elasticsearch code to separate package.
Original Pull Request #1991 
Closes #1947
2021-11-12 17:30:57 +01:00
Jens Schauder
3eff80e745
After release cleanups.
See #1965
2021-11-12 10:59:45 +01:00
Jens Schauder
faff216132
Prepare next development iteration.
See #1965
2021-11-12 10:59:42 +01:00
Jens Schauder
08f7ad85ca
Release version 4.3 GA (2021.1.0).
See #1965
2021-11-12 10:49:37 +01:00
Jens Schauder
4db496ca4e
Prepare 4.3 GA (2021.1.0).
See #1965
2021-11-12 10:49:16 +01:00
Peter-Josef Meisch
9353de13ee
Upgrade to Elasticsearch 7.15.2.
Original Pull Request #1985
Closes #1984
2021-11-11 17:08:59 +01:00
Peter-Josef Meisch
5717d6ee57
Documentation for bulk errors.
Original Pull Request #1982 
Closes #1981
2021-11-01 08:57:32 +01:00
Peter-Josef Meisch
bbee64c8a4
Upgrade to Elasticsearch 7.15.1.
Original Pull Request #1980 
Closes #1979
2021-10-30 21:27:44 +02:00
Peter-Josef Meisch
5cf38d064f
Remove reflective access to java.time classes.
Original Pull Request #1970 
Closes #1969
2021-10-30 17:34:49 +02:00
Anton Naydenov
8894dd3d21
Added RefreshPolicy setter to the AbstractElasticsearchTemplate copy method.
Original Pull Request #1976 
Closes #1978
2021-10-26 19:12:53 +02:00
jongchan lee
f1b4a54bc2
Add scrolltime condition when using SearchRequest.
Original Pull Request #1975
Closes #1974
2021-10-26 18:23:29 +02:00
Peter-Josef Meisch
c37bbd5a7e
Add possibility to define runtime fields in a search request.
Original Pull Request #1972
Closes #1971
2021-10-24 20:01:43 +02:00
Peter-Josef Meisch
2b5ab64724
Revert Testcontainers to 1.15.3.
the update causes issues when running on macOS, the started containers are not reliably reachable
2021-10-24 17:40:35 +02:00
Peter-Josef Meisch
0d943069e3
Upgrade Testcontainers to 1.16.1.
Original Pull Request #1968
Closes #1967
2021-10-19 17:39:28 +02:00
Mark Paluch
ceadec0a3c
After release cleanups.
See #1937
2021-10-18 13:55:43 +02:00
Mark Paluch
9b2ff56dad
Prepare next development iteration.
See #1937
2021-10-18 13:55:39 +02:00
Mark Paluch
d221fa8c49
Release version 4.3 RC1 (2021.1.0).
See #1937
2021-10-18 13:48:15 +02:00
Mark Paluch
c4fd0acbc6
Prepare 4.3 RC1 (2021.1.0).
See #1937
2021-10-18 13:47:48 +02:00
Peter-Josef Meisch
288705ca72
Support field exclusion from source.
Original Pull Request #1962 
Closes #769
2021-10-16 13:01:14 +02:00
Mark Paluch
59fdbbeb19
Upgrade to Maven Wrapper 3.8.3.
See #1960
2021-10-11 14:30:32 +02:00
Peter-Josef Meisch
4a8e012e04
Don't expose ElasticsearchStatusException.
Original Pull Request #1959 
Closes #1957
2021-10-11 12:38:55 +02:00
Peter-Josef Meisch
2450d579e9
Support different routing for each id in multiget.
Original Pull Request #1956 
Closes #1954
2021-10-09 19:43:16 +02:00
Peter-Josef Meisch
5e4ce56414
Update documentation 2021-10-08 13:44:58 +02:00
Peter-Josef Meisch
b8f8a60fd7
Custom Order class with specific parameters for Elasticsearch.
Original Pull Request #1955 
Closes #1911
2021-10-08 13:38:22 +02:00
Peter-Josef Meisch
7ae55b9e75
Add custom property converters.
Original Pull Request #1953 
Closes #1945
2021-10-05 21:31:41 +02:00
Steven
464fc31d87
AbstractElasticsearchTemplate.searchForStream use Query scrolltime.
Original Pull Request #1951 
Closes #1950
2021-10-03 19:08:49 +02:00
Peter-Josef Meisch
175e7b51ae
Add repository search for nullable or empty properties.
Original Pull Request #1946 
Closes #1909
2021-09-25 14:51:40 +02:00
Peter-Josef Meisch
b8ae9b4a83
switch other config from jdk 16 to 17.
Original Pull Request #1944 
Closes #1942
2021-09-23 23:19:56 +02:00
Peter-Josef Meisch
53581a9a79
Upgrade to Elasticsearch 7.15.0.
Original Pull Request #1943 
Closes #1941
2021-09-23 23:11:11 +02:00
Peter-Josef Meisch
d9b23ede70
Remove Elasticsearch classes from suggest response data.
Original Pull Request #1940 
Closes #1302
2021-09-21 21:15:09 +02:00
Steven
d1528ed67f
Add @QueryAnnotation meta annotation to @Query.
Original Pull Request #1939 
Closes #1938
2021-09-21 19:49:18 +02:00
Mark Paluch
c436c4cd63
After release cleanups.
See #1899
2021-09-17 09:52:22 +02:00
Mark Paluch
8907be835f
Prepare next development iteration.
See #1899
2021-09-17 09:52:19 +02:00
Mark Paluch
1d291aeeff
Release version 4.3 M3 (2021.1.0).
See #1899
2021-09-17 09:44:58 +02:00
Mark Paluch
56b1343ee7
Prepare 4.3 M3 (2021.1.0).
See #1899
2021-09-17 09:44:35 +02:00
Christoph Strobl
bf165a663a Change visibility of PersistentEntitiesFactoryBean.
Closes: #1934
2021-09-16 08:08:55 +02:00
Peter-Josef Meisch
35b6efebf3
Update documentation 2021-09-14 21:45:00 +02:00
Peter-Josef Meisch
3128fab595
upgrade to Elasticsearch 7.14.1.
Original Pull Request #1933 
Closes #1892
2021-09-14 21:38:45 +02:00
Peter-Josef Meisch
fa66702980
MappingElasticsearchConverter cleanup.
Original Pull Request #1931
Closes #1923
2021-09-11 11:51:05 +02:00
Peter-Josef Meisch
8ab84fcc7a
Improve client configuration callbacks.
Original Pull Request #1930 
Closes #1929
2021-09-10 17:20:15 +02:00
Peter-Josef Meisch
7c35e5327e
Fix MappingElasticsearchConverter memory leak.
Original Pull Request #1928
Closes #1924
2021-09-10 16:04:40 +02:00
Peter-Josef Meisch
6941e31ba4
Polishing 2021-09-10 08:29:52 +02:00
Nic Hines
3b8f0c9d56
Change mapping of connectionRequestTimeout to ConnPool leaseTimeout.
Original Pull Request: #1925 
Closes: #1926
2021-09-10 08:10:45 +02:00
Peter-Josef Meisch
64624aec70
Encapsulate client specific aggregation return types.
Original Pull Request #1921
Closes #1920
2021-09-04 13:20:01 +02:00
Peter-Josef Meisch
e71758686c
Fix @Query method implementation for unpaged queries.
Original Pull Request #1919 
Closes #1917
2021-09-03 21:36:57 +02:00
Jade Peng
35c7ef4fed
Correct indexName comment.
Original Pull Request #1916
2021-09-01 20:36:08 +02:00
Peter-Josef Meisch
305d930870
Remove org.elasticsearch dependencies from API classes.
Original Pull Request #1913
Closes #1884
Closes #1885
2021-08-30 21:37:04 +02:00
Daniel Franco
e688fc70e0
Update maven wrapper version to 3.8.2
Original Pull Request #1905
2021-08-26 20:13:19 +02:00
Peter-Josef Meisch
50f2d83442
Upgrade to Elasticsearch 7.13.4.
Original Pull Request #1900
Closes #1896
2021-08-12 20:38:27 +02:00
Jens Schauder
fd3410bb75
After release cleanups.
See #1876
2021-08-12 15:16:23 +02:00
Jens Schauder
325d3f7a09
Prepare next development iteration.
See #1876
2021-08-12 15:16:22 +02:00
Jens Schauder
655db1e362
Release version 4.3 M2 (2021.1.0).
See #1876
2021-08-12 15:03:18 +02:00
Jens Schauder
3eac1bb173
Prepare 4.3 M2 (2021.1.0).
See #1876
2021-08-12 15:02:57 +02:00
Peter-Josef Meisch
36b449c385
Fix NPE on IndexQuery with source and version.
Original Pull Request #1894
Closes #1893
2021-08-06 20:02:13 +02:00
Peter-Josef Meisch
1c8e0e03d3
Make integration tests configurable to use different containers.
Original Pull Request: #1888 
Closes #1882
2021-08-01 19:36:57 +02:00
Peter-Josef Meisch
d80d920a57
Remove changelog shipped with the binaries.
Original Pull Request #1881
Closes #1879
2021-07-24 07:08:16 +02:00
Peter-Josef Meisch
e6869bcdfd
Fix http URL in license header 2021-07-21 08:06:03 +02:00
Peter-Josef Meisch
d2e3ea26b8
Upgrade maven wrapper to use maven 3.8.1.
Original Pull Request #1878
Closes #1877
2021-07-21 07:33:58 +02:00
Sascha Woo
f74dd879df
Move dynamic mapping parameter configuration to @Document and @Field.
Original Pull Request #1872
Closes #1871
2021-07-20 07:51:39 +02:00
Peter-Josef Meisch
3b921b7454
Revert build jdk11 and jdk16 sequentially 2021-07-18 14:03:42 +02:00
Peter-Josef Meisch
fa6f636906
Build jdk11 and jdk16 sequentially 2021-07-18 14:02:07 +02:00
Peter-Josef Meisch
d3e8c9fce5
Polishing. 2021-07-17 19:15:30 +02:00
Frnandu Martinski
d88fb037da
Fix uri encode bug when url path start with '/'.
Original Pull Request #1873 
Closes #1870
2021-07-17 19:09:35 +02:00
Jens Schauder
7c35756923
After release cleanups.
See #1777
2021-07-16 14:19:58 +02:00
Jens Schauder
4f7e7526e3
Prepare next development iteration.
See #1777
2021-07-16 14:19:56 +02:00
Jens Schauder
c470a3d4eb
Release version 4.3 M1 (2021.1.0).
See #1777
2021-07-16 14:09:26 +02:00
Jens Schauder
c79b6d158a
Prepare 4.3 M1 (2021.1.0).
See #1777
2021-07-16 14:08:59 +02:00
Jens Schauder
bf248d78de
Updated changelog.
See #1777
2021-07-16 14:08:52 +02:00
Jens Schauder
8e3d8669ea Updated changelog.
See #1849
2021-07-16 10:48:20 +02:00
Peter-Josef Meisch
039e59d3c2
rename a couple of package private classes to a consistent naming scheme.
Original Pull Request #1869 
Closes #1868
2021-07-14 22:19:39 +02:00
Peter-Josef Meisch
27094724dc
Use registered converters for parameters of @Query annotated methods.
Original Pull Request #1867 
Closes #1866
2021-07-14 19:31:30 +02:00
Peter-Josef Meisch
567bdf21fa
Upgrade to Elasticsearch 7.13.3.
Original Pull Request #1865
Closes #1864
2021-07-12 22:12:11 +02:00
Peter-Josef Meisch
7c340bc9a2
Polishing and documentation. 2021-07-12 21:22:01 +02:00
Sascha Woo
271e1eee0d
Add native support for range field types by using a range object
Original Pull Request #1863
Closes #1862
2021-07-12 20:15:35 +02:00
Peter-Josef Meisch
66d13444aa
Add TestContainers configuration.
Original Pull Request #1861 
Closes #1860
2021-07-05 20:20:11 +02:00
Niklas Herder
6f84a1c589
Support collection parameters in @Query methods.
Original Pull Request #1856 
Closes #1858
2021-07-03 13:42:56 +02:00
Peter-Josef Meisch
112ca59c95
Adapt pull request template. 2021-07-02 18:07:23 +02:00
Sascha Woo
4ce1137b4e
Improve NativeSearchQueryBuilder by adding convenience methods and modifying existing ones.
Original Pull Request #1855 
Closes #1854
2021-07-02 15:47:49 +02:00
Sascha Woo
a16a87f3fa
Add missing hashCode and equals methods to JoinField.
Original Pull Request #1847 
Closes #1846
2021-06-22 20:51:47 +02:00
Mark Paluch
3871d2d073
Updated changelog.
See #1814
2021-06-22 16:07:28 +02:00
Mark Paluch
e80737f76d
Updated changelog.
See #1813
2021-06-22 15:29:54 +02:00
Peter-Josef Meisch
bc4c913a97
Make CompletionField annotation composable.
Original Pull Request #1841
Closes #1836
2021-06-06 21:14:20 +02:00
Peter-Josef Meisch
b515f18b33
Upgrade to Elasticsearch 7.13.1.
Original Pull Request #1840
Closes #1839
2021-06-06 16:55:35 +02:00
Peter-Josef Meisch
38dc7fb0fb
Adapt XNamedContents used by ReactiveElasticsearchClient for missing entries (terms and aggregations).
Original Pull Request #1837 
Closes #1834
2021-06-02 22:08:22 +02:00
Peter-Josef Meisch
6b0c4281a4
Upgrade to Elasticsearch 7.13.0.
Original Pull Request #1832
Closes #1831
2021-05-26 22:34:25 +02:00
Peter-Josef Meisch
44e7ab63b0
Dependency cleanup and minor updates.
Original Pull Request #1829
Closes #1828
2021-05-24 14:47:47 +02:00
Peter-Josef Meisch
67d084beea
Improve integration test time.
Original Pull Request #1827 
Closes #1826
2021-05-24 12:29:53 +02:00
Peter-Josef Meisch
7582617a26
Fix reactive blocking calls.
Original Pull Request #1825 
Closes #1824
2021-05-22 17:16:16 +02:00
Peter-Josef Meisch
e8f73b75ba
Add Blockhound to test setup.
Original Pull Request #1823
Closes #1822
2021-05-21 15:29:08 +02:00
Peter-Josef Meisch
5ed655e0aa
Fix recative mapping creation.
Original Pull Request #1821
2021-05-19 23:40:11 +02:00
Peter-Josef Meisch
0836411d45
Add runtime fields to index mapping.
Original Pull Request: #1820 
Closes: #1816
2021-05-19 21:38:48 +02:00
Peter-Josef Meisch
25b323c00d
source_filter and fields fixes.
Original Pull Request #1819 
Closes #1817
2021-05-18 21:47:47 +02:00
Peter-Josef Meisch
33bc36d111
Add inner_hits support to the collapse field in NativeSearchQuery.
Original Pull Request #1815
Closes #1498
2021-05-15 22:31:45 +02:00
Mark Paluch
a830e76807
Updated changelog.
See #1775
2021-05-14 12:36:39 +02:00
Mark Paluch
06f2103c2e
Updated changelog.
See #1774
2021-05-14 12:06:43 +02:00
Peter-Josef Meisch
e96d09fa51
SearchPage result in StringQuery methods.
Original Pull Request #1812
Closes #1811
2021-05-13 16:48:57 +02:00
Peter-Josef Meisch
38b1763b34
datatype detection support in mapping.
Original Pull Request #1810
Closes #638
2021-05-13 10:26:24 +02:00
Peter-Josef Meisch
df0d65eda2
Add pipeline aggregations to NativeSearchQuery.
Original Pull Request #1809 
Closes #1255
2021-05-11 23:21:26 +02:00
Peter-Josef Meisch
3a900599f2
Add documentation about FieldType.Auto.
Original Pull Request #1807 
Closes #1803
2021-05-10 18:46:35 +02:00
Peter-Josef Meisch
be93ebd6a6
Can use @ScriptedFields annotated property as ctor parameter in records and Kotlin data classes.
Original Pull Request #1802 
Closes #1488
2021-05-07 08:14:13 +02:00
Peter-Josef Meisch
159687e241
Improve handling of immutable classes.
Original Pull Request #1801
Closes #1800
2021-05-03 21:45:22 +02:00
Peter-Josef Meisch
502ce0b6aa
Add requestCache parameter to Query implementations.
Original Pull Request #1799
Closes #1564
2021-05-01 21:20:07 +02:00
Peter-Josef Meisch
5b6789539c
Upgrade to Elasticsearch 7.12.1.
Original Pull Request #1796
Closes #1792
2021-04-30 21:18:25 +02:00
Peter-Josef Meisch
775bf66401
Refactor DefaultReactiveElasticsearchClient to do request customization with the WebClient. (#1795)
Original Pull Request #1795 
Closes #1794
2021-04-30 06:48:07 +02:00
Peter-Josef Meisch
f8fbf7721a
Escape strings with quotes in custom query parameters. (#1793)
Original Pull Request #1793 
Closes #1790
2021-04-28 21:46:10 +02:00
Peter-Josef Meisch
a2ca312fb2
Search with MoreLikeThisQuery should use Pageable.
Original Pull Request #1789
Closes #1787
2021-04-26 22:26:39 +02:00
Peter-Josef Meisch
91742b1114
Allow disabling TypeHints.
Original Pull Request #1788
Closes #1788
2021-04-25 21:57:13 +02:00
Peter-Josef Meisch
8b7f0f8327
Fix documentation.
Original Pull Request #1786 
Closes #1785
2021-04-23 09:38:05 +02:00
Greg L. Turnquist
84b441eadc
Authenticate with artifactory.
See #1750.
2021-04-20 10:40:58 -05:00
Peter-Josef Meisch
e193e1672b
Remove deprecated code.
Original Pull Request #1782
Closes #1781
2021-04-19 18:02:02 +02:00
Peter-Josef Meisch
79087c4ada
Custom property names must be used in SourceFilter and source fields.
Original Pull Request #1780 
Closes #1778
2021-04-18 14:08:45 +02:00
Peter-Josef Meisch
7ace63485d
DynamicMapping annotation should be applicable to any object field.
Original Pull Request #1779
Closes #1767
2021-04-17 14:53:12 +02:00
Greg L. Turnquist
19ec481856
Migrate to main branch.
See #1750.
2021-04-15 13:04:54 -05:00
Mark Paluch
728ba0af5b
After release cleanups.
See #1750
2021-04-14 14:30:15 +02:00
Mark Paluch
054235e590
Prepare next development iteration.
See #1750
2021-04-14 14:30:12 +02:00
Mark Paluch
8bc06c9f41
Release version 4.2 GA (2021.0.0).
See #1750
2021-04-14 14:18:49 +02:00
Mark Paluch
03da6535cd
Prepare 4.2 GA (2021.0.0).
See #1750
2021-04-14 14:18:22 +02:00
Mark Paluch
4e6df37e2a
Updated changelog.
See #1750
2021-04-14 14:18:19 +02:00
Mark Paluch
58f1012874
Updated changelog.
See #1751
2021-04-14 11:43:34 +02:00
Mark Paluch
84391ae62a
Updated changelog.
See #1730
2021-04-14 11:17:43 +02:00
Peter-Josef Meisch
010c0cb6ad
Remove @Persistent from entity-scan include filters (#1772)
Original PR: #1772 
Closes: #1771
2021-04-13 20:53:39 +02:00
Peter-Josef Meisch
d561c91678
Introduce cluster operations.
Original Pull Request: #1768 
Closes #1390
2021-04-11 11:05:37 +02:00
Peter-Josef Meisch
58bca88386
Fix reactive connection handling.
Original Pull Request #1766
Closes #1759
2021-04-08 22:00:46 +02:00
Peter-Josef Meisch
4782414596
CriteriaQuery must use nested query only with properties of type nested.
Original Pull Request #1763
Closes #1761
2021-04-06 20:50:24 +02:00
Peter-Josef Meisch
ab73c68ca9
Nested Criteria queries must consider sub-fields.
Original Pull Request #1760 
Closes #1758
2021-04-05 15:42:02 +02:00
Peter-Josef Meisch
2bd4ef75cf
CriteriaQuery must support nested queries.
Original Pull Request: #1757 
Closes #1753
2021-04-03 15:31:04 +02:00
Peter-Josef Meisch
4ad002746e
#1755-Documentation-fix-to-not-show-deprecated-calls.
Original Pull Request #1756 
Closes #1755
2021-04-03 08:53:40 +02:00
Rahul Lokurte
d66f8a0650
Documentation fix: Types are in the process of being removed.
Original Pull Request: #1754
2021-04-03 08:25:54 +02:00
Mark Paluch
dfc68cd33b
Updated changelog.
See #1731
2021-03-31 18:30:46 +02:00
Mark Paluch
cb08adc0c9
After release cleanups.
See #1699
2021-03-31 17:24:06 +02:00
Mark Paluch
2a016f1aea
Prepare next development iteration.
See #1699
2021-03-31 17:24:04 +02:00
Mark Paluch
f9e4ac4d42
Release version 4.2 RC1 (2021.0.0).
See #1699
2021-03-31 17:05:09 +02:00
Mark Paluch
76d979cbba
Prepare 4.2 RC1 (2021.0.0).
See #1699
2021-03-31 17:04:35 +02:00
Mark Paluch
0c4f0d8af9
Updated changelog.
See #1699
2021-03-31 17:04:31 +02:00
Peter-Josef Meisch
19ecf89455
Upgrade to Elasticsearch 7.12.0.
Original Pull Request #1749
Closes #1741
2021-03-28 16:16:41 +02:00
Peter-Josef Meisch
2e9bef0edb
Configure index settings with @Setting annotation.
Original Pull Request #1748
Closes #1719
2021-03-28 13:24:52 +02:00
Peter-Josef Meisch
13ab2b9e95
Automatically close scroll context when returning streamed results.
Original Pull Request #1746
Closes #1745
2021-03-27 15:44:46 +01:00
Peter-Josef Meisch
3500dad2bc
Readme lists artifacts with .RELEASE and .BUILD-SNAPSHOT suffixes (#1740)
Original Pull Request #1740
Closes #1738
2021-03-23 07:15:18 +01:00
Peter-Josef Meisch
2e5d2e0fd0
Update CI to Java 16
Original Pull Request #1739
Closes #1733
2021-03-22 22:03:22 +01:00
Peter-Josef Meisch
a3e87a8525
Upgrade to OpenWebBeans 2.
Original Pull Request #1737 
Closes #1736
2021-03-21 21:31:14 +01:00
Peter-Josef Meisch
843fd4db85
Remove lombok.
Original Pull Request #1735 
Closes #1734
2021-03-21 18:36:38 +01:00
Peter-Josef Meisch
ebac4c097c
Polishing. 2021-03-17 22:43:09 +01:00
Sascha Woo
31b488d08f
Allow multiple date formats for date fields.
Original Pull Request #1728 
Closes #1727
2021-03-17 22:39:12 +01:00
Mark Paluch
db39b9e27c
After release cleanups.
See #1709
2021-03-17 11:30:31 +01:00
Mark Paluch
ff5a6043f1
Prepare next development iteration.
See #1709
2021-03-17 11:30:29 +01:00
Mark Paluch
399820680d
Release version 4.2 M5 (2021.0.0).
See #1709
2021-03-17 11:17:50 +01:00
Mark Paluch
a89fd89d12
Prepare 4.2 M5 (2021.0.0).
See #1709
2021-03-17 11:17:27 +01:00
Mark Paluch
28fe9ee25b
Updated changelog.
See #1709
2021-03-17 11:17:25 +01:00
Mark Paluch
6e3579d1fe
Updated changelog.
See #1702
2021-03-17 11:03:41 +01:00
Mark Paluch
83314880e4
Updated changelog.
See #1697
2021-03-17 10:35:14 +01:00
Peter-Josef Meisch
98a8d1a5ac
Polishing 2021-03-16 22:36:57 +01:00
Lukáš Vasek
005d6a4d6f
Added SearchTemplate support for reactive client
Original Pull Request #1726
Closes #1725
2021-03-16 21:37:55 +01:00
Peter-Josef Meisch
120eed02ee
Polishing. 2021-03-13 17:50:33 +01:00
peermuellerxw
b289d5f974
Add Rescore functionality.
Original Pull Request #1688
Closes #1686
2021-03-13 15:52:14 +01:00
Peter-Josef Meisch
eb816cce87
Polishing. 2021-03-11 19:13:34 +01:00
Matt Gilene
4dc8b2589a
Add matched_queries field to SearchHit.
Original Pull Request #1722 
Closes #1514
2021-03-11 18:32:37 +01:00
Peter-Josef Meisch
3f39f5d5b7
Use correct classes in reactive operations.
Original Pull Request #1724 
Closes #1721
2021-03-07 13:28:21 +01:00
Peter-Josef Meisch
2f5773a5ff
Create index with mapping in one step.
Original Pull Request #1723 
Closes #1718
2021-03-06 18:42:57 +01:00
Peter-Josef Meisch
e4c7b968e1
Add the type hint _class attribute to the index mapping.
Original Pull Request #1717 
Closes #1711
2021-03-04 23:56:29 +01:00
Peter-Josef Meisch
6634d0075a
DefaultReactiveElasticsearchClient handle 5xx error with empty body
Original Pull Request #1713 
Closes #1712
2021-03-03 06:25:06 +01:00
Peter-Josef Meisch
f08c34ec5d
Improve multiget return.
Original Pull Request #1710 
Closes #1678
2021-02-27 18:16:54 +01:00
Peter-Josef Meisch
dd3d01eab6
Polishing 2021-02-26 08:28:45 +01:00
Morgan
3f2ab4b06a
Add support for dense_vector type
Original Pull Request  #1708
Closes #1700
2021-02-26 08:25:27 +01:00
Peter-Josef Meisch
8da718e41a
Upgrade to Elasticsearch 7.11.1.
Original Pull Request ##1707
Closes #1687
2021-02-24 22:36:48 +01:00
Peter-Josef Meisch
17a25cb0ad
Polishing 2021-02-24 21:16:52 +01:00
Farid Faoudi
3bc01a4e5f
ReactiveElasticsearchClient should use the same request parameters as non reactive code.
Original Pull Request #1703
Closes #1658
2021-02-24 21:14:37 +01:00
Farid Faoudi
1c549b739b
Add SearchFailure field in ByQueryResponse.
Original Pull Request #1705
Closes #1704
2021-02-22 18:30:27 +01:00
Peter-Josef Meisch
863ac2f3f5
Polishing. 2021-02-21 16:24:43 +01:00
gpopides
929d97f255
Add function to get index information
Original Pull Request #1693
Closes #1646
2021-02-20 18:01:12 +01:00
Christoph Strobl
43b3035ab7 After release cleanups.
See #1701
2021-02-18 11:35:22 +01:00
Christoph Strobl
0367246512 Prepare next development iteration.
See #1701
2021-02-18 11:35:21 +01:00
Christoph Strobl
36b3d0965e Release version 4.2 M4 (2021.0.0).
See #1701
2021-02-18 11:25:13 +01:00
Christoph Strobl
89125ae628 Prepare 4.2 M4 (2021.0.0).
See #1701
2021-02-18 11:24:46 +01:00
Christoph Strobl
2f2ab7cd89 Updated changelog.
See #1701
2021-02-18 11:24:45 +01:00
Christoph Strobl
9b55afc64b Updated changelog.
See #1698
2021-02-18 11:18:30 +01:00
Christoph Strobl
6193f075a5 After release cleanups.
See #1643
2021-02-17 14:17:49 +01:00
Christoph Strobl
a4bc815c68 Prepare next development iteration.
See #1643
2021-02-17 14:17:48 +01:00
Christoph Strobl
d49513531f Release version 4.2 M3 (2021.0.0).
See #1643
2021-02-17 14:00:09 +01:00
Christoph Strobl
69cfd57c78 Prepare 4.2 M3 (2021.0.0).
See #1643
2021-02-17 13:59:43 +01:00
Christoph Strobl
8d393f57bb Updated changelog.
See #1643
2021-02-17 13:59:42 +01:00
Christoph Strobl
53486ac85f Updated changelog.
See #1642
2021-02-17 13:49:21 +01:00
Christoph Strobl
ced6144a81 Updated changelog.
See #1570
2021-02-17 11:34:26 +01:00
Christoph Strobl
a2e525c6f0 Updated changelog.
See #1569
2021-02-17 10:58:26 +01:00
Peter-Josef Meisch
3869fd2ee8
Improve delete-by-query returned information.
Original Pull Request #1692
Closes #1679
2021-02-13 16:03:26 +01:00
Peter-Josef Meisch
ffc2420bcd
Add support for search_after.
Original Pull Request #1691
Closes #1143
2021-02-12 20:35:56 +01:00
peermuellerxw
154c50b3b7
Fix some anchor links in documentation.
Original Pull Request: #1690 
Closes #1689
2021-02-12 16:56:14 +01:00
Peter-Josef Meisch
87bf84d262
Fix remaining copyright years 2021-02-11 18:57:42 +01:00
Peter-Josef Meisch
719bcf4bfc
Fix remaining copyright years 2021-02-11 18:55:57 +01:00
Peter-Josef Meisch
fe8c4f12ed
Add @CountQuery annotation.
Original Pull Request #1682 
Closes #1156
2021-02-07 20:21:02 +01:00
Peter-Josef Meisch
910ca7b665
Allow fields with id-property names (#1681)
Original Pull Request #1681 
Closes #1680
2021-02-05 23:06:19 +01:00
Mark Paluch
8fa261360f
Add Map to ElasticsearchSimpleTypes.
See #1675.

(cherry picked from commit 27850e96f211b093a82f2e8a69d13bdc3364d50c)
2021-02-04 16:26:05 +01:00
Mark Paluch
d811ff2d78
Polishing.
Fix PersistenceConstructor of Completion to accept the property type String[].

See #1675.

(cherry picked from commit bb3c006b9218a16f3d4497f52de7fba1d5f67880)
2021-02-04 16:25:29 +01:00
Mark Paluch
a2baea7792
Refactor MappingElasticsearchConverter.
* Add support for SpEL expressions via @Value.
* Simplify readCollectionOrArray to consider properly nested lists and maps
* Simplify readMap to allow reading generic maps and entities in maps.
* Report a fallback TypeInformation in DefaultElasticsearchTypeMapper to properly convert nested maps.

We now no longer rely on isSimpleType when writing Maps. This is the preparation to consider Map as simple type.

Resolves #1676.
See #1675.

(cherry picked from commit 877de9c51ce94e5efe294944cf752b20ac2f2cd6)
2021-02-04 16:24:57 +01:00
Peter-Josef Meisch
63eebdea88
Add query Explain Support.
Original Pull Request #1674
Closes #725
2021-01-30 19:50:32 +01:00
Peter-Josef Meisch
ddc7246c42
Don't update indexed object if it is no persistent entity.
Original Pull Request  #1673
Closes #803
2021-01-30 14:16:22 +01:00
Peter-Josef Meisch
dbd99a3880
Polishing. 2021-01-29 15:46:10 +01:00
slyoldfox
e6c6d34948
Fix subCriteria's not being updated.
Original Pull Request  #1670
Closes #1668
2021-01-29 15:30:42 +01:00
Peter-Josef Meisch
0ac1b4af00
Allow CustomConversions for entities.
Original PullRequest #1672
Closes #1667
2021-01-28 22:51:02 +01:00
Peter-Josef Meisch
e8edd606fb
Cleanup deprecations from 4.0. (#1671)
Original Pull Request #1671 
Closes #1669
2021-01-28 08:14:20 +01:00
Peter-Josef Meisch
4829b07e53
ReactiveElasticsearchOperations indexName is encoded twice.
Original Pull Request #1666 
Closes #1665
2021-01-25 21:33:25 +01:00
Peter-Josef Meisch
1a02c1e05a
Fix source filter setup in multiget requests.
Original Pull Request #1664
Closes #1659
2021-01-24 18:59:52 +01:00
Peter-Josef Meisch
1aabb42355
Documentation fix.
Original Pull Request #1663 
Closes #1662
2021-01-23 19:59:46 +01:00
Peter-Josef Meisch
9854c01ccb
Polishing. 2021-01-23 16:20:26 +01:00
Farid Faoudi
0ee0164a58
Implement update by query.
Original Pull Request #1446 
Closes #1644
2021-01-23 11:31:15 +01:00
Peter-Josef Meisch
169015fb3b
Fix assertions to assertj. 2021-01-21 21:09:18 +01:00
Peter-Josef Meisch
159520d001
GeoJson types can be lowercase in Elasticsearch.
Original Pull Request #1657 
Closes #1655
2021-01-19 20:25:38 +01:00
Peter-Josef Meisch
89d6ae7f49
Add routing parameter to ElasticsearchOperations.
Original Pull Request #562 
Closes #1218
2021-01-18 23:54:55 +01:00
Peter-Josef Meisch
aba14c5e11
Add enabled mapping parameter.
Original PullRequest #1652 
Closes #1370
2021-01-17 23:54:35 +01:00
Peter-Josef Meisch
b7a23ed7f1
Upgrade to Elasticsearch 7.10.2
Original Pull Request: #1651 
Closes #1649
2021-01-17 18:46:50 +01:00
Peter-Josef Meisch
c6713fad5f
Use own implementation of date formatters.
Original PR #1650 
Closes #1647
2021-01-17 16:36:38 +01:00
Peter-Josef Meisch
e311df98c0
Use FieldNamingStrategy for property name matching.
Original PR #1648 
Closes #1565
2021-01-15 19:39:19 +01:00
Christoph Strobl
ee30ef6635 After release cleanups.
See #1571
2021-01-13 15:47:00 +01:00
Christoph Strobl
7df60c9edf Prepare next development iteration.
See #1571
2021-01-13 15:46:59 +01:00
Christoph Strobl
a5c4a87c66 Release version 4.2 M2 (2021.0.0).
See #1571
2021-01-13 15:34:04 +01:00
Christoph Strobl
e84a883dfb Prepare 4.2 M2 (2021.0.0).
See #1571
2021-01-13 15:33:34 +01:00
Christoph Strobl
020a305f8e Updated changelog.
See #1571
2021-01-13 15:33:33 +01:00
Christoph Strobl
dcadb74e96
Updated changelog.
See #1572
2021-01-13 15:16:25 +01:00
Farid Faoudi
3c6dd641d7
Add support for GetFieldMapping request in ReactiveElasticsearchClient.
Original Pull Request #1641
Closes #1640
2021-01-13 08:24:49 +01:00
Peter-Josef Meisch
5bf0c4b093
Upgrade to Elasticsearch 7.10.1. (#1639)
Original Pull Request #1639 
Closes #1638
2021-01-10 18:43:42 +01:00
Peter-Josef Meisch
00dcee0a5d
Throw exception on index creation error.
Closes #1056 
Original Pull Request #1637
2021-01-10 12:23:50 +01:00
Peter-Josef Meisch
6913d8045b
#1634 - Update Testcontainers dependency. (#1635)
Original Pull Request: #1635 
Closes #1634
2021-01-07 22:08:45 +01:00
Peter-Josef Meisch
36bbc20681
#1632 - Update copyright notice to 2021.
Original Pull request #1633
Closes #1632
2021-01-07 08:14:26 +01:00
Peter-Josef Meisch
51c59515ab
#1629 - Update repository after GitHub issues migration.
Original Pull Request #1631 
Closes #1629
2021-01-02 18:04:44 +01:00
Peter-Josef Meisch
f3dbaa0fe8
Add version of Spring dependency to docs.
Original Pull Request #1630
Closes: #1576
2020-12-31 15:03:45 +01:00
Peter-Josef Meisch
90c4a2a4d6
DATAES-982 - Improve refresh handling.
Original PR: #573.
2020-12-29 13:39:28 +01:00
Peter-Josef Meisch
6fd35b56da
DATAES-1003 - Polishing. 2020-12-18 17:36:16 +01:00
simpleusr
e950752e79
DATAES-1003 - add timeout to search query.
Original PR: #572
2020-12-18 16:57:40 +01:00
Greg L. Turnquist
b49b053d06
DATAES-996 - Polishing. 2020-12-15 11:10:41 -06:00
Greg L. Turnquist
a2d2a6119d
DATAES-996 - Use Docker hub credentials for all CI jobs. 2020-12-15 11:09:24 -06:00
Peter-Josef Meisch
fd975993d3
DATAES-946 - Support 'wildcard' field type.
Original PR: #571
2020-12-09 22:36:43 +01:00
Mark Paluch
80a50a83d0
DATAES-973 - Updated changelog. 2020-12-09 16:47:44 +01:00
Mark Paluch
9a987f213f
DATAES-966 - After release cleanups. 2020-12-09 15:32:21 +01:00
Mark Paluch
4fec1ad00d
DATAES-966 - Prepare next development iteration. 2020-12-09 15:32:17 +01:00
Mark Paluch
9b20e94acc
DATAES-966 - Release version 4.2 M1 (2021.0.0). 2020-12-09 15:21:57 +01:00
Mark Paluch
33e479f0f5
DATAES-966 - Prepare 4.2 M1 (2021.0.0). 2020-12-09 15:21:30 +01:00
Mark Paluch
bc50ac9779
DATAES-966 - Updated changelog. 2020-12-09 15:21:27 +01:00
Mark Paluch
8013b4b344
DATAES-964 - Updated changelog. 2020-12-09 12:42:28 +01:00
Mark Paluch
625d58b7dd
DATAES-963 - Updated changelog. 2020-12-09 09:59:14 +01:00
Peter-Josef Meisch
585299cd74
DATAES-995 - Code Cleanup after DATACMNS-1838.
Original PR:  #570
2020-12-07 19:46:40 +01:00
Peter-Josef Meisch
d25f7fe7b8
DATAES-985 - Add builder method for track_total_hits to NativeSearchQueryBuilder.
Original PR: #569
2020-12-06 13:05:33 +01:00
Peter-Josef Meisch
fcb8a9b0ed
DATAES-994 Add setup for mutation testing.
Original PR: #568
2020-12-06 12:08:42 +01:00
Peter-Josef Meisch
e408067b49
DATAES-247 - Support OpType in IndexQuery.
Original PR: #567
2020-12-06 08:38:58 +01:00
Peter-Josef Meisch
7df6ffb5cd
DATAES-362 - Polishing. 2020-12-05 23:20:40 +01:00
Peter-Josef Meisch
a42de9b51b
DATAES-362 - Add support for composable meta annotations.
Original PR: #566
2020-12-05 22:53:18 +01:00
Peter-Josef Meisch
6edb8353b5
DATAES-990 - Index creation fails with Authentication object cannot be null on startup.
Only do a SpEL resolution if there is a SpEL expressin in the index name; resolve ExpressionDependencies.

Original PR: #565
2020-12-05 12:10:39 +01:00
Peter-Josef Meisch
6a6ead5e1e
DATAES-991 - Wrong value for TermVector(with_positions_offets_payloads).
Original PR: #564
2020-12-04 08:10:41 +01:00
Peter-Josef Meisch
8e59b18931
DATAES-989 - Improve deprecation warning for id properties without annotation.
Original PR: #563
2020-12-02 21:00:23 +01:00
Patrick Strawderman
c66443ab5a
DATAES-988 Allow specifying max results in NativeSearchQueryBuilder
Original PR: #561 

Add a withMaxResults method to NativeSearchQueryBuilder for specifying the maxResults
on the built Query. This is common for aggregation queries where search hits are not
needed.

Having the builder method for setting maxResults is a minor ergonomic improvement, e.g.

NativeSearchQuery searchQuery = NativeSearchQueryBuilder()
        .withQuery(matchAllQuery())
        .addAggregation(terms("examples").field("example"))
        .withMaxResults(0)
        .build();

versus what was required before:

NativeSearchQuery searchQuery = NativeSearchQueryBuilder()
        .withQuery(matchAllQuery())
        .addAggregation(terms("examples").field("example"))
        .build();
searchQuery.setMaxResults(0);
2020-11-30 18:54:30 +01:00
Peter-Josef Meisch
7912ae9779
DATAES-987 - IndexOperations getMapping fail when using index alias.
Original PR: #560
2020-11-26 06:54:20 +01:00
Mark Paluch
9bf6b6a984
DATAES-976 - Polishing.
Use deleteAllById(…) from deleteAll(…). Simplify implementation in SimpleReactiveElasticsearchRepository.

Original pull request: #554.
2020-11-25 13:44:10 +01:00
Jens Schauder
749270ba25
DATAES-976 - Implement CrudRepository and ReactiveCrudRepository.deleteAllById(Iterable<ID> ids).
Original pull request: #554.
2020-11-25 12:12:04 +01:00
Peter-Josef Meisch
b17999f8fa
DATAES-986 - Fix Javadoc.
Original PR: #559
2020-11-24 12:57:00 +01:00
Peter-Josef Meisch
8ef0970517
DATAES-983 - Test dependency hoverfly-java-junit5 leaks into compile scope.
Original PR: #558
2020-11-23 13:31:13 +01:00
Peter-Josef Meisch
54727229e1
DATAES-543 - Adjust configuration support classes so they do not require proxying.
Original PR: #557
2020-11-21 18:23:45 +01:00
Peter-Josef Meisch
04ceed2905
DATAES-978 - Accept DateFormat.none for a date property to enable custom Converters.
Original pR: #556
2020-11-19 23:12:26 +01:00
Peter-Josef Meisch
98043348f7
DATAES-972 - BeforeConvertCallback should be called before index query is built.
Originap PR: #555
2020-11-16 12:58:00 +01:00
Peter-Josef Meisch
6debccffbd
DATAES-975 - Upgrade to Elasticsearch 7.10.0.
Original PR: #553
2020-11-12 19:06:59 +01:00
Peter-Josef Meisch
88a8b84e5c
DATAES-974 - Remove usage of deprecated WebClient exchange() method.
Original PR: #552
2020-11-11 20:12:05 +01:00
Mark Paluch
ce82ae07b9
DATAES-965 - Updated changelog. 2020-11-11 12:34:41 +01:00
Peter-Josef Meisch
aa763efe7a
DATAES-971 - Fix tests for using a proxy with reactive client
Original PR: #551
2020-11-09 23:34:27 +01:00
Peter-Josef Meisch
6db1aa6871
DATAES-588 - Add HttpClientConfigCallback for non-reactive setup.
Original PR: #548
2020-11-08 21:59:06 +01:00
Peter-Josef Meisch
6bfeade7a0
DATAES-970 - Take Testcontainers version from the Spring Data Build pom.
Original PR: #547
2020-11-08 08:45:48 +01:00
Peter-Josef Meisch
d036693f05
DATAES-969 - Use ResultProcessor in ElasticsearchPartQuery to build PartTree.
Original PR: #546
2020-11-07 18:26:13 +01:00
Mark Paluch
1a354d8c51
DATAES-968 - Enable Maven caching for Jenkins jobs. 2020-10-30 08:35:56 +01:00
Mark Paluch
0a3facad91
DATAES-950 - After release cleanups. 2020-10-28 16:10:25 +01:00
Mark Paluch
40f6366daa
DATAES-950 - Prepare next development iteration. 2020-10-28 16:10:22 +01:00
Mark Paluch
a723f07401
DATAES-950 - Release version 4.1 GA (2020.0.0). 2020-10-28 15:46:57 +01:00
Mark Paluch
737578606c
DATAES-950 - Prepare 4.1 GA (2020.0.0). 2020-10-28 15:46:33 +01:00
Mark Paluch
f056e0957b
DATAES-950 - Updated changelog. 2020-10-28 15:46:26 +01:00
Mark Paluch
f385fa1908
DATAES-926 - Updated changelog. 2020-10-28 15:03:04 +01:00
Mark Paluch
27cfea7862
DATAES-925 - Updated changelog. 2020-10-28 12:15:06 +01:00
Mark Paluch
a9ea407bf3
DATAES-958 - Updated changelog. 2020-10-28 11:32:32 +01:00
Peter-Josef Meisch
5c8689727c
DATAES-962 - Deprecate Jodatime support.
Original PR: #545
2020-10-27 12:37:32 +01:00
Peter-Josef Meisch
1e6cfade1d
DATAES-960 - Upgrade to Elasticsearch 7.9.3.
Original PR: #543
2020-10-26 21:31:56 +01:00
Greg L. Turnquist
83a586caae
DATAES-928 - Use JDK 15 for latest CI jobs. 2020-10-26 13:07:32 -05:00
Peter-Josef Meisch
da20cc1684
DATAES-931 - Add query support for geo shape queries.
Original PR: #542
2020-10-21 23:05:18 +02:00
Peter-Josef Meisch
7198a02a00
DATAES-956 - Prevent double converter registration.
Original PR: #541
2020-10-18 19:05:31 +02:00
Peter-Josef Meisch
8a6e1254bb
DATAES-796 - Add method returning Mono<SearchPage<T>>.
Original PR: #540
2020-10-17 18:25:35 +02:00
Peter-Josef Meisch
23ac6d77cf
DATAES-952 - Optimize SearchPage implementation.
Original PR: #539
2020-10-16 16:24:59 +02:00
Peter-Josef Meisch
9bc4bee86f
DATAES-953 - DateTimeException on converting Instant or Date to custom format.
Original PR: #538
2020-10-15 23:08:10 +02:00
Peter-Josef Meisch
0ce2c499d5
DATAES-951 - Revert DATAES-934.
Original PR: #537
2020-10-15 17:25:40 +02:00
Christoph Strobl
e13c9483ae DATAES-927 - After release cleanups. 2020-10-14 14:48:47 +02:00
Christoph Strobl
a74fd895b0 DATAES-927 - Prepare next development iteration. 2020-10-14 14:48:46 +02:00
Christoph Strobl
76ad3c4e60 DATAES-927 - Release version 4.1 RC2 (2020.0.0). 2020-10-14 14:28:56 +02:00
Christoph Strobl
d8579d8610 DATAES-927 - Prepare 4.1 RC2 (2020.0.0). 2020-10-14 14:27:38 +02:00
Christoph Strobl
0a6d91d09a DATAES-927 - Updated changelog. 2020-10-14 14:27:36 +02:00
Peter-Josef Meisch
a5d93b0620
DATAES-949 - dependency cleanup.
Original PR: #536
2020-10-13 21:26:13 +02:00
Mark Paluch
5c30241572
DATAES-947 - Polishing.
Allow scrollId to be null.
2020-10-12 15:50:39 +02:00
Mark Paluch
bee7dbf65f
DATAES-947 - Use Flux.expand(…) for recursive reactive paging.
We now use Flux.expand(…) to recursively fetch search results (SearchRequest followed by multiple SearchScrollRequests) until consuming all search hits.

Previously we used inbound/outbound sinks to mimic a continuations by sending a request once the previous request finished. The recursive operator allows now for a simplified operator chain along with improved readability.
2020-10-12 15:50:19 +02:00
Mark Paluch
d80a4bdaa1
DATAES-947 - Adopt to API changes in Project Reactor.
Use Sinks API as subscriber instead of FluxProcessor.
2020-10-12 12:52:23 +02:00
Peter-Josef Meisch
a5d9e929d9
DATAES-934 - Add a Query taking method to ElasticsearchRepository.
Original PR: #535
2020-10-10 18:24:51 +02:00
Peter-Josef Meisch
83658121f3
DATAES-943 - Add missing mapping parameters.
Original PR: #534
2020-10-09 21:13:05 +02:00
Peter-Josef Meisch
49068b4e00
DATAES-945 - Compilation error on JDK11+.
Original PR: #533
2020-10-08 07:40:23 +02:00
Peter-Josef Meisch
4a25d3463b
DATAES-944 - Simplify logging setup in test environment.
Original PR: #532
2020-10-07 22:43:54 +02:00
Peter-Josef Meisch
f1dc7fc95c
DATAES-921 - Polishing. 2020-10-06 21:21:27 +02:00
Peter-Josef Meisch
980aff30ae
DATAES-921 - Favour exchangeToMono over deprecated exchange.
Original PR: #530
2020-10-06 21:02:18 +02:00
Peter-Josef Meisch
2a8c1dbdf8
DATAES-930 - Add support for geo_shape type entity properties.
Original PR: #531
2020-10-05 21:50:38 +02:00
Peter-Josef Meisch
36d8e7cc5e
DATAES-940 - Update to Elasticsearch 7.9.2. (#529) 2020-09-29 22:50:35 +02:00
Peter-Josef Meisch
e200791dc2
DATAES-935 - Setup integration tests separate from unit tests.
Original PR: #528
2020-09-26 14:27:41 +02:00
Peter-Josef Meisch
502bdb40a3
Revert "DATAES-935 - Setup integration tests separate from unit tests."
This reverts commit b44e2bfdde4c1669962c7bf5a4f4f34eaacfd981.
2020-09-25 22:44:05 +02:00
Peter-Josef Meisch
b44e2bfdde
DATAES-935 - Setup integration tests separate from unit tests.
Original PR: #527
2020-09-25 21:10:38 +02:00
Mark Paluch
a4c1505bec
DATAES-938 - Fix collection query detection in ReactiveElasticsearchQueryMethod.
isCollectionQuery() now correctly identifies if a query should return more than one result.
2020-09-25 15:41:33 +02:00
Peter-Josef Meisch
7117e5d70d
DATAES-937 - Repository queries with IN filters fail with empty input list.
Original PR: #525
2020-09-24 22:14:56 +02:00
Peter-Josef Meisch
8d4c305732
DATAES-936 - Take id property from the source when deserializing an entity.
Original PR: #523
2020-09-23 20:05:43 +02:00
vasyl-bhd
54909a83cb
DATAES-933 - Fix typo in javaDoc.
Original PR: #522
2020-09-21 18:48:41 +02:00
Peter-Josef Meisch
3edc5b0fb0
DATAES-932 - GeoPoint - Point conversion is wrong.
Original PR: #521
2020-09-20 21:28:25 +02:00
Peter-Josef Meisch
5dc68600f4
DATAES-929 - Support geo_shape field type field type.
Original PR: #520
2020-09-19 19:27:39 +02:00
Greg L. Turnquist
b7b17180f6
DATAES-928 - Only test other versions for local changes on main branch. 2020-09-18 11:28:39 -05:00
Mark Paluch
bc92c3ad9a
DATAES-904 - After release cleanups. 2020-09-16 14:05:29 +02:00
Mark Paluch
cba702fe07
DATAES-904 - Prepare next development iteration. 2020-09-16 14:05:26 +02:00
Mark Paluch
faca0162a1
DATAES-904 - Release version 4.1 RC1 (2020.0.0). 2020-09-16 13:57:43 +02:00
Mark Paluch
2c359018bd
DATAES-904 - Prepare 4.1 RC1 (2020.0.0). 2020-09-16 13:57:09 +02:00
Mark Paluch
52bdfe45dc
DATAES-904 - Updated changelog. 2020-09-16 13:57:06 +02:00
Mark Paluch
93d5ec3a40
DATAES-905 - Updated changelog. 2020-09-16 12:16:36 +02:00
Mark Paluch
ed496f6351
DATAES-888 - Updated changelog. 2020-09-16 11:20:12 +02:00
Mark Paluch
1212a720a2
DATAES-887 - Updated changelog. 2020-09-16 10:39:02 +02:00
Peter-Josef Meisch
0e7791a687
DATAES-924 - Conversion of properties of collections of Temporal values fails.
Original PR: #519
2020-09-15 23:18:03 +02:00
Peter-Josef Meisch
6034f38d72
DATAES-854 - Add support for rank_feature datatype.
Original PR: #518
2020-09-14 21:12:22 +02:00
Peter-Josef Meisch
92a11e6eda
DATAES-923 - Upgrade to Elasticsearch 7.9.1.
Original PR: #517
2020-09-14 18:14:54 +02:00
Mark Paluch
628c925c9a
DATAES-922 - Move off deprecated Reactor API.
Use .next() instead of publishNext(). Use direct Mono instead of toProcessor().
2020-09-14 11:35:12 +02:00
Mark Paluch
fd707abdf0
DATAES-922 - Move off Sink.emitXXX methods.
We now move oft the deprecated emitXXX(…) methods of the Sink API by switching to the the tryEmitXXX(…) methods.
2020-09-14 11:35:12 +02:00
Peter-Josef Meisch
d03510528b
DATAES-920 - Add parameter to @Field annotation to store null values.
Original PR: #516
2020-09-07 22:24:17 +02:00
Peter-Josef Meisch
ef1cbc35f6
DATAES-907 - Track Total Hits not working when set to false.
Original PR: #515
2020-08-28 23:06:42 +02:00
Peter-Josef Meisch
4344a65dc2
DATAES-919 - Fix error messages in test output.
Original PR: #514
2020-08-28 17:40:45 +02:00
Peter-Josef Meisch
6eb038a344
DATAES-910 - Update to Elasticsearch 7.9.0.
Original PR: #512
2020-08-27 20:59:19 +02:00
Peter-Josef Meisch
63efb2adef
DATAES-914 - Use TestContainers. 2020-08-27 20:03:45 +02:00
Peter-Josef Meisch
6361a1eefe
DATAES-914 - Use TestContainers. 2020-08-27 19:59:28 +02:00
Peter-Josef Meisch
79fdc449b8
DATAES-912 - Derived Query with "In" Keyword does not work on Text field.
Original PR: #510
2020-08-24 07:02:43 +02:00
Peter-Josef Meisch
4ef442966f
DATAES-913 - Minor optimization on collection-returning derived queries.
Original PR: #509
2020-08-23 15:28:50 +02:00
Peter-Josef Meisch
368957f735
DATAES-911 - Add documentation for automatic index creation.
Original PR: #508
2020-08-22 16:53:52 +02:00
Peter-Josef Meisch
a62e8af14f
DATAES-909 - Polishing. 2020-08-20 06:27:50 +02:00
Roman Puchkovskiy
0208bffc0a
DATAES-909 - Add singular update() methods to ReactiveDocumentOperations.
Original PR: #507 
Co-authored-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2020-08-20 06:13:59 +02:00
Peter-Josef Meisch
26ab5f6db4 DATAES-908 - Polishing. 2020-08-19 21:30:36 +02:00
Roman Puchkovskiy
c82792b34d
DATAES-908 - Fill version on an indexed entity.
Original PR: #506
2020-08-19 21:18:44 +02:00
Peter-Josef Meisch
131f0318cc
DATAES-706 - CriteriaQueryProcessor must handle nested Criteria definitions.
Original PR: #505
2020-08-18 20:59:35 +02:00
Peter-Josef Meisch
c8c6e7a646
DATAES-898 - Add join-type relevant parts to reactive calls.
Original PR: #504
2020-08-13 18:05:49 +02:00
Peter-Josef Meisch
7b1e4cc126
DATAES-902 - Update to Elasticsearch 7.8.1.
Original PR: #503
2020-08-12 20:37:08 +02:00
Mark Paluch
0626a5736f
DATAES-890 - Updated changelog. 2020-08-12 13:25:53 +02:00
Mark Paluch
0825db2a02
DATAES-872 - After release cleanups. 2020-08-12 12:00:24 +02:00
Mark Paluch
9459d1b8a1
DATAES-872 - Prepare next development iteration. 2020-08-12 12:00:21 +02:00
Mark Paluch
db78ef0ac6
DATAES-872 - Release version 4.1 M2 (2020.0.0). 2020-08-12 11:52:07 +02:00
Mark Paluch
da2e49763f
DATAES-872 - Prepare 4.1 M2 (2020.0.0). 2020-08-12 11:51:41 +02:00
Mark Paluch
53762db51d
DATAES-872 - Updated changelog. 2020-08-12 11:51:37 +02:00
Peter-Josef Meisch
2b6e639951
DATAES-901 - Operations deleting an entity should use a routing deducted from the entity-the-entity.
Original PR: #502
2020-08-11 22:24:23 +02:00
Peter-Josef Meisch
73bf3dd988
DATAES-899 - Add documentation for join-type.
original PR: #501
2020-08-10 21:58:57 +02:00
Peter-Josef Meisch
fd23c10c16
DATAES-896 - Use mainField property of @MultiField annotation.
Original PR: #500
2020-08-09 16:28:35 +02:00
Peter-Josef Meisch
fd77f62cc4
DATAES-897 - Add documentation for Highlight annotation.
Original PR: #499
2020-08-08 20:03:50 +02:00
Peter-Josef Meisch
99ed967b71 DATAES-433 - Polishing. 2020-08-07 16:07:54 +02:00
Subhobrata Dey
68bdc93a0b
[DATAES-433] Support join datatype.
Original PR: #485
2020-08-07 15:44:37 +02:00
Mark Paluch
0cfb1b563e
DATAES-894 - Polishing.
Reformat code. Add author tag.

Original pull request: #498.
2020-08-05 14:49:47 +02:00
Brian Clozel
103bf9f1b9
DATAES-894 - Adapt to changes in Reactor
This commit updates the `DefaultReactiveElasticsearchClient` after
changes in Reactor around `Processors` and `Sinks`.

Original pull request: #498.
2020-08-05 14:48:58 +02:00
Mark Paluch
b30f12503d
DATAES-893 - Adopt to changes in Project Reactor. 2020-08-04 12:31:59 +02:00
Mark Paluch
f19bf64827
DATAES-893 - Adopt to changed module layout of Reactor Netty. 2020-08-04 12:31:37 +02:00
Peter-Josef Meisch
f989cf873b
DATAES-891 - Returning a Stream from a Query annotated repository method crashes.
Original PR: #497
2020-07-29 09:49:55 +02:00
Mark Paluch
fe458612e9
DATAES-858 - Fix link to code of conduct. 2020-07-28 15:39:46 +02:00
Mark Paluch
04977680ed
DATAES-862 - Updated changelog. 2020-07-22 10:38:03 +02:00
Mark Paluch
c9e813ff72
DATAES-861 - Updated changelog. 2020-07-22 10:08:49 +02:00
Mark Paluch
a4cb8ef57c
DATAES-860 - Updated changelog. 2020-07-22 09:44:33 +02:00
Peter-Josef Meisch
ddee81f82e
DATAES-886 - Complete reactive auditing.
Original PR: #496
2020-07-18 19:34:00 +02:00
Peter-Josef Meisch
bdcecd0950
DATAES-612 - Add support for index templates.
Original PR: #495
2020-07-17 21:11:40 +02:00
Peter-Josef Meisch
0944d1654a
DATAES-842 - Documentation fixes.
Oriignal PR: #494
2020-07-10 21:50:31 +02:00
Peter-Josef Meisch
0f940b36d7
DATAES-883 - Fix log level on resource load error.
Original PR: #493
2020-07-10 21:19:11 +02:00
Peter-Josef Meisch
df4e6c449d
DATAES-878 - Wrong value for TermVector.
Original PR: #492
2020-07-02 06:41:35 +02:00
dependabot[bot]
168bc2dab5
DATAES-877 - Update test logging dependency.
Original PR: #491
2020-07-01 21:37:09 +02:00
Peter-Josef Meisch
bfe9d290a6
DATAES-876 - Add seqno and primary term to entity on initial save.
Original PR: #490
2020-06-30 21:13:22 +02:00
Peter-Josef Meisch
3782c8e738
DATAES-875 - MappingElasticsearchConverter.updateQuery not called at all places.
Original PR: #489
2020-06-29 22:00:47 +02:00
Peter-Josef Meisch
ea98ef4533
DATAES-874 - Deprecate parent-id related methods and fields.
Original PR: #488
2020-06-28 16:48:20 +02:00
Peter-Josef Meisch
7d8bc81fdd
DATAES-869 - Update to Elasticsearch 7.8.
Original PR: #487
2020-06-26 23:13:19 +02:00
Peter-Josef Meisch
44a669d66c
DATAES-864 - Rework alias management.
Original PR: #486
2020-06-25 21:57:47 +02:00
Mark Paluch
c6b2276029
DATAES-824 - After release cleanups. 2020-06-25 11:58:24 +02:00
Mark Paluch
ef836cb038
DATAES-824 - Prepare next development iteration. 2020-06-25 11:58:21 +02:00
Mark Paluch
db2a6b84a9
DATAES-824 - Release version 4.1 M1 (2020.0.0). 2020-06-25 11:48:51 +02:00
Mark Paluch
223ff41145
DATAES-824 - Prepare 4.1 M1 (2020.0.0). 2020-06-25 11:48:20 +02:00
Mark Paluch
604f23384b
DATAES-824 - Updated changelog. 2020-06-25 11:48:17 +02:00
Mark Paluch
011d2d5740
DATAES-870 - Consume response body to release connection directly.
We now ensure that response bodies from ClientResponse get released as part of our result handling. This is to prevent cancel signals issuing the connection release so that the connection release can be synchronized (awaited) before any subsequent requests get issued.

Connection release should be part of the Framework but the fallback interferes with Reactor Netty's HttpClient therefore we're ensuring proper resource disposal.
2020-06-23 09:25:08 +02:00
Mark Paluch
5b1e179e88
DATAES-870 - Polishing.
Simplify single-node flow.
2020-06-23 09:01:10 +02:00
Peter-Josef Meisch
6332534ea1 DATAES-866 - Polishing. 2020-06-21 19:41:28 +02:00
zh32
36f0907881
DATAES-866 - Implement suggest query in reactive client.
Original PR: #483
2020-06-21 17:24:53 +02:00
Peter-Josef Meisch
7cd871a419
DATAES-870 - Workaround for reactor-netty error.
Original PR: #484
2020-06-21 17:06:15 +02:00
Mark Paluch
d428db704e
DATAES-868 - Upgrade to Netty 4.1.50.Final. 2020-06-19 15:18:24 +02:00
Mark Paluch
9bf1c09457
DATAES-867 - Adopt to changes in Reactor Netty 1.0.
Move to HttpClient configuration API instead of using TcpClient.
2020-06-19 15:18:24 +02:00
Peter-Josef Meisch
92f16846ab DATAES-865 - Polishing. 2020-06-16 18:57:38 +02:00
Been24
1de1aeb2c7
DATAES - 865 - Fix MappingElasticsearchConverter writing an Object property containing a Map.
Original PR: #482
2020-06-16 18:46:07 +02:00
Peter-Josef Meisch
b177dd1681
DATAES-678 - Introduce ReactiveIndexOperations.
Original PR: #481
2020-06-13 17:08:48 +02:00
Peter-Josef Meisch
aeaa27cb99
DATAES-840 - Introduce IndexCoordinateResolver.
Original PR: #467
2020-06-12 08:23:41 +02:00
Peter-Josef Meisch
3c44a1c969
DATAES-863 - Improve server error response handling.
Original PR: #480
2020-06-11 19:13:59 +02:00
Mark Paluch
384e52b2c3
DATAES-823 - Updated changelog. 2020-06-10 14:31:01 +02:00
Mark Paluch
7b24ea9575
DATAES-807 - Updated changelog. 2020-06-10 12:29:54 +02:00
Mark Paluch
282214f8bc
DATAES-806 - Updated changelog. 2020-06-10 11:40:22 +02:00
Peter-Josef Meisch
bbf4c24195
DATAES-859 - No randomnumeric in tests.
Original PR: #479
2020-06-09 19:21:00 +02:00
Peter-Josef Meisch
407c8c6c17
DATAES-857 - Registered simple types are not read from list.
Original PR: #478
2020-06-09 16:27:39 +02:00
Mark Paluch
407da040ab
DATAES-858 - Use standard Spring code of conduct.
Using https://github.com/spring-projects/.github/blob/master/CODE_OF_CONDUCT.md.
2020-06-09 16:08:02 +02:00
Peter-Josef Meisch
275560ecf3
DATAES-263 - Inner Hits support.
Original PR: #477
2020-06-08 10:16:21 +02:00
Peter-Josef Meisch
846dbea2b8 DATAES-263 - Inner Hits support.
Original PR: #473
minor fix
2020-06-08 10:13:28 +02:00
Peter-Josef Meisch
8dbbc80887
DATAES-853 - Cleanup tests that do not delete test indices.
Original PR: #476
2020-06-05 21:25:01 +02:00
Peter-Josef Meisch
8fea655854
DATAES-852 - Upgrade to Elasticsearch 7.7.1.
Original PR: #475
2020-06-05 14:47:19 +02:00
Peter-Josef Meisch
caebe08cf2
DATAES-263 - Inner Hits support. (#473)
original PR: #473
2020-06-03 14:25:48 +02:00
Peter-Josef Meisch
859b22db8e
DATAES-850 - Add warning and docs for missing TemporalAccessor configuration.
Original PR: #472
2020-05-31 22:59:32 +02:00
Peter-Josef Meisch
79dae4ee03
DATAES-848 - Add the name of the index to SearchHit.
Original PR: #471
2020-05-29 23:44:32 +02:00
Peter-Josef Meisch
852273eff5
DATAES-845 - MappingElasticsearchConverter handles lists with null values.
Original PR: #470
2020-05-29 19:09:08 +02:00
Peter-Josef Meisch
d26dfbba70 DATAES-847 - Polishing. 2020-05-29 19:01:27 +02:00
Tim te Beek
fa317014a7
DATAES-847 - Add missing DateFormat values.
Original PR: #469
2020-05-29 18:52:54 +02:00
Mark Paluch
cb750e03a9
DATAES-844 - Improve TOC formatting for migration guides. 2020-05-26 16:20:45 +02:00
Peter-Josef Meisch
0f84158e1e
DATAES-841 - Remove deprecated type mappings code.
Original PR: #468
2020-05-23 16:56:13 +02:00
Peter-Josef Meisch
dc6734db43
DATAES-839 - ReactiveElasticsearchTemplate should use RequestFactory.
Original PR: #466
2020-05-21 12:29:00 +02:00
Peter-Josef Meisch
bcd7c2a1d8
DATAES-838 - Update to Elasticsearch 7.7.0.
Original PR:  #465
2020-05-21 06:47:39 +02:00
jinwook han
d8d3f9431b
DATAES-836 - Fix typo in Javadoc.
Original PR: #463
2020-05-20 16:39:08 +02:00
Peter-Josef Meisch
2875c62cfe
DATAES-835 - Fix code sample in documentation for scroll API.
Original PR: #462
2020-05-20 08:41:59 +02:00
Peter-Josef Meisch
75a430d431
DATAES-833 - Documentation fix for custom date formats.
Original PR: #461
2020-05-19 19:36:35 +02:00
Peter-Josef Meisch
49f1516b9e DATAES-832 - findAllById repository method returns iterable with null elements for not found ids. 2020-05-18 17:52:34 +02:00
Peter-Josef Meisch
b439acac16
DATAES-832 - findAllById repository method returns iterable with null elements for not found ids.
#Original PR: #460
2020-05-17 19:22:25 +02:00
Peter-Josef Meisch
506f79a45a
DATAES-831 - SearchOperations.searchForStream does not use requested maxResults.
Original PR: #459
2020-05-17 10:49:50 +02:00
Peter-Josef Meisch
391e240b49
DATAES-829 - Deprecate AbstractElasticsearchRepository and cleanup SimpleElasticsearchRepository.
Original PR: #458
2020-05-15 21:15:31 +02:00
Peter-Josef Meisch
aaef626684
DATAES-828 - Fields of type date need to have a format defined.
Original PR: #457
2020-05-14 20:26:54 +02:00
Peter-Josef Meisch
c7339dc248
DATAES-826 - Repositories should not try to create an index when it already exists.
original PR: #456
2020-05-14 18:05:03 +02:00
Peter-Josef Meisch
7540a2a1a8
DATAES-826 - Add method to IndexOperations to write an index mapping from an entity class.
Original PR: #455
2020-05-14 07:58:07 +02:00
Kai Kewley
6487d0ddd4
DATAES-825 - Update link to spring.io docs to track latest.
Original PR: #454
2020-05-13 18:26:23 +02:00
Mark Paluch
9ac18855fc
DATAES-808 - After release cleanups. 2020-05-12 12:40:30 +02:00
Mark Paluch
0dc0f40cba
DATAES-808 - Prepare next development iteration. 2020-05-12 12:40:28 +02:00
Mark Paluch
2bbe88f49a
DATAES-808 - Release version 4.0 GA (Neumann). 2020-05-12 12:28:23 +02:00
Mark Paluch
f86231353f
DATAES-808 - Prepare 4.0 GA (Neumann). 2020-05-12 12:27:59 +02:00
Mark Paluch
5483176be4
DATAES-808 - Updated changelog. 2020-05-12 12:27:58 +02:00
Peter-Josef Meisch
8118713706 DATAES-822 - Convert Reactive Server Exceptions to ElasticsearchStatusException. 2020-05-12 06:22:13 +02:00
Mark Paluch
cea8c93616
DATAES-822 - Convert Reactive Client exceptions to ElasticsearchStatusException.
We now use ElasticsearchStatusException instead of HttpClientErrorException to simplify exception translation so that ElasticsearchExceptionTranslator does no longer depend on spring-web.
2020-05-11 17:56:19 +02:00
Peter-Josef Meisch
5100fe04cc
DATES-821 - Fix code for adding an alias.
Original PR: #451
2020-05-10 19:45:15 +02:00
Peter-Josef Meisch
a4fd008a24
DATAES-819 - Test refactorings.
Original PR: #450
2020-05-09 19:48:26 +02:00
Peter-Josef Meisch
ec7414c356
DATAES-817 - StreamQueries does only delete the last scrollid. (#449)
Original PR: #449
2020-05-07 22:11:18 +02:00
Peter-Josef Meisch
3c9b0a7b2f
DATAES-814 - Fix documentation.
Original PR: #448
2020-05-06 08:19:48 +02:00
Peter-Josef Meisch
4deea9d667
DATAES-812 - IndexOperations should use SpEL index name from entity.
Original PR: #447
2020-05-05 21:39:06 +02:00
Greg Turnquist
97cb075afe
DATAES-811 - Remove Travis CI. 2020-05-04 15:20:28 -05:00
Peter-Josef Meisch
e605cad688
DATAES-767 - Fix ReactiveElasticsearch handling of 4xx HTTP responses.
Original PR: #445
2020-05-02 20:08:25 +02:00
Peter-Josef Meisch
07ee01f435
DATAES-750 - Migration guide and documentation update.
Original PR: #444
2020-05-01 22:04:01 +02:00
Peter-Josef Meisch
b278bf9819
DATAES-809 - Creation of test data may lead to duplicate values.
Original PR: #443
2020-04-30 08:18:29 +02:00
Peter-Josef Meisch
15f51c5151 DATAES-799 - Polishing. 2020-04-29 20:30:09 +02:00
Roman Puchkovskiy
9b620b31bd
DATAES-799 - Support optimistic locking for full update scenario using seq_no + primary_term.
Original PR: #441
2020-04-29 20:11:14 +02:00
Mark Paluch
853980cdfd DATAES-774 - After release cleanups. 2020-04-28 15:11:43 +02:00
Mark Paluch
2e346a4e4a DATAES-774 - Prepare next development iteration. 2020-04-28 15:11:42 +02:00
Mark Paluch
6277330017 DATAES-774 - Release version 4.0 RC2 (Neumann). 2020-04-28 15:03:53 +02:00
Mark Paluch
1d4adadaa7 DATAES-774 - Prepare 4.0 RC2 (Neumann). 2020-04-28 15:03:33 +02:00
Mark Paluch
051af10402 DATAES-774 - Updated changelog. 2020-04-28 15:03:32 +02:00
Mark Paluch
5beaf561df DATAES-770 - Updated changelog. 2020-04-28 14:46:50 +02:00
Mark Paluch
04b739e637 DATAES-755 - Updated changelog. 2020-04-28 11:59:01 +02:00
Peter-Josef Meisch
efbe7237f2 DATAES-802 - Polishing. 2020-04-26 17:45:40 +02:00
JBodkin
21ade25fbb
DATAES-802 - Update documentation for using scroll API with repository methods.
Original PR: #440
2020-04-26 17:40:30 +02:00
Peter-Josef Meisch
a4ec819e7d
DATAES-801 - Implement callback to enable adding custom headers in the REST HTTP request.
Original PR: #442
2020-04-26 17:30:46 +02:00
Peter-Josef Meisch
65f89f9480
DATAES-803 - Move count request setup from reactive template to reactive client.
Original PR: #439
2020-04-24 18:00:29 +02:00
Peter-Josef Meisch
da31b978bc
DATAES-800 - Delombok production code.
Original PR: #438
2020-04-23 23:23:58 +02:00
Peter-Josef Meisch
4876a0e3ab
DATAES-797 - Fix MappingElasticsearchConverter recursive descent when reading Map objects.
Original PR: #437
2020-04-23 08:01:46 +02:00
Peter-Josef Meisch
60cbb67877 DATAES-785 - Polishing. 2020-04-21 21:57:31 +02:00
Roman Puchkovskiy
7501c19be4
DATAES-785 - Various entity callbacks implementation improvements.
Original PR: #431
2020-04-21 21:24:22 +02:00
kkonrad
5019793f17
Fix MappingElasticsearchConverter conversion from Document into Map<String, Object>.
Original PR: #436
2020-04-21 20:39:03 +02:00
Peter-Josef Meisch
16d8cc22d1
DATAES-794 - MappingBuilder must not write empty mapping properties.
Original PR: #434
2020-04-20 22:42:04 +02:00
Peter-Josef Meisch
91f442bd2f DATAES-567 - Polishing. 2020-04-20 18:56:11 +02:00
amordleq
c2eec8c74a
DATAES-567 - Add aggregation support to reactive client. (#430)
Original PR: #430
2020-04-20 18:33:35 +02:00
Peter-Josef Meisch
0afa37c8ea
DATAES-792 - Fix tests with timezone.
Original PR: #433
2020-04-19 23:34:44 +02:00
Peter-Josef Meisch
e49f140233
DATAES-792 - Add java.util.Date to the supported types for Field annotation date times.
Original PR: #432
2020-04-19 22:58:02 +02:00
Peter-Josef Meisch
f6a37f4601 DATAES-772 - Polishing. 2020-04-17 21:40:54 +02:00
Roman Puchkovskiy
76e91c3366
DATAES-772 - Add after-convert entity callbacks support.
Original PR: #422
2020-04-17 21:29:39 +02:00
Peter-Josef Meisch
539c1ee6e7
DATAES-778 - Fix SSL setup in the reactive client.
Original PR: #429
2020-04-16 21:44:53 +02:00
Peter-Josef Meisch
99bf2fc0cb DATAES-786 - Polishing. 2020-04-16 07:06:19 +02:00
Roman Puchkovskiy
ff08d06c45
DATAES-786 - Move the creation of SearchHit(s) from ElasticsearchConverter closer to ElasticsearchTemplate..
Original PR: #427
2020-04-16 06:50:16 +02:00
Peter-Josef Meisch
39fb25cbb9
DATAES-791 - DocumentOperations.multiGet() implementations must return null values for not found entities.
Original PR: #428
2020-04-14 22:12:19 +02:00
alesharik
41fffc0fa5
DATAES-789 - Make ElasticsearchRestTemplate.ClientCallback public.
Original PR: #425
2020-04-14 22:02:16 +02:00
Peter-Josef Meisch
771d8fb5e7
DATAES-790 - Deprecate noRefresh repository method.
Original PR: #426
2020-04-12 07:40:52 +02:00
Peter-Josef Meisch
89944b66c4
DATAES-788 - Add missing path mapping to completion context.
Original PR: #424
2020-04-11 11:50:31 +02:00
Peter-Josef Meisch
bbc9ec213a
DATAES-784 - MappingBuilder should use @Field annotation with custom value objects.
Original PR: #423
2020-04-07 14:40:41 +02:00
Peter-Josef Meisch
3afd6fd427
DATAES-782 - Make underlying TransportClient accessible.
Original PR: #421
2020-04-04 19:19:26 +02:00
Peter-Josef Meisch
e449944e3b
DATAES-781 - Upgrade to Elasticsearch 7.6.2.
Original PR: #419
2020-04-04 11:10:36 +02:00
Peter-Josef Meisch
b434b05215
DATAES-777 - SearchHitsSupport must preserve pageable when unwrapping to AggregatedPage.
Original PR: #418
2020-04-01 21:18:52 +02:00
Peter-Josef Meisch
bce9da4343
DATAES-766 - Adapt RestClients class to change in InetSocketAddress class in JDK14.
Original PR: #417
2020-04-01 07:55:04 +02:00
Peter-Josef Meisch
403d9d08e2
DATAES-775 Fix test runner setup.
Original PR: #416
2020-03-31 22:15:30 +02:00
Peter-Josef Meisch
1cd572125e
DATAES-773 - Polishing. 2020-03-31 20:36:36 +02:00
alesharik
40752c2235
DATAES-773 - Add search-as-you-type field support.
Original PR: #415
2020-03-31 20:24:44 +02:00
Mark Paluch
40838e187c DATAES-762 - After release cleanups. 2020-03-31 15:08:05 +02:00
Mark Paluch
d0cfd498ee DATAES-762 - Prepare next development iteration. 2020-03-31 15:08:04 +02:00
Mark Paluch
ed5fe948d1 DATAES-762 - Release version 4.0 RC1 (Neumann). 2020-03-31 14:59:41 +02:00
Mark Paluch
27871899b0 DATAES-762 - Prepare 4.0 RC1 (Neumann). 2020-03-31 14:59:20 +02:00
Mark Paluch
863c54f24f DATAES-762 - Updated changelog. 2020-03-31 14:59:19 +02:00
Peter-Josef Meisch
abf886e877 DATAES-771 - Polishing. 2020-03-29 19:54:00 +02:00
Roman Puchkovskiy
c73d1973bc
DATAES-771 - Add after-save entity callbacks support.
Original PR: #414
2020-03-29 19:50:56 +02:00
Peter-Josef Meisch
a7cdfb84b0 DATAES-653 - Polishing. 2020-03-29 19:09:53 +02:00
Roman Puchkovskiy
0b378601d9
DATAES-653 - Make it easier to use a custom request converter when extending DefaultReactiveElasticsearchClient.
Original PR: #411
2020-03-29 19:06:56 +02:00
Peter-Josef Meisch
2ec61ab4ff
DATAES-435 - Report version mismatch if used with older ElasticSearch-version.
Original PR: #413
2020-03-28 11:09:06 +01:00
Peter-Josef Meisch
21406a5e7d
DATAES-766 - Replace CloseableIterator with SearchHitsIterator in stream operations.
Original PR: #412

fix documentation
2020-03-27 17:19:56 +01:00
Mark Paluch
fd711093b1 DATAES-756 - Updated changelog. 2020-03-25 10:59:47 +01:00
Peter-Josef Meisch
f8630a09df
Dataes 768 add missing query parameters for an update query.
Original PR: #410
2020-03-23 20:59:30 +01:00
xhaggi
f354f986ca DATAES-766 - Replace CloseableIterator with SearchHitsIterator in stream operations.
Original pull request: #407
2020-03-22 09:52:35 +01:00
Peter-Josef Meisch
db28d93676 DATAES-763 - Polishing. 2020-03-22 08:46:57 +01:00
gsrinivas10
a92970236c
DATAES-763 - Allow map properties in entity with null values.
Original PR: #405
2020-03-22 08:29:32 +01:00
Peter-Josef Meisch
745f9e9d79
DATAES-765 - Pageable.unpaged() is not used to build a query returning all documents.
Original PR: #408
2020-03-20 18:27:50 +01:00
Sascha Woo
f103bdb9d8
DATAES-764 - StreamQueries#streamResults does not clear scroll context when finished.
Original PR: #406
2020-03-18 20:37:05 +01:00
Peter-Josef Meisch
300eb313dd
DATAES-68 - Add support for auditing annotations.
Original PR: #400
2020-03-11 18:39:11 +01:00
Peter-Josef Meisch
0b0c8027a3
DATAES-751 - Introduce ClientCallback for the rest client.
Original PR: #401
2020-03-11 12:34:56 +01:00
Jens Schauder
ab0c6a8f66 DATAES-744 - After release cleanups. 2020-03-11 09:57:43 +01:00
Jens Schauder
9e81d39194 DATAES-744 - Prepare next development iteration. 2020-03-11 09:57:42 +01:00
Jens Schauder
8a6f56a89e DATAES-744 - Release version 4.0 M4 (Neumann). 2020-03-11 09:47:07 +01:00
Jens Schauder
3a528c7039 DATAES-744 - Prepare 4.0 M4 (Neumann). 2020-03-11 09:46:29 +01:00
Jens Schauder
31ea4548d7 DATAES-744 - Updated changelog. 2020-03-11 09:46:27 +01:00
Peter-Josef Meisch
9258cdde84
DATAES-759 - Update to Elasticsearch 7.6.1.
OriginalPR: #404
2020-03-07 23:00:19 +01:00
Peter-Josef Meisch
ec214a009e
DATAES-758 - Fix documentation for @Query annotation.
Original PR: #403
2020-03-06 19:08:49 +01:00
Peter-Josef Meisch
251adc1eec
DATAES-754 - Completion field deserialization is failing due to class cast error.
Original PR: #399
2020-02-26 22:34:44 +01:00
Peter-Josef Meisch
bf51de3805
DATAES-753 - Reactive Elasticsearch repository: Bulk update fails on empty entity list.
Original PR: #398
2020-02-26 21:50:42 +01:00
Peter-Josef Meisch
6a4a7483aa
DATAES-749 - Introduce SearchPage as return type for repository methods.
Original PR: #397
2020-02-26 21:13:30 +01:00
Mark Paluch
dc795eb7ee DATAES-730 - Updated changelog. 2020-02-26 11:55:05 +01:00
Mark Paluch
f541133569 DATAES-729 - Updated changelog. 2020-02-26 11:31:48 +01:00
Peter-Josef Meisch
96ebc72dd1
Dataes 745 consolidate operations api
Original PR: #396
2020-02-25 22:01:40 +01:00
Roman Puchkovskiy
1f56a9b9fe
DATAES-741 / Tests fail due to Elasticsearch cluster 'blocks' on nearly-full file-systems.
Original PR: #393
2020-02-15 16:22:40 +01:00
Peter-Josef Meisch
9696f418fd
DATAES-747 - ElasticsearchConfigurationSupport does not set customConversions into the MappingElasticsearchConverter.
Original PR: #395
2020-02-15 14:45:41 +01:00
Peter-Josef Meisch
36a3d5943a
DATAES-746 - Add store converters to convert binary data.
Original PR: #394
2020-02-14 21:24:51 +01:00
Mark Paluch
05df3c3805 DATAES-732 - After release cleanups. 2020-02-12 15:04:22 +01:00
Mark Paluch
ead2cb13b7 DATAES-732 - Prepare next development iteration. 2020-02-12 15:04:21 +01:00
Mark Paluch
a9295947c6 DATAES-732 - Release version 4.0 M3 (Neumann). 2020-02-12 14:47:16 +01:00
Mark Paluch
c85c20e039 DATAES-732 - Prepare 4.0 M3 (Neumann). 2020-02-12 14:46:56 +01:00
Mark Paluch
94f8623349 DATAES-732 - Updated changelog. 2020-02-12 14:46:55 +01:00
Peter-Josef Meisch
77f43ce64c DATAES-738 - Removing one save method as it does not fit the naming scheme. 2020-02-11 19:03:00 +01:00
Peter-Josef Meisch
9c64dd9c39
DATAES-743 - Revert geo converters to back to store converters.
Original PR: #390
2020-02-11 18:33:58 +01:00
Peter-Josef Meisch
b2ffc236bf
DATAES-738 - Add entity related save methods to DocumentOperations.
Original PR: #389
2020-02-10 22:09:49 +01:00
Peter-Josef Meisch
0c15eef858 DATAES-740 - Adapt to spring-data-commons changes.
Original PR: #386
2020-02-09 19:31:16 +01:00
Peter-Josef Meisch
936de20421 DATAES-739 - Introduce nullable annotations for API validation.
Original PR: #387
2020-02-09 13:00:25 +01:00
Peter-Josef Meisch
4fc4d91b74
DATAES-735 - Update to Elasticsearch 7.5.2.
Original PR: #384
2020-01-25 21:36:34 +01:00
Peter-Josef Meisch
13761b073a
DATAES-449 - Pass route parameter to created search request.
Original PR: #383
2020-01-25 18:54:51 +01:00
Peter-Josef Meisch
37f15853c0
DATAES-734 - Add Sort implementation that allows geo distance sorts.
Original PR: #382
2020-01-23 18:03:37 +01:00
Mark Paluch
bf13ed919f DATAES-731 - After release cleanups. 2020-01-17 09:47:50 +01:00
Mark Paluch
9e3712e41e DATAES-731 - Prepare next development iteration. 2020-01-17 09:47:49 +01:00
Mark Paluch
033a6b21dc DATAES-731 - Release version 4.0 M2 (Neumann). 2020-01-17 09:39:03 +01:00
Mark Paluch
1f19ac0313 DATAES-731 - Prepare 4.0 M2 (Neumann). 2020-01-17 09:38:43 +01:00
Mark Paluch
2b5619f172 DATAES-731 - Updated changelog. 2020-01-17 09:38:42 +01:00
Mark Paluch
bf75f0fab2 DATAES-663 - After release cleanups. 2020-01-16 16:11:55 +01:00
Mark Paluch
86c621de35 DATAES-663 - Prepare next development iteration. 2020-01-16 16:11:54 +01:00
Mark Paluch
191ce92743 DATAES-663 - Release version 4.0 M1 (Neumann). 2020-01-16 16:05:23 +01:00
Mark Paluch
fe8d2fe1a2 DATAES-663 - Prepare 4.0 M1 (Neumann). 2020-01-16 16:05:03 +01:00
Mark Paluch
2677e39bb1 DATAES-663 - Updated changelog. 2020-01-16 16:05:02 +01:00
Mark Paluch
fe0359f40b DATAES-704 - Updated changelog. 2020-01-15 12:51:13 +01:00
Mark Paluch
28d31fbb07 DATAES-703 - Updated changelog. 2020-01-15 10:36:36 +01:00
Mark Paluch
9e5a828342
DATAES-690 - Polishing.
Revert parent pom version to 2.3.0.BUILD-SNAPSHOT.
2020-01-14 14:50:04 +01:00
Peter-Josef Meisch
e5ec8fdab3 DATAES-623 - Polishing. 2020-01-13 20:35:03 +01:00
alesharik
d7262e4370 DATAES-623 - Add bulk operations for ReactiveElasticsearchRepository.
Original PR:#376
2020-01-13 20:26:19 +01:00
Peter-Josef Meisch
e670a88772
DATAES-724 - Provide IndexOperations bean.
Original PR: #381
2020-01-12 18:11:40 +01:00
Peter-Josef Meisch
513741bcf6
DATAES-701 - Enable proxy support for the reactive rest client.
Original PR: #380
2020-01-11 21:13:42 +01:00
Peter-Josef Meisch
d55cb00d45
DATAES-727 - Use track_total_hits parameter for count queries.
Original PR: #379
2020-01-10 15:52:03 +01:00
Peter-Josef Meisch
7294accaca
DATAES-661 - Added track_total_hits request parameter to Query.
Original PR: #378
2020-01-09 23:29:34 +01:00
Greg Turnquist
0843481cc5
DATAES-690 - Enable JDK 11+ builds. 2020-01-09 10:10:50 -06:00
Mark Paluch
8472c296f6
DATAES-725 - Update copyright years to 2020. 2020-01-07 09:08:10 +01:00
Peter-Josef Meisch
0693923798
DATAES-372 - Support highlighting via annotation.
Original PR: #377
2020-01-06 22:25:54 +01:00
Peter-Josef Meisch
d3c624c28a DATAES-461 - Polishing. 2020-01-05 10:40:59 +01:00
alesharik
5eb83464a1 DATAES-461 - Make deleteAll(entities) more performant.
Original PR: #375
2020-01-05 10:36:14 +01:00
Peter-Josef Meisch
9fea1365ac
DATAES-718 - Deprecate @Score and scoreProperty.
original PR: #374
2020-01-04 22:19:01 +01:00
Peter-Josef Meisch
16e0f566cd
DATAES-723 - Cleanup ElasticsearchRepository interface.
Original PR: #373
2020-01-04 17:44:19 +01:00
Peter-Josef Meisch
0d272fe9bf
DATAES-717 - Enable Repositories to return a SearchHits instance instead of a list.
Original PR: #372
2020-01-03 23:20:17 +01:00
Peter-Josef Meisch
e2d4ed96c8
DATAES-278 - Fix documentation for created queries from repository method names.
Original PR: #371
2020-01-02 13:27:32 +01:00
Peter-Josef Meisch
bd047776e2
DATAES-711 - Update to Elasticsearch 7.5.1.
Original PR: #370
2019-12-31 19:39:20 +01:00
Peter-Josef Meisch
5c862e80bf
DATAES-722 - Return total count relation in the SearchHits object.
Original PR: #369
2019-12-31 13:55:56 +01:00
Peter-Josef Meisch
90d29994f1
DATAES-715 - Highlight results should be returned in the SearchHits.
Original PR: #368
2019-12-30 17:08:52 +01:00
Peter-Josef Meisch
d026884c12
DATAES-721 - Deprecation and Warnings cleanup.
Original PR: #367
2019-12-29 21:46:58 +01:00
Peter-Josef Meisch
a68c6ba5d7
Dataes 716 - Add value mapping to the ElasticsearchMappingConverter.
Original PR: #366
2019-12-28 19:25:25 +01:00
Peter-Josef Meisch
d2b7df87f4
DATAES-713 - Add returned aggregations from the AggregatedPage to the SearchHits.
Original PR: #365
2019-12-26 20:14:04 +01:00
Peter-Josef Meisch
b634f318ab
DATAES-720 - SimpleReactiveElasticsearchRepository findAll() returns only 10 elements.
Original PR: #364
2019-12-25 10:40:10 +01:00
Peter-Josef Meisch
f7a14c1135
DATAES-719 - Add customization hook for reactive WebClient.
Original PR: #363
2019-12-25 08:35:48 +01:00
Peter-Josef Meisch
6dfeee3ba9
DATAES-676 - Fix documentation to reflect the changes in API restructuring.
Original PR: #362
2019-12-24 09:23:23 +01:00
Peter-Josef Meisch
d19e699b32
DATAES-714 - Sort results should be returned in the SearchHits.
Original PR: #361
2019-12-22 14:25:43 +01:00
Peter-Josef Meisch
e55bae725e
DATAES-672 - Introduce SearchHit and SearchHits types to enrich search results.
Original PR: #359
2019-12-22 12:15:46 +01:00
Peter-Josef Meisch
2bb3fdfa8b
DATAES-314 - NodeClientFactoryBean doesn't shutdown ES on destroy life-cycle.
Original PR: #360
2019-12-15 15:53:52 +01:00
Sascha Woo
47d0104295 DATAES-709 - Add parameter to include defaults on get settings.
Original PR: #357
2019-12-15 09:44:37 +01:00
Peter-Josef Meisch
dec5231a05
DATAES-239 - Query for null values.
Original PR: #355
2019-12-11 22:09:02 +01:00
Peter-Josef Meisch
11a6430a90
DATAES-634 - Rearrange methods in Template API.
Original PR: #352
2019-12-10 19:04:37 +01:00
Sascha Woo
ff381c63b6 DATAES-187 - Use Pageable#getOffset to set from offset in SearchRequest.
Original PR: #353
2019-12-06 13:15:15 +01:00
Jens Schauder
9d4fe6d4af DATAES-692 - Updated changelog. 2019-12-04 14:32:47 +01:00
Jens Schauder
e882dae3af DATAES-691 - Updated changelog. 2019-12-04 12:09:50 +01:00
Sascha Woo
aa4ae525f4 DATAES-702 - Travis CI builds currently broken.
Original PR: #351
2019-12-03 12:16:52 +01:00
Peter-Josef Meisch
c3714dd6e5
DATAES-675 - Migrate tests to JUnit 5.
Original PR: #350
2019-12-01 18:31:51 +01:00
Peter-Josef Meisch
03fd603909
DATAES-700 - Enable proxy support for RestClient.
Original PR: #348
2019-11-30 23:00:19 +01:00
Peter-Josef Meisch
35e9b691bd
DATAES-697_-_Query-refactoring-cleanup.
Original PR: #347
2019-11-30 15:49:14 +01:00
Peter-Josef Meisch
2cd18178e3
DATAES-631 - Consolidate query objects.
Original PR: #340
2019-11-28 23:41:13 +01:00
MassimilianoPoggi
79d75f814c DATAES-693 - Support for source fetching in update operations.
Original PR: #346
2019-11-18 20:31:35 +01:00
Mark Paluch
eba23eeb17 DATAES-685 - Updated changelog. 2019-11-18 12:43:26 +01:00
Mark Paluch
8e5f0dd341 DATAES-683 - Updated changelog. 2019-11-18 12:16:27 +01:00
Peter-Josef Meisch
3f82108734
DATAES-675 - Migrate tests to JUnit 5.
OriginalPR: #345
2019-11-09 21:40:48 +01:00
Peter-Josef Meisch
8bc133d955
DATAES-148 - Dynamic mapping setting.
Original PR: #344
2019-11-09 20:54:44 +01:00
Peter-Josef Meisch
26ab706e87
DATAES-688 - Remove unneeded SearchQuery subinterface.
Original PR: #343
2019-11-08 16:44:52 +01:00
Peter-Josef Meisch
62385edaa5
DATAES-680 - ReactiveElasticsearchTemplate-should-use-the-count-API.
Original PR: #341
2019-11-06 19:14:47 +01:00
Peter-Josef Meisch
24751972a8 DATAES-684 - Polishing. 2019-11-05 10:05:14 +01:00
Henrique Amaral
6ae424428c DATAES-684 Implement bulk request from reactive client
Original PR: #342 

* DATAES-684 Implement bulk request from reactive client

* Update src/main/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClient.java

Co-Authored-By: Peter-Josef Meisch <pj.meisch@sothawo.com>

* DATAES-684 Implement bulk request from reactive client

Added author
2019-11-05 09:57:13 +01:00
Christoph Strobl
a4b9a764c9 DATAES-662 - Updated changelog. 2019-11-04 15:39:57 +01:00
Christoph Strobl
4f66a9bcda DATAES-660 - Updated changelog. 2019-11-04 10:34:52 +01:00
Peter-Josef Meisch
c46a6f4c64
DATAES-675 - Migrate tests to JUnit5.
Original PR: #338
2019-10-28 21:24:08 +01:00
Peter-Josef Meisch
c50af32fc3
DATAES-677 - Update to Elasticsearch 7.4.1.
Original PR: #337
2019-10-27 12:23:42 +01:00
Peter-Josef Meisch
a438b38f05
DATAES-675 - Migrate tests to JUnit5.
Original PR: #336
2019-10-25 23:27:33 +02:00
Peter-Josef Meisch
4e7f1ccb4b
DATAES-630 - Remove GetResultMapper and friends from core package.
Original PR: #331
2019-10-25 22:05:58 +02:00
Peter-Josef Meisch
d4f23a50e7
DATAES-316 - Revert: NodeClientFactoryBean doesn't shutdown ES on destroy life-cycle.
Original PR: #335
2019-10-25 21:38:46 +02:00
Peter-Josef Meisch
29f34b05d3
DATAES-314 - NodeClientFactoryBean doesn't shutdown ES on destroy life-cycle.
Original PR: #333
2019-10-22 19:44:02 +02:00
Henrique Amaral
f7f103d331 DATAES-673 Create a Ssl Rest Client using SslContext and HostnameVerifier
Original PR: #334
2019-10-22 19:02:19 +02:00
Peter-Josef Meisch
38353e5bdd DATAES-654 - Add JUnit5 support. 2019-10-21 18:06:49 +02:00
Peter-Josef Meisch
58920af37a
DATAES-654 - Add Junit5 support.
Original PR: #329
2019-10-20 20:05:33 +02:00
Gyula Csörögi
4682636333 DATAES-671 - Missing indicesOptions support for scrolling queries.
Original PR: #332
2019-10-16 06:35:34 +02:00
Mark Paluch
ba76986172
DATAES-619 - Migrate remaining tests to AssertJ. 2019-10-14 14:21:23 +02:00
Peter-Josef Meisch
c4bb59e545 DATAES-670 - Fix version compatibility matrix in documentation.
Original PR: #330
2019-10-12 10:46:13 +02:00
Peter-Josef Meisch
d72ee18944 DATES-666 - Rebase 4.0.x onto master and merge. 2019-10-01 20:49:00 +02:00
Peter-Josef Meisch
d3295a6416 DATAES-659 - Move MappingElasticsearchConverter to correct package.
Original PR: #328
2019-10-01 20:11:39 +02:00
Peter-Josef Meisch
1b12d81b81 DATAES-685 - update to ES 7.3.2.
Original PR: #326
2019-10-01 20:11:39 +02:00
Peter-Josef Meisch
4b9bcfb410 DATAES-650 - Polishing. 2019-10-01 20:11:06 +02:00
Huw
948d29ba65 DATAES-650 - Add support for pathPrefix to configuration classes.
Original pull request: #320.
2019-10-01 20:11:06 +02:00
Peter-Josef Meisch
b820c9a422 DATAES-629 - ElasticsearchEntityMapper refactoring.
Original PR: #309
2019-10-01 20:11:06 +02:00
Peter-Josef Meisch
7a4aebf9f4 DATAES-651 - Fix regression from escaping query parameters.
Original PR: #321
2019-10-01 20:04:29 +02:00
Peter-Josef Meisch
5364642c84 DATAES-213 - Polishing. 2019-10-01 20:04:29 +02:00
JBodkin
0b062a4a52 DATAES-213 - Escape text in queries.
Original PR:  #318
2019-10-01 20:04:29 +02:00
Peter-Josef Meisch
40d0ec2801 DATAES-647 - Polishing. 2019-10-01 20:04:29 +02:00
rasmusfaber
486a112046 DATAES-647: Use terms-query instead of multiple should-queries for In and NotIn.
Original PR: #315
2019-10-01 20:04:29 +02:00
Mark Paluch
5efe47f868 DATAES-646 - Adapt to Spring Framework 5.2 RC2.
Implement missing methods in RawActionResponse. Consistent versions actross netty dependencies.
2019-10-01 20:04:29 +02:00
Peter-Josef Meisch
f0117e7b6a DATAES-621 - Add missing fieldtypes and parameters to mapping.
Original PR: #311
2019-10-01 19:22:33 +02:00
Peter-Josef Meisch
490347f286 DATAES-290 - Make joda-time optional dependency.
Original PR: #308 and #213
2019-10-01 19:22:33 +02:00
Peter-Josef Meisch
d864ff1292 DATAES-176 - firstN repository queries.
Original PR: #305
2019-10-01 19:22:33 +02:00
Peter-Josef Meisch
b4ebca7ab5 DATAES-142 - AbstractRepository.saveAll can process empty list.
Original PR: #307
2019-10-01 19:22:33 +02:00
Peter-Josef Meisch
4bb7b5ef56 DATAES-495 - Deprecate TransportClient support.
Original PR: #306
2019-10-01 19:22:33 +02:00
P.J. Meisch
165e02d6e7 DATAES-639 - Polishing. 2019-10-01 19:19:21 +02:00
Xiao Yu
a9c3058bef DATAES-639 - Add ignore_above mapping parameter support.
Original pull request: #304.
2019-10-01 19:19:21 +02:00
P.J. Meisch
2712a1e021 DATAES-628 - documentation, assertions, ES7 adaption. 2019-10-01 19:19:21 +02:00
Mark Paluch
ba2d8594a1 Update src/main/java/org/springframework/data/elasticsearch/core/DocumentAdapters.java
Co-Authored-By: Peter-Josef Meisch <pj.meisch@sothawo.com>
2019-10-01 19:19:21 +02:00
Mark Paluch
7a612f3ba8 DATAES-628 - Adapt mappers to Document API. 2019-10-01 19:19:21 +02:00
Mark Paluch
29ecd484c5 DATAES-628 - Introduce Document API.
We now expose a Document API to encapsulate data interchanged with Elasticsearch (get responses, search hits, arbitrary maps) for a consistent API.
2019-10-01 19:19:21 +02:00
Peter-Josef Meisch
ce686b1f03 DATAES-637 - Change branch 4.0. to use Elasticsearch 7.3.
Original PR: #302
2019-10-01 19:19:20 +02:00
P.J. Meisch
9cb9c72acc DATAES-638 - Polishing. 2019-10-01 19:17:12 +02:00
Xiao Yu
1e96f7f3b4 DATAES-638 - Remove redundant public modifiers in @MultiField.
Original PR: #303
2019-10-01 19:17:12 +02:00
Christoph Strobl
7725689606 DATAES-635 - Create branch 4.0.x and integrate the changes from the existing 4.x branch. 2019-10-01 19:17:12 +02:00
Mark Paluch
84380cef0b DATAES-665 - Fix plugin ordering to deploy Javadoc. 2019-10-01 08:38:48 +02:00
Mark Paluch
be1a81e40f DATAES-625 - After release cleanups. 2019-09-30 16:17:29 +02:00
Mark Paluch
4bc5189092 DATAES-625 - Prepare next development iteration. 2019-09-30 16:17:28 +02:00
Mark Paluch
ab4fd17520 DATAES-625 - Release version 3.2 GA (Moore). 2019-09-30 15:51:08 +02:00
Mark Paluch
6045f1e0e3 DATAES-625 - Prepare 3.2 GA (Moore). 2019-09-30 15:50:44 +02:00
Mark Paluch
102d7370bd DATAES-625 - Updated changelog. 2019-09-30 15:50:42 +02:00
Mark Paluch
e22ba228a9 DATAES-624 - Updated changelog. 2019-09-30 11:16:16 +02:00
Peter-Josef Meisch
52105fcdcc DATAES-227 - Polishing. 2019-09-27 21:35:28 +02:00
Sascha Woo
8a1242fdbd DATAES-227 - prepareUpdate does not consider UpdateRequest options.
Original PR: #327
2019-09-27 21:22:20 +02:00
xhaggi
5f78ab8e25 DATAES-657 - Sort by _score not supported by ElasticsearchRestTemplate.
Original pull request: #325
2019-09-24 10:52:57 +02:00
Sascha Woo
0899df94eb DATAES-541 - Removing an alias with ElasticseachRestTemplate does not work properly.
Original PR: #324
2019-09-23 20:10:12 +02:00
P.J. Meisch
327e0a207c DATAES-652 - Polishing. 2019-09-20 12:11:14 +02:00
Roman Puchkovskiy
8d044fe3d1 DATAES-652 - Send if_seq_no and if_primary_term parameters when index…
...ing via ReactiveElasticsearchClient

Original PR: #322
2019-09-20 12:05:06 +02:00
xhaggi
642d95b5d1 DATAES-305 - Allow to put mapping built from entity class to different index.
Original pull request: #319
2019-09-13 08:23:42 +02:00
Oliver Drotbohm
6092da6fe7 DATAES-648 - Unified version compatibility matrix into reference docs.
Added information about which Boot version uses which Spring Data Elasticsearch version as well as hints about which versions are still under active maintenance.

Tweaked the readme to rather point to the reference documentation. This needs to be updated to point to the "current" alias once we've reached GA.

Original pull request: #317.
2019-09-11 20:31:23 +02:00
Mark Paluch
4773da32ab
DATAES-497 - Polishing.
Fix compatibility matrix in readme.
2019-09-10 11:57:38 +02:00
Mark Paluch
642e42e01e DATAES-626 - After release cleanups. 2019-09-06 10:21:56 +02:00
Mark Paluch
0820ede014 DATAES-626 - Prepare next development iteration. 2019-09-06 10:21:54 +02:00
Mark Paluch
fb49aaa2d6 DATAES-626 - Release version 3.2 RC3 (Moore). 2019-09-06 10:10:42 +02:00
Mark Paluch
c67b3082cb DATAES-626 - Prepare 3.2 RC3 (Moore). 2019-09-06 10:10:12 +02:00
Mark Paluch
0784cc7226 DATAES-626 - Updated changelog. 2019-09-06 10:10:11 +02:00
P.J. Meisch
2ce1bddce9 DATAES-645 - Polishing. 2019-09-04 22:23:46 +02:00
Gyula Csörögi
48d2cd1461 DATAES-645 Fix missing highlight setting in scroll queries.
Original PR: #312
2019-09-04 22:20:04 +02:00
Mark Paluch
bdee49f815 DATAES-646 - Adapt to Spring Framework 5.2 RC2.
Un-implement ClientResponse from RawActionResponse to not require us updating the code whenever ClientResponse introduces new methods. Retain only methods from ClientResponse that are actually used.

Consistent versions actross netty dependencies.
2019-09-04 14:48:11 +02:00
Mark Paluch
aae7734bc0 DATAES-646 - Adapt to Spring Framework 5.2 RC2.
Implement missing methods in RawActionResponse. Consistent versions actross netty dependencies.
2019-09-04 12:13:01 +02:00
Mathias Teier
054c02bd41 DATAES-643: Added searchType to prepareSearch() in RestTemplate (#310)
Original PR: #310
2019-08-27 12:11:46 +02:00
Mohsin Husen
4798136074
DATAES-589 - change spring data example link 2019-08-14 15:24:08 +01:00
Mark Paluch
389a5bc5e7 DATAES-627 - Polishing.
Reinstantiate schema links for Elasticsearch 1.0 XSD.
2019-08-07 08:03:01 +02:00
Mark Paluch
fea26b5751 DATAES-627 - Add HTTPS entries into spring.schemas.
To resolve XSD files properly from the classpath, their HTTPS reference must be present in the spring.schemas to avoid internet interaction for resolving an XSD file.
2019-08-07 08:01:11 +02:00
Greg Turnquist
fd7a380edd
DATAES-583 - Force check for updates. 2019-08-05 10:21:32 -05:00
Mark Paluch
ff021c1319 DATAES-591 - After release cleanups. 2019-08-05 15:53:03 +02:00
Mark Paluch
ae38eab00d DATAES-591 - Prepare next development iteration. 2019-08-05 15:53:02 +02:00
Mark Paluch
61f4581dc4 DATAES-591 - Release version 3.2 RC2 (Moore). 2019-08-05 15:35:35 +02:00
Mark Paluch
11c1381f6c DATAES-591 - Prepare 3.2 RC2 (Moore). 2019-08-05 15:35:05 +02:00
Mark Paluch
8d37e4c8e4 DATAES-591 - Updated changelog. 2019-08-05 15:35:03 +02:00
Mark Paluch
a83073f3ee DATAES-590 - Updated changelog. 2019-08-05 11:34:27 +02:00
Mark Paluch
e47d7525c5 DATAES-581 - Updated changelog. 2019-08-05 11:08:58 +02:00
Peter-Josef Meisch
530a1f8a4b
DATAES-405 - use org.springframework.lang.Nullable.
Original PR: #300
2019-07-31 22:19:30 +02:00
Peter-Josef Meisch
9e93dd08aa
DATES-615 - Use annotated field name on repository order by clause.
Original PR: #298
2019-07-30 12:40:31 +02:00
Mark Paluch
d1aa604fe5 DATAES-619 - Polishing.
Use consistently SpringRunner.
2019-07-29 15:53:37 +02:00
Mark Paluch
2c4ca358f3 DATAES-619 - Migrate remaining tests to AssertJ. 2019-07-29 15:48:09 +02:00
Mark Paluch
e23f6f1d33 DATAES-603 - Polishing.
Add nullable annotations to nullable properties in BulkOptions. Add assertions to non-nullable method arguments. Reformat code. Make methods static where possible.

Original pull request: #296.
2019-07-26 12:03:47 +02:00
P.J.Meisch
8c7d5d47b1 DATAES-603 - Add support for bulk options in Elasticsearch-Template classes.
Original pull request: #296.
2019-07-26 12:03:29 +02:00
Mark Paluch
4c743ee5b9 DATAES-616 - Polishing.
Remove superfluous SuppressWarnings. Add Javadoc override for consistency.
2019-07-26 09:29:19 +02:00
Peter-Josef Meisch
085dd9ad95
DATAES-616 - Fix implementations of ParameterAccessor interface.
Original PR: #297
2019-07-26 00:03:07 +02:00
Greg Turnquist
63172b8a69
DATAES-583 - Publish documentation for main branch. 2019-07-19 11:59:52 -05:00
P.J.Meisch
ccfade12b0 DATAES-611 - Adapt to API changes in Spring Webflux.
Original pull request: #295.
2019-07-16 09:55:12 +02:00
Mark Paluch
cf7fc61f7b DATAES-607 - Polishing.
Ensure copying HttpHeaders before using these as default to prevent modifications of the original object. Adapt tests. Reuse header constants.

Original pull request: #293.
2019-07-16 09:49:01 +02:00
Mark Paluch
c8c3cb7909 DATAES-497 - Polishing.
Consistently add anchors to headings. Tiny syntax tweaks. Remove superfluous newlines.

Original pull request: #291.
2019-07-16 09:32:54 +02:00
P.J.Meisch
ef01211639 DATAES-497 - Update reference documentation.
Original pull request: #291.
2019-07-16 09:32:47 +02:00
Peter-Josef Meisch
4816902f9c
DATAES-610 - Clarify inclusion of rc and snapshot builds in readme.adoc.
Original PR: #294
2019-07-15 20:48:29 +02:00
Peter-Josef Meisch
eec55e273e
DATAES-607 - Client-security-configuration.
Original PR: #293
2019-07-13 10:33:23 +02:00
Johnny Lim
f5b4722b6b DATAES-609 - Fix TransportClientFactoryBean.isSingleton().
Original PR: #153
2019-07-12 19:42:55 +02:00
P.J.Meisch
a9d57936c3 DATAES-606 - update 3.2.x to use ES 6.8.1. 2019-07-10 23:30:03 +02:00
P.J.Meisch
45015cd7ee DATAES-605 - Polishing. 2019-07-10 22:55:43 +02:00
rasmusfaber
216fc89fd2 DATAES-605 - Make batch size for streamQuery configurable.
Original PR: #292
2019-07-10 22:42:14 +02:00
Mark Paluch
7fd9986c6e DATAES-604 - Fix typo. 2019-07-10 09:57:46 +02:00
Mark Paluch
305f207731 DATAES-583 - Cleanup release profile.
Reuse inherited configuration from parent pom.
2019-07-09 12:11:12 +02:00
Mark Paluch
ed666823a4 DATAES-604 - Revise readme for a consistent structure. 2019-07-09 12:11:12 +02:00
Tony Zeng
8dd2f47b7c DATAES-415 - More Field Types Support.
Original PR: #193
2019-07-04 21:29:43 +02:00
Greg Turnquist
1e4dcdff7c
DATAES-583 - Use labeled agents for CI jobs. 2019-07-03 14:15:43 -05:00
Greg Turnquist
802c91f324
DATAES-583 - Use parent 'artifactory' profile to release snapshots. 2019-07-03 12:41:31 -05:00
Greg Turnquist
18ae3e194a
DATAES-583 - Only build main branch when triggered upstream. 2019-06-28 16:33:55 -05:00
Oliver Drotbohm
e3003f3268
DATAES-601 - Fixed NoHTTP errors. 2019-06-27 15:54:04 +02:00
P.J.Meisch
03567d4281 DATAES-456 - Polishing. 2019-06-27 08:10:05 +02:00
Sylvain LAURENT
bf4948239e DATAES-456 - re-enable dynamic index name evaluation.
Original PR: #221
2019-06-27 07:55:21 +02:00
P.J.Meisch
57ba74e543 DATAES-593 - Polishing. 2019-06-24 20:37:57 +02:00
Greg Turnquist
6567d17f23
DATAES-583 - Configure user.name and user.home for CI jobs. 2019-06-24 13:26:56 -05:00
Martin Choraine
0d1c57a874 DATAES-593 - Add support for field collapse function.
Original PR: #290
2019-06-24 20:18:38 +02:00
P.J.Meisch
f1aa75a94f DATAES-595 - Polishing. 2019-06-21 22:51:15 +02:00
Azaza
40ea40a763 DATAES-595 - Support for setting preference parameter in query.
Original PR: #288
2019-06-21 22:41:40 +02:00
quxinyong
7ea0a43162 DATAES-598: Add Elasticsearch authentication code example to readme.
Original PR: #289
2019-06-21 22:19:35 +02:00
P.J.Meisch
6a3042c437 DATAES-594 - Polishing. 2019-06-20 12:11:19 +02:00
murali_ch
d22b12874d DATAES-594 Added support for index without refresh.
Original PR: #286
2019-06-20 11:57:42 +02:00
Johnny Lim
9a6172b4fe DATAES-597- Fix code formatting in readme.
Original PR: #111
2019-06-19 10:03:53 +02:00
Roman Puchkovskiy
159489c7da DATAES-596 - Fix usage of deprecated Rest(HighLevel)Client API. (#287)
Switch to methods taking RequestOptions as they are more universal
Original-PR: #287
2019-06-19 09:12:35 +02:00
Mark Paluch
24b0f09323 DATAES-592 - Integrate nohttp tooling into CI build profile. 2019-06-18 10:36:49 +02:00
Christoph Strobl
00d6ff90ea DATAES-560 - After release cleanups. 2019-06-14 15:12:53 +02:00
Christoph Strobl
8bd2e8aacf DATAES-560 - Prepare next development iteration. 2019-06-14 15:12:51 +02:00
Christoph Strobl
6bf091be68 DATAES-560 - Release version 3.2 RC1 (Moore). 2019-06-14 14:44:26 +02:00
Christoph Strobl
3b8ccff089 DATAES-560 - Prepare 3.2 RC1 (Moore). 2019-06-14 14:43:17 +02:00
Christoph Strobl
cd428b28a7 DATAES-560 - Updated changelog. 2019-06-14 14:43:16 +02:00
Christoph Strobl
d7b7e1f7dd DATAES-580 - Updated changelog. 2019-06-14 13:27:17 +02:00
Peter-Josef Meisch
2194096ad8
DATAES-589 - Improve readme file.
Original PR: #285, contains change from #268
2019-06-11 22:46:44 +02:00
Mark Paluch
42803ebd55 DATAES-586 - Create security policy readme. 2019-05-31 16:11:21 +02:00
Mark Paluch
92433b79aa DATAES-579 - Reformat test sources.
Original pull request: #283.
2019-05-31 11:46:32 +02:00
Mark Paluch
198ad0e02b DATAES-579 - Polishing.
Use Lombok's Data where possible. Extract duplicate code into ResourceUtil and StreamQueries. Generalize multiGet to return List instead of LinkedList. Reorder methods.

Reduce properties usage by removing unused properties from test entities.

Remove final keyword usage in methods. Formatting.

Original pull request: #283.
2019-05-31 11:46:29 +02:00
P.J.Meisch
4c206f7de5 DATAES-579 - Test code cleanup.
Original pull request: #283.
2019-05-31 11:46:22 +02:00
Greg Turnquist
287aa45b98
DATAES-583 - Introduce Jenkins. 2019-05-28 15:02:29 -05:00
Mark Paluch
14a7ad03bd DATAES-578 - Updated changelog. 2019-05-13 18:19:11 +02:00
Mark Paluch
e577a80811 DATAES-577 - Updated changelog. 2019-05-13 14:59:29 +02:00
Mark Paluch
efbc0d97f2 DATAES-564 - After release cleanups. 2019-05-13 12:17:54 +02:00
Mark Paluch
7f7364054a DATAES-564 - Prepare next development iteration. 2019-05-13 12:17:53 +02:00
Mark Paluch
8dc8428abd DATAES-564 - Release version 3.2 M4 (Moore). 2019-05-13 11:59:50 +02:00
Mark Paluch
aba55b1d67 DATAES-564 - Prepare 3.2 M4 (Moore). 2019-05-13 11:59:04 +02:00
Mark Paluch
e66dac0cb1 DATAES-564 - Updated changelog. 2019-05-13 11:59:02 +02:00
Oliver Drotbohm
e9197b2c2e DATAES-555 - Updated changelog. 2019-05-10 14:18:14 +02:00
Oliver Drotbohm
04b3e468e6 DATAES-557 - Updated changelog. 2019-05-10 12:57:28 +02:00
Mark Paluch
9a867fb35f DATAES-575 - Polishing.
Remove unused OSGi manifest template.
2019-05-07 16:51:15 +02:00
Mark Paluch
36f90a15cb DATAES-575 - Upgrade to Elasticsearch 6.7.2. 2019-05-07 16:45:40 +02:00
Mark Paluch
7e56c3f9f9 DATAES-569 - Polishing.
Slightly tweak javadoc. Tweak StepVerifier usage. Add missing assertion. Fix generics.

Original pull request: #277.
2019-05-07 16:45:15 +02:00
Christoph Strobl
2e709a72b7 DATAES-569 - Add index operations to reactive client.
Original pull request: #277.
2019-05-07 16:45:08 +02:00
Mark Paluch
807cfe78bc DATAES-576 - Fix CustomMethodRepositoryRestTests.
Register custom template bean as workaround to delete the index before repository bootstrapping.
2019-05-06 21:59:36 +02:00
Mark Paluch
1f04e6453c DATAES-576 - Fix ElasticsearchTemplateTests.
We now delete documents with a type query instead of a term query. Also, added index cleanup to ReactiveElasticsearchTemplateTests.
2019-05-06 21:21:16 +02:00
Mark Paluch
b6fa4c8a74 DATAES-568 - Polishing.
Add package-info and nullability annotations to org.springframework.data.elasticsearch.core.mapping.
Extract method to avoid excessive nesting.

Add ticket references/convert old references to test methods. Move test models to inner classes. Use static imports for JSON Assert. Formatting.

Original pull request: #281.
2019-05-06 20:00:24 +02:00
P.J. Meisch
66b77ecb75 DATAES-568 - MappingBuilder must use the @Field annotation's name attribute.
Original pull request: #281.
2019-05-06 15:59:01 +02:00
xhaggi
e5c514e385 DATAES-570 - Use Delete By Query API for delete by query operations.
Original pull request: #280
2019-04-29 11:37:57 +02:00
Dmitriy Yakovlev
be34ff8703 DATAES-459 - Return ScrolledPage instead of Page while using startScroll and continueScroll methods.
Original pull request: #274
2019-04-26 14:47:58 +02:00
xhaggi
9abe0f28c5 DATAES-572 - Indices created in ElasticsearchTemplateTests are retained after tests.
Original pull request: #279
2019-04-26 10:22:25 +02:00
Christoph Strobl
b60c9af35c DATAES-565 - Alter test setup to assure a clean start.
Make sure required resources are cleaned before running tests. Some leftovers from other tests may still be lingering around and we need to get rid of those.
2019-04-25 13:25:52 +02:00
Dmitriy Yakovlev
eb15c114b8 DATAES-457 - ElasticsearchTemplate.prepareScroll() does not add sorting.
Original pull request: #273
2019-04-24 15:39:19 +02:00
Dmitriy Yakovlev
4ab8af5116 DATAES-566 - Eliminate double SearchHit source to string conversion in DefaultResultMapper.
Original pull request: #275
2019-04-24 15:30:27 +02:00
P.J.Meisch
e7857e874f DATAES-562 - Custom name attribute for @Field mapping in ElasticsearchEntityMapper.
Original pull request: #270
2019-04-24 15:19:55 +02:00
Mark Paluch
17d9022181 DATAES-563 - Polishing.
Merge test methods. Add author name. Formatting, javadoc.

Original pull request: #271.
2019-04-23 16:05:39 +02:00
P.J. Meisch
deefeb462e DATAES-563 - Add elasticsearchTemplate bean alias to AbstractElasticsearchConfiguration.
We now register ElasticsearchOperations through AbstractElasticsearchConfiguration with an additional bean alias to retain compatibility with existing code and to not require additional configuration when using @EnableElasticsearchRepositories.

EnableElasticsearchRepositories defaults to a bean named elasticsearchTemplate while AbstractElasticsearchConfiguration exposed the template bean named elasticsearchOperations.

Original pull request: #271.
2019-04-23 16:02:37 +02:00
Dmitriy Yakovlev
f0ae72141f DATAES-565 - prepareScroll doesn't respect SourceFilter from the Query.
Original pull request: #272
2019-04-18 12:46:31 +02:00
Dimitri
7e0d0ea2c0 DATAES-546 - Escaped double quotes in code snippet.
Original pull request: #246
2019-04-17 10:16:37 +02:00
P.J. Meisch
676567910d DATAES-561 - Reuse ObjectMapper in ElasticsearchEntityMapper
Original pull request: #269
2019-04-17 09:40:43 +02:00
Christoph Strobl
dff7d4e11b DATAES-542 - After release cleanups. 2019-04-11 12:00:21 +02:00
Christoph Strobl
5c9fea307b DATAES-542 - Prepare next development iteration. 2019-04-11 12:00:20 +02:00
Christoph Strobl
2f2aa263fe DATAES-542 - Release version 3.2 M3 (Moore). 2019-04-11 11:24:32 +02:00
Christoph Strobl
6d980cb767 DATAES-542 - Prepare 3.2 M3 (Moore). 2019-04-11 11:23:56 +02:00
Christoph Strobl
f5b29aeba7 DATAES-542 - Updated changelog. 2019-04-11 11:23:55 +02:00
Jens Schauder
0ccc54da34 DATAES-558 - Upgrade Elastic Search version to 6.6.2. 2019-04-11 11:07:07 +02:00
Christoph Strobl
3ea7dea5cb DATAES-552 - Polishing.
Update lookup to replace all matches & add some tests.

Original Pull Request: #267
2019-04-10 10:20:12 +02:00
Taylor
b93bd07a3a DATAES-552 - @Query annotation fail when passing over 10 parameters
Updated the replacePlaceholders methods to use replaceFirst to prevent duplication substitutions.

Original Pull Request: #267
2019-04-10 10:19:25 +02:00
Christoph Strobl
16bf8450f0 DATAES-547 - Polishing.
Add test and directly use SearchHit to pass on the index name.
Fix minor flaw in Exception translation for non existing indices along the way.

Original Pull Request: #257
2019-04-09 15:40:49 +02:00
Spyna
082988955b DATAES-547 - ElasticSearchTemplate.delete(DeleteQuery, Class) does not delete documents.
Original Pull Request: #257
2019-04-09 15:40:34 +02:00
Oliver Drotbohm
3b99aa04ef DATAES-538 - Updated changelog. 2019-04-01 20:56:32 +02:00
Oliver Drotbohm
18910f457a DATAES-528 - Updated changelog. 2019-04-01 19:37:03 +02:00
Oliver Drotbohm
e4825d52a7 DATAES-554 - Updated changelog. 2019-04-01 18:52:21 +02:00
Oliver Drotbohm
27b33e019e DATAES-527 - Updated changelog. 2019-04-01 18:49:24 +02:00
Spring Operator
9818ed0af9 DATAES-549 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 317 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).

Original Pull Request: #266
2019-03-22 08:20:19 +01:00
Spring Operator
cacab0a478 DATAES-549 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* [ ] http://www.elasticsearch.org/ (301) with 1 occurrences migrated to:
  https://www.elastic.co/ ([https](https://www.elasticsearch.org/) result SSLHandshakeException).
* [ ] http://www.elasticsearch.org/download/ (301) with 1 occurrences migrated to:
  https://www.elastic.co/downloads/elasticsearch ([https](https://www.elasticsearch.org/download/) result SSLHandshakeException).
* [ ] http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html (301) with 2 occurrences migrated to:
  https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-completion.html ([https](https://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html) result SSLHandshakeException).
* [ ] http://www.elasticsearch.org/guide/reference/mapping/date-format/ (301) with 1 occurrences migrated to:
  https://www.elastic.co/guide/reference/mapping/date-format/ ([https](https://www.elasticsearch.org/guide/reference/mapping/date-format/) result SSLHandshakeException).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://asciidoctor.org with 1 occurrences migrated to:
  https://asciidoctor.org ([https](https://asciidoctor.org) result 200).
* [ ] http://stackoverflow.com/questions/tagged/spring-data-elasticsearch with 1 occurrences migrated to:
  https://stackoverflow.com/questions/tagged/spring-data-elasticsearch ([https](https://stackoverflow.com/questions/tagged/spring-data-elasticsearch) result 200).
* [ ] http://www.springframework.org/schema/beans/spring-beans.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* [ ] http://www.springframework.org/schema/data/repository/spring-repository.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/data/repository/spring-repository.xsd ([https](https://www.springframework.org/schema/data/repository/spring-repository.xsd) result 200).
* [ ] http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* [ ] http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* [ ] http://docs.spring.io/spring-data/elasticsearch/docs/current/api/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-data/elasticsearch/docs/current/api/ ([https](https://docs.spring.io/spring-data/elasticsearch/docs/current/api/) result 301).
* [ ] http://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/ ([https](https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/) result 301).
* [ ] http://help.github.com/forking/ with 1 occurrences migrated to:
  https://help.github.com/forking/ ([https](https://help.github.com/forking/) result 301).
* [ ] http://projects.spring.io/spring-data with 1 occurrences migrated to:
  https://projects.spring.io/spring-data ([https](https://projects.spring.io/spring-data) result 301).
* [ ] http://www.springframework.org/schema/beans/spring-beans-3.1.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-3.1.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-3.1.xsd) result 301).
* [ ] http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd ([https](https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd) result 301).
* [ ] http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd ([https](https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd) result 301).
* [ ] http://repo.spring.io/libs-snapshot with 1 occurrences migrated to:
  https://repo.spring.io/libs-snapshot ([https](https://repo.spring.io/libs-snapshot) result 302).
* [ ] http://www.springsource.org/download with 1 occurrences migrated to:
  https://www.springsource.org/download ([https](https://www.springsource.org/download) result 302).
* [ ] http://www.springsource.org/node/feed with 1 occurrences migrated to:
  https://www.springsource.org/node/feed ([https](https://www.springsource.org/node/feed) result 302).

# Ignored
These URLs were intentionally ignored.

* http://127.0.0.1:9200 with 1 occurrences
* http://localhost:9200 with 3 occurrences
* http://www.springframework.org/schema/beans with 14 occurrences
* http://www.springframework.org/schema/data/elasticsearch with 14 occurrences
* http://www.springframework.org/schema/data/repository with 4 occurrences
* http://www.springframework.org/schema/tool with 4 occurrences
* http://www.w3.org/2001/XMLSchema with 2 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 5 occurrences

Original Pull Request: #259
2019-03-21 08:00:05 +01:00
Spring Operator
75b039a477 DATAES-549 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://maven.apache.org/xsd/maven-4.0.0.xsd with 1 occurrences migrated to:
  https://maven.apache.org/xsd/maven-4.0.0.xsd ([https](https://maven.apache.org/xsd/maven-4.0.0.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-3.1.xsd with 19 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-3.1.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-3.1.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd with 20 occurrences migrated to:
  https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd ([https](https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd) result 200).
* http://java.sun.com/xml/ns/javaee/beans_1_0.xsd with 1 occurrences migrated to:
  https://java.sun.com/xml/ns/javaee/beans_1_0.xsd ([https](https://java.sun.com/xml/ns/javaee/beans_1_0.xsd) result 302).

# Ignored
These URLs were intentionally ignored.

* http://java.sun.com/xml/ns/javaee with 2 occurrences
* http://maven.apache.org/POM/4.0.0 with 2 occurrences
* http://www.springframework.org/schema/beans with 44 occurrences
* http://www.springframework.org/schema/data/elasticsearch with 40 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 24 occurrences

Original Pull Request: #258
2019-03-20 12:38:23 +01:00
Spring Operator
3b834b6c60 DATAES-549 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were fixed successfully.

* http://www.apache.org/licenses/LICENSE-2.0 migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
* http://www.pivotal.io migrated to:
  https://www.pivotal.io ([https](https://www.pivotal.io) result 301).

# Ignored
These URLs were intentionally ignored.

* http://maven.apache.org/POM/4.0.0
* http://maven.apache.org/xsd/maven-4.0.0.xsd
* http://www.w3.org/2001/XMLSchema-instance

Original pull request: #244
2019-03-19 13:04:32 -05:00
Oliver Drotbohm
13d369de20
DATAES-545 - Move off deprecations in Spring Data Commons.
Related ticket: DATACMNS-1496.
2019-03-13 19:20:40 +01:00
Petr Kukrál
11ba4c55ad DATAES-535 - Add mapping annotation @DynamicTemplates.
Original pull request: #238
2019-03-13 14:16:12 +01:00
xhaggi
efb5d9e021 DATAES-536 - Polishing
* remove unused field xContentBuilder
* add missing generics
* add XContentType to rawValue
* organize imports
2019-03-13 13:46:13 +01:00
Robert Gründler
092690d1b9 DATAES-536 - Add support for context suggester
Original pull request: #241
2019-03-13 10:27:11 +01:00
Christoph Strobl
16f2139742 DATAES-517 - After release cleanups. 2019-03-07 10:07:30 +01:00
Christoph Strobl
437f2e9cde DATAES-517 - Prepare next development iteration. 2019-03-07 10:07:29 +01:00
Christoph Strobl
0060f3d6f3 DATAES-517 - Release version 3.2 M2 (Moore). 2019-03-07 09:42:22 +01:00
Christoph Strobl
76df6c10fc DATAES-517 - Prepare 3.2 M2 (Moore). 2019-03-07 09:41:17 +01:00
Christoph Strobl
b2e2160b45 DATAES-517 - Updated changelog. 2019-03-07 09:41:16 +01:00
Mark Paluch
c3e7056d7b DATAES-530 - Polishing.
Fix generics in ElasticsearchEntityMapper. Extract methods. Move enum conversion handling to simple type handling for symmetric implementation. Swap comparison of nullable types to avoid potential null dereference.

Rename ElasticsearchDefaultTypeMapper to DefaultElasticsearchTypeMapper. Move MapTypeAliasAccessor to DefaultElasticsearchTypeMapper.

Introduce SearchResultMapperAdapter to avoid empty method implementations in anonymous classes. Javadoc, reference docs, formatting.

Original Pull Request: #237
2019-03-06 10:03:02 +01:00
Christoph Strobl
a64af54e26 DATAES-530 - Add converter based EntityMapper.
ElasticsearchEntityMapper provides an alternative to the Jackson based EntityMapper implementation.

Original Pull Request: #237
2019-03-06 10:02:13 +01:00
Mark Paluch
1dc113d57b DATAES-537 - Upgrade to Elasticsearch 6.6.1.
Adapt tests to use new IndicesOptions defaults.

Original Pull Request: #243
2019-03-06 09:29:37 +01:00
Greg Turnquist
e81e38dbb1
DATAES-526 - Introduce Concourse. 2019-02-28 10:41:05 -06:00
Peter Nowak
e0831fa234 DATAES-525 - Fixed issue in scrolling not applying the search query.
The root cause of the deletion problem was the doScroll which did not apply the given query and therefor returned all entries from the index.
The doScroll implementation has been fixed to apply the query and multiple unit tests have been added to ensure that the delete methods delete the desired documents only and leave the rest untouched.
Also added unit tests for the scrolling to test it against real queries (not only matchAll).

Original pull request: #240
2019-02-21 08:27:30 +01:00
Ivan Greene
c77b543fb8 DATAES-523 - Allow specifying version type.
Allow specifying the version type for documents.

Original pull request: #236
2019-02-21 08:24:29 +01:00
Mark Paluch
ae1accd13b DATAES-529 - Updated changelog. 2019-02-13 11:47:59 +01:00
lw
4bef221217 DATAES-500 - queryForList(CriteriaQuery query, Class<T> clazz) can't query all data.
Original pull request: #225
2019-01-24 17:56:19 +01:00
Peter Nowak
a89a44b08f DATAES-531 - Fixed getMapping from ElasticsearchRestTemplate.
The getMapping methods in the ElasticsearchRestTemplate now behave like the methods in the ElasticsearchTemplate and return the mapping for the specified index and type.

Original pull request: #239
2019-01-24 17:24:38 +01:00
Christoph Strobl
69dc36c6c3 DATAES-519 - Add reactive repository support.
Reactive Elasticsearch repository support builds on the core repository support utilizing
operations provided via ReactiveElasticsearchOperations executed by a ReactiveElasticsearchClient.

Spring Data Elasticsearchs reactive repository support uses Project Reactor as its reactive
composition library of choice.

There are 3 main interfaces to be used:

* ReactiveRepository
* ReactiveCrudRepository
* ReactiveSortingRepository

For Java configuration, use the @EnableReactiveElasticsearchRepositories annotation.
The following listing shows how to use Java configuration for a repository:

@Configuration
@EnableReactiveElasticsearchRepositories
public class Config extends AbstractReactiveElasticsearchConfiguration {

  @Override
  public ReactiveElasticsearchClient reactiveElasticsearchClient() {
    return ReactiveRestClients.create(ClientConfiguration.localhost());
  }
}

Using a repository that extends ReactiveSortingRepository makes all CRUD operations available
as well as methods for sorted access to the entities. Working with the repository instance is a matter of dependency
injecting it into a client.

The repository itself allows defining additional methods backed by the inferred proxy.

public interface ReactivePersonRepository extends ReactiveSortingRepository<Person, String> {

  Flux<Person> findByFirstname(String firstname);

  Flux<Person> findByFirstname(Publisher<String> firstname);

  Flux<Person> findByFirstnameOrderByLastname(String firstname);

  Flux<Person> findByFirstname(String firstname, Sort sort);

  Flux<Person> findByFirstname(String firstname, Pageable page);

  Mono<Person> findByFirstnameAndLastname(String firstname, String lastname);

  Mono<Person> findFirstByLastname(String lastname);

  @Query("{ \"bool\" : { \"must\" : { \"term\" : { \"lastname\" : \"?0\" } } } }")
  Flux<Person> findByLastname(String lastname);

  Mono<Long> countByFirstname(String firstname)

  Mono<Boolean> existsByFirstname(String firstname)

  Mono<Long> deleteByFirstname(String firstname)
}

Original Pull Request: #235
2019-01-23 13:54:44 +01:00
Mark Paluch
21a010c65a DATAES-507 - Updated changelog. 2019-01-10 14:15:44 +01:00
Mark Paluch
5ff782ed42 DATAES-506 - Updated changelog. 2019-01-10 12:26:37 +01:00
Mark Paluch
9c4247c47c DATAES-505 - Updated changelog. 2019-01-10 11:01:22 +01:00
Mark Paluch
f3fb779923 DATAES-524 - Update copyright years to 2019. 2019-01-02 12:36:07 +01:00
zzt
e264bd7f84 DATAES-487 - Support for multi search API. 2018-12-21 15:26:14 +00:00
xhaggi
5ff6238399 DATAES-521 - Remove id-type specific repository implementations. 2018-12-19 16:27:16 +01:00
Mark Paluch
3abc3ab13b DATAES-518 - Polishing.
Extract variable.

Original pull request: #233.
2018-12-14 09:43:32 +01:00
Christoph Strobl
a1c139445f DATAES-518 - Use scroll for unpaged find operations in ReactiveElasticsearchTemplate.
We now use scroll instead of a max page size for unpaged queries.

Original pull request: #233.
2018-12-14 09:43:25 +01:00
Christoph Strobl
fae1125e2f DATAES-513 - After release cleanups. 2018-12-11 11:07:53 +01:00
Christoph Strobl
c2f0b5abef DATAES-513 - Prepare next development iteration. 2018-12-11 11:07:52 +01:00
Christoph Strobl
dda137989a DATAES-513 - Release version 3.2 M1 (Moore). 2018-12-11 10:53:53 +01:00
Christoph Strobl
912ed1a8ee DATAES-513 - Prepare 3.2 M1 (Moore). 2018-12-11 10:53:11 +01:00
Christoph Strobl
c5acf161a0 DATAES-513 - Updated changelog. 2018-12-11 10:53:10 +01:00
Christoph Strobl
12b91885bc DATAES-516 - Add profile for release. 2018-12-11 10:49:12 +01:00
Christoph Strobl
a2fad72e86 DATAES-515 - Revert override of Elasticsearch's JarHell for tests.
This reverts commit 25b02f29a741aa659cb8e49ce1d4c85e43c72e84 as the upgrade to Elasticsearch 6.5 made the changes obsolete.
2018-12-11 08:28:03 +01:00
Christoph Strobl
d8f43d3297 DATAES-512 - Polishing.
Update Javadoc and Readme to reflect recent back ports.
2018-12-11 08:27:44 +01:00
Christoph Strobl
a3a46b2e11 DATAES-510 - Add tests for resource clean up.
Original Pull Request: #231
2018-12-11 07:17:10 +01:00
Mark Paluch
b50e60fdd1 DATAES-510 - Polishing.
Wrap Scroll execution with usingWhen and run cleanup through usingWhen callback to clean up scrolls state on success/on error/on cancellation.

Extract isEmpty(SearchHits) check into own method. Improve synchronization in ScrollState to prevent concurrent modification exceptions during read.

Original Pull Request: #231
2018-12-11 07:17:10 +01:00
Christoph Strobl
da9de6bc49 DATAES-510 - Add reactive scroll support.
The ReactiveElasticsearchClient now support scrolling through large result sets issuing subsequent _search/scroll requests while emitting data on the outbound channel. Resources bound via their scrollId get freed on completion of the flux.

Original Pull Request: #231
2018-12-11 07:17:10 +01:00
Christoph Strobl
ce124a2d9e DATAES-512 - Fix request parameters not getting added to the URI as query string parameters.
We now make sure to include request parameters in the constructed URI and add potential request option headers.
2018-12-11 07:17:10 +01:00
Christoph Strobl
1ea73d2fb9 DATAES-504 - Update documentation.
Update documentation to cover newly added configuration options for the ReactiveElasticsearchClient.
Make sure to apply postFilter correctly and set a default limit for unpaged search requests.

Also fix some code format issues.
2018-12-11 07:17:10 +01:00
Mark Paluch
2dcd1cfbad DATAES-504 - Add configuration options for logging and timeouts to ReactiveElasticsearchClient.
We now log HTTP requests and responses with the org.springframework.data.elasticsearch.client.WIRE logger for both, the HighLevelRestClient and our reactive client and associate a logging Id for improved traceability.

Configuration of connection/socket timeouts is now available via the ClientConfiguration.

Along the lines we also aligned entity handling to EntityOperations already common in other modules. EntityOperations centralizes how aspects of entities (versioning, retrieval of index name/index type) are handled.

Original Pull Request: #229
2018-12-11 07:17:10 +01:00
Christoph Strobl
ba890cb7eb DATAES-504 - Add ReactiveElasticsearchOperations & ReactiveElasticsearchTemplate
ReactiveElasticsearchOperations is the gateway to executing high level commands against an Elasticsearch cluster using the ReactiveElasticsearchClient.

The ReactiveElasticsearchTemplate is the default implementation of ReactiveElasticsearchOperations and offers the following set of features.

* Read/Write mapping support for domain types.
* A rich query and criteria api.
* Resource management and Exception translation.

To get started the ReactiveElasticsearchTemplate needs to know about the actual client to work with.
The easiest way of setting up the ReactiveElasticsearchTemplate is via AbstractReactiveElasticsearchConfiguration providing
dedicated configuration method hooks for base package, the initial entity set etc.

@Configuration
public class Config extends AbstractReactiveElasticsearchConfiguration {

    @Bean
    @Override
    public ReactiveElasticsearchClient reactiveElasticsearchClient() {
        // ...
    }
}

NOTE: If applicable set default HttpHeaders via the ClientConfiguration of the ReactiveElasticsearchClient.

TIP: If needed the ReactiveElasticsearchTemplate can be configured with default RefreshPolicy and IndicesOptions that get applied to the related requests by overriding the defaults of refreshPolicy() and indicesOptions().

The ReactiveElasticsearchTemplate lets you save, find and delete your domain objects and map those objects to documents stored in Elasticsearch.

@Document(indexName = "marvel", type = "characters")
public class Person {

    private @Id String id;
    private String name;
    private int age;

    // Getter/Setter omitted...
}

template.save(new Person("Bruce Banner", 42)) // save a new document
    .doOnNext(System.out::println)
    .flatMap(person -> template.findById(person.id, Person.class)) // then go find it
    .doOnNext(System.out::println)
    .flatMap(person -> template.delete(person)) // just to remove remove it again
    .doOnNext(System.out::println)
    .flatMap(id -> template.count(Person.class)) // so we've got nothing at the end
    .doOnNext(System.out::println)
    .subscribe(); // yeah :)

The above outputs the following sequence on the console.

> Person(id=QjWCWWcBXiLAnp77ksfR, name=Bruce Banner, age=42)
> Person(id=QjWCWWcBXiLAnp77ksfR, name=Bruce Banner, age=42)
> QjWCWWcBXiLAnp77ksfR
> 0

Original Pull Request: #229
2018-12-11 07:17:10 +01:00
Christoph Strobl
a39c34058b DATAES-488 - Polishing & Documentation.
Rename VerificationMode -> Verification. Reorder methods in ReactiveElasticsearchClient, add test for DefaultWebClientProvider. Enforce assertions and fix some overall code style issues.
Add client reference documentation section.
2018-12-11 07:17:10 +01:00
Mark Paluch
390d7e8273 DATAES-488 - Polishing.
Convert spaces to tabs for pom.xml. Switch reactive dependencies to optional. Remove unused commonscollections property. Use managed versions for reactor and Spring dependencies.

Introduce WebClientProvider to avoid reinstantiation of WebClient instances. Introduce ClientConfiguration to encapsulate common Elasticsearch client configuration properties. Split ElasticsearchClients into RestClients and ReactiveRestClients to avoid mandatory dependency on WebFlux/Project Reactor. Adapt tests and code referring to WebClient creation.

Extract response body as byte array instead of Flux of DataBuffer to avoid chunking and to parse an entire response.

Encapsulate hostAndPort string used across configuration/HostProvider with InetSocketAddress. Add parser for InetSocketAddress.

Original Pull Request: #226
2018-12-11 07:17:10 +01:00
Christoph Strobl
691a8c57bc DATAES-488 - Add reactive Elasticsearch client support.
Initial implementation of a ReactiveElasticsearchClient using WebClient to connect to cluster nodes.

ReactiveElasticsearchClient client = ElasticsearchClients.createClient()
  .connectedTo("http://localhost:9200", "http://localhost:9201")
  .reactive();
A HostProvider selects active nodes and routes requests.

client.index(request ->

  request.index("spring-data")
    .type("elasticsearch")
    .id(randomUUID().toString())
    .source(singletonMap("feature", "reactive-client"))
    .setRefreshPolicy(IMMEDIATE);
);
This implementation provides the first building block for reactive Template and Repository support to be added subsequently.

Along the lines we upgraded to Elasticsearch 6.5.

Original Pull Request: #226
2018-12-11 07:17:10 +01:00
Mark Paluch
25b02f29a7 DATAES-515 - Override Elasticsearch's JarHell for tests. 2018-12-10 18:39:26 +01:00
Mark Paluch
c5f01807e3 DATAES-514 - Simplify reference documentation setup. 2018-12-10 10:06:41 +01:00
Christoph Strobl
f89c3a0e20 DATAES-508 - Set up travis-ci build. 2018-11-28 13:21:22 +01:00
Mark Paluch
8765485779 DATAES-496 - Updated changelog. 2018-11-27 14:54:09 +01:00
Mark Paluch
11b341884e DATAES-490 - Updated changelog. 2018-11-27 12:36:49 +01:00
Mark Paluch
a373f4f8a5 DATAES-491 - Updated changelog. 2018-11-27 11:27:24 +01:00
tsallase
0469a3c7be DATAES-445 - Updated scroll API example.
Original pull request: #218
2018-11-20 11:50:11 +01:00
xhaggi
89d0633fd5 DATAES-33 - Polishing
* Move @Parent property recognition to ElasticsearchPersistentProperty
* Move type contraints for @Version and @Parent fields to ElasticsearchPersistentProperty to fail faster
* remove unused constant SUPPORTED_ID_TYPES from SimpleElasticsearchPersistentProperty

Original pull request: #208
2018-11-20 11:45:26 +01:00
xhaggi
527f669f76 DATAES-503 - Added missing copy_to property to @Field annotation.
Original pull request: #227
2018-11-20 11:23:05 +01:00
xhaggi
dcf4cbe32a DATAES-492 - Add missing normalizer property to @Field and @InnerField.
Original pull request: #222
2018-11-20 09:21:51 +01:00
Artur Konczak
86c45eff81 DATAES-499 - Fix build - jar hell 2018-11-09 11:46:25 +00:00
Mark Paluch
8cb36e4181 DATAES-489 - Updated changelog. 2018-10-29 14:34:36 +01:00
Mark Paluch
2dd025d43b DATAES-486 - Updated changelog. 2018-10-15 11:37:25 +02:00
Artur Konczak
32a4f4ea7a DATAES-407 - improved tests for rest/transport template 2018-09-29 10:12:57 +01:00
Artur Konczak
4d4a6390e1 DATAES-407 - removed dependency with apache commons 2018-09-29 10:12:57 +01:00
Don Wellington
2f0b9b718b DATAES-407 - Support for HighLevelRestClient via ElasticsearchRestTemplate
Original pull request: #216
2018-09-29 10:10:54 +01:00
Mark Paluch
9c2f876bde DATAES-480 - After release cleanups. 2018-09-21 07:45:29 -04:00
Mark Paluch
786afa445f DATAES-480 - Prepare next development iteration. 2018-09-21 07:45:27 -04:00
Mark Paluch
5a50114b73 DATAES-480 - Release version 3.1 GA (Lovelace). 2018-09-21 07:08:39 -04:00
Mark Paluch
45a9384d4f DATAES-480 - Prepare 3.1 GA (Lovelace). 2018-09-21 07:07:51 -04:00
Mark Paluch
789acdc3dc DATAES-480 - Updated changelog. 2018-09-21 07:07:49 -04:00
Mark Paluch
946a60d24d DATAES-473 - Updated changelog. 2018-09-10 14:15:51 +02:00
Mark Paluch
838776dd63 DATAES-474 - Updated changelog. 2018-09-10 10:20:58 +02:00
jnizet
b8324f9205 DATAES-479 - Allow specifying a HighlightBuilder when creating a query.
Original pull request: #217.
2018-08-24 15:59:12 +02:00
Oliver Gierke
94d18e8111 DATAES-472 - After release cleanups. 2018-08-20 10:56:53 +02:00
Oliver Gierke
a1aa755253 DATAES-472 - Prepare next development iteration. 2018-08-20 10:56:52 +02:00
Oliver Gierke
dfd9d962d3 DATAES-472 - Release version 3.1 RC2 (Lovelace). 2018-08-20 10:40:11 +02:00
Oliver Gierke
e1d3f6f160 DATAES-472 - Prepare 3.1 RC2 (Lovelace). 2018-08-20 10:39:43 +02:00
Oliver Gierke
7bb108c998 DATAES-472 - Updated changelog. 2018-08-20 10:39:41 +02:00
Mark Paluch
d1b71f2e73 DATAES-463 - Updated changelog. 2018-07-27 11:45:25 +02:00
Mark Paluch
88fe60c7d4 DATAES-465 - Updated changelog. 2018-07-26 16:23:57 +02:00
Mark Paluch
9a0a931ce2 DATAES-452 - After release cleanups. 2018-07-26 12:32:29 +02:00
Mark Paluch
02f2171cb6 DATAES-452 - Prepare next development iteration. 2018-07-26 12:32:25 +02:00
Mark Paluch
5d4cabae10 DATAES-452 - Release version 3.1 RC1 (Lovelace). 2018-07-26 12:06:35 +02:00
Mark Paluch
2632b69d12 DATAES-452 - Prepare 3.1 RC1 (Lovelace). 2018-07-26 12:04:30 +02:00
Mark Paluch
d30328f2e1 DATAES-452 - Updated changelog. 2018-07-26 12:04:28 +02:00
Oliver Gierke
469455383f
DATAES-470 - Fixed parsing of cluster nodes in TransportClientFactoryBean.
Extracted ClusterNodes value object to capture the parsing logic and actually properly test it. Added unit tests to verify the proper rejection and the two cases outlined in the ticket.

Related tickets: DATAES-283.
2018-07-12 21:48:31 +02:00
Oliver Gierke
cdbc832068
DATAES-471 - Adapt object property access behavior after changes in Spring Data Commons.
Changes made for Spring Data Commons result in final fields being rejected for manipulation unless there's a wither method available on the object at hand. Unfortunately adapting Spring Data Elasticsearch to support that doesn't work easily as it requires breaking changes to ElasticsearchTemplate as most of the methods assume parameters being handed to be mutable, see the implementation of SimpleElasticsearchRepository.save(…) for instance.

We now mitigate the problem, by enforcing the BeanWrapperPropertyAccessor being used and treating all properties as mutable.

Related tickets: DATACMNS-1322.
2018-07-12 15:27:36 +02:00
xhaggi
143a359eca
DATAES-317 - Introduce query logging in ElasticsearchTemplate.
Original pull request: #180.
2018-06-28 11:21:43 +02:00
xhaggi
e58c43f391
DATAES-469 - Remove superfluous dependency elasticsearch. 2018-06-28 11:16:33 +02:00
petar.tahchiev
d66b2a6f63
DATAES-283 - Get rid of Commons Lang dependency.
Replace all StringUtils and ArrayUtils usages with Springframework's StringUtils and ObjectUtils. Left the commons-lang as test-scope dependency as I believe it brings some values in the tests.

Original pull request: #211.
2018-06-20 20:10:21 +02:00
xhaggi
ba3eba5734
DATAES-467 - Fix sorting by _score if Spring Data sort is used.
Original pull request: #209.
2018-06-18 11:18:31 +02:00
Mark Paluch
4a26af38c3 DATAES-448 - Updated changelog. 2018-06-13 21:39:54 +02:00
Oliver Gierke
5ddb46c435 DATAES-462 - Polishing.
SimpleElasticsearchPersistentProperty now already checks for the correct type of score properties. Added unit tests for that. Also added unit tests for SimpleElasticsearchPersistentEntity rejecting more than one score property being present.

Additional non-null assertions on components that are required so that we can remove superfluous null checks.

A bit o formatting, Javadoc, missing @since tags and license headers.

Original pull request: #207.
2018-06-13 19:00:36 +02:00
xhaggi
d996406113 DATAES-462 - Add support for mapping max score and document scores.
Original pull request: #207.
2018-06-13 18:58:13 +02:00
xhaggi
112600261d DATAES-462 - Add query builder option to track scores.
Original pull request: #207.
2018-06-13 18:57:54 +02:00
Oliver Gierke
62a03a8fb7 DATAES-464 - DefaultEntityWriter now considers read-only and transient properties.
We now register a custom Jackson module that filters read-only and transient properties for serialization.
2018-06-13 18:21:37 +02:00
Mark Paluch
ac62aaf856 DATAES-447 - Updated changelog. 2018-06-13 15:01:59 +02:00
Christoph Strobl
28629a6ede DATAES-440 - After release cleanups. 2018-05-17 10:09:36 +02:00
Christoph Strobl
12cc5ced16 DATAES-440 - Prepare next development iteration. 2018-05-17 10:09:34 +02:00
Christoph Strobl
a807a3801c DATAES-440 - Release version 3.1 M3 (Lovelace). 2018-05-17 09:51:42 +02:00
Christoph Strobl
ac2e5be02b DATAES-440 - Prepare 3.1 M3 (Lovelace). 2018-05-17 09:50:48 +02:00
Christoph Strobl
b5b8066e6f DATAES-440 - Updated changelog. 2018-05-17 09:50:46 +02:00
Ted Liang
e8e407f93b DATAES-312 - Fix NullHandling.NULLS_LAST in query.sort
Original pull request: #163
2018-05-17 09:31:59 +02:00
Nordine Bittich
1b0006f9f7 DATAES-420 - Analyzer of main field ignored when using @MultiField annotation 2018-05-15 17:16:29 +02:00
Oliver Gierke
36c52a5308 DATAES-451 - Adapt to SpEL extension API changes in Spring Data Commons.
Related tickets: DATACMNS-1260.
2018-05-14 17:23:29 +02:00
Mark Paluch
324ab13ca1 DATAES-437 - Updated changelog. 2018-05-08 15:27:21 +02:00
Mark Paluch
c87499b189 DATAES-436 - Updated changelog. 2018-05-08 12:22:52 +02:00
xhaggi
64f259cb8e DATAES-427 - update version overview in README 2018-05-08 11:37:00 +02:00
xhaggi
8c4a669ce5 DATAES-285 - fix broken tests after 4970783ca4275186e118e03043861bc703ddbaa2 2018-05-08 10:47:22 +02:00
xhaggi
ace5a21b05 DATAES-285 - Polishing
* drop superfluous class FieldIndex
* change FieldType text and keyword starting with capital letters

Original commit: 089d7746be2f2fc4a395bd5c814f664729121f21
2018-05-07 13:19:37 +02:00
xhaggi
9c235cd53c DATAES-412 - only the last highlight field is added to SearchRequest 2018-05-07 11:39:58 +02:00
Chris White
ef1dca31e4 DATAES-198 - Fixed @Version annotation on fields. 2018-04-23 17:33:54 +02:00
Alen Turkovic
de1afe8bb0 DATAES-422 - Add support for IndicesOptions in search queries.
See also: DATAES-191..
2018-04-20 14:32:01 +02:00
Oliver Gierke
92c3bbebed DATAES-363 - Polishing.
Original pull request: #183.
2018-04-18 12:36:27 +02:00
Michael Wirth
512e9eacad DATAES-363 - Fixed CrudRepository.existsById(…) implementation.
Properly use Optional.isPresent() over a null check.

Original pull request: #183.
2018-04-18 12:36:10 +02:00
Mark Paluch
b8400d8d4d DATAES-427 - After release cleanups. 2018-04-13 15:08:34 +02:00
Mark Paluch
c53ecdc41c DATAES-427 - Prepare next development iteration. 2018-04-13 15:08:32 +02:00
Mark Paluch
c2aca20505 DATAES-427 - Release version 3.1 M2 (Lovelace). 2018-04-13 14:30:58 +02:00
Mark Paluch
e703fbc8bf DATAES-427 - Prepare 3.1 M2 (Lovelace). 2018-04-13 14:30:01 +02:00
Mark Paluch
1b44f051c7 DATAES-427 - Updated changelog. 2018-04-13 14:29:59 +02:00
xhaggi
b949daadea DATAES-438 - get rid of deprecation warning because of invalid mapping for @Id 2018-04-13 11:55:17 +01:00
Oliver Gierke
8c40bac9ab DATAES-439 - Adapt to API changes in Spring Data Commons.
Related tickets: DATACMNS-1275.
2018-04-09 14:40:47 +02:00
Mark Paluch
9fba9ea076 DATAES-430 - Updated changelog. 2018-04-04 17:12:55 +02:00
Mark Paluch
b5d5fdc32e DATAES-423 - Updated changelog. 2018-04-04 15:16:22 +02:00
Oliver Gierke
6db756a233 DATAES-434 - Removed explicit declaration of Jackson library versions. 2018-03-27 19:38:13 +02:00
Artur Konczak
e50e5f9146 DATAES-402 - fixed broken tests 2018-03-15 13:43:06 +00:00
Remco Zigterman
4856974c1a DATAES-402 - fixing paging information 2018-03-15 09:57:19 +00:00
Artur Konczak
51f9485700 DATAES-421 updated to latest version of ES 6.2.2 2018-03-15 09:14:43 +00:00
rivergod
e7b93bee90 DATAES-421 - Update ES to 6.1.0 2018-03-15 09:14:43 +00:00
Mark Paluch
9bc9c47f42 DATAES-432 - Export composable repositories via CDI.
We now export composable repositories through our CDI extension. Repositories can now be customized either by a single custom implementation (as it was before) and by providing fragment interfaces along their fragment implementation.

This change aligns CDI support with the existing RepositoryFactory support we provide within a Spring application context.
2018-03-12 17:00:16 +01:00
Mark Paluch
4313d13ddd DATAES-429 - Updated changelog. 2018-02-28 11:17:39 +01:00
Mark Paluch
2075775478 DATAES-425 - Updated changelog. 2018-02-19 20:30:08 +01:00
Christoph Strobl
e4009df6b9 DATAES-401 - After release cleanups. 2018-02-06 10:11:17 +01:00
Christoph Strobl
053e1726f5 DATAES-401 - Prepare next development iteration. 2018-02-06 10:11:15 +01:00
Christoph Strobl
d2690abbdf DATAES-401 - Release version 3.1 M1 (Lovelace). 2018-02-06 09:47:10 +01:00
Christoph Strobl
cf6d299941 DATAES-401 - Prepare 3.1 M1 (Lovelace). 2018-02-06 09:45:50 +01:00
Christoph Strobl
4d0159a560 DATAES-401 - Updated changelog. 2018-02-06 09:45:48 +01:00
Mark Paluch
028bc13eb7 DATAES-417 - Updated changelog. 2018-01-24 13:41:24 +01:00
Mark Paluch
9bfc6f23b9 DATAES-424 - Fix line endings to LF. 2018-01-24 13:06:40 +01:00
Mark Paluch
4bd263a25a DATAES-416 - Updated changelog. 2018-01-24 12:22:14 +01:00
Mark Paluch
00e30fd802 DATAES-411 - Updated changelog. 2017-11-27 16:43:43 +01:00
Mark Paluch
22e10801ca DATAES-404 - Updated changelog. 2017-11-27 15:58:47 +01:00
Oliver Gierke
f7d77f05de DATAES-414 - Reduced scope of Log4j dependencies to test. 2017-11-02 18:40:56 +01:00
Oliver Gierke
71ebc3dd21 DATAES-400 - Updated changelog. 2017-10-27 16:36:52 +02:00
Oliver Gierke
51d0f95f65 DATAES-410 - Adapt API changes in Property in test cases. 2017-10-27 11:24:34 +02:00
Vladimir Tsanev
75f34e4d02 DATAES-361 - Move Log4j2 config file to test sources.
The configuration file for Log4j2 had been added to src/main/resources accidentally which caused it to be picked up by user applications, e.g. in a Spring Boot application effectively disabling Boot's auto-configuration. This file has now been moved to the test resources.

Original pull request: #191.
Related tickets: spring-projects/spring-boot#10634
2017-10-13 15:40:44 +02:00
Oliver Gierke
4a956270a8 DATAES-391 - Updated changelog. 2017-10-11 19:01:43 +02:00
Mark Paluch
d227f21572 DATAES-392 - After release cleanups. 2017-10-02 11:37:23 +02:00
Mark Paluch
fe6b3c65b3 DATAES-392 - Prepare next development iteration. 2017-10-02 11:37:22 +02:00
Mark Paluch
d30b41cc59 DATAES-392 - Release version 3.0 GA (Kay). 2017-10-02 11:10:23 +02:00
Mark Paluch
3fa7851544 DATAES-392 - Prepare 3.0 GA (Kay). 2017-10-02 11:09:17 +02:00
Mark Paluch
e990e57b6e DATAES-392 - Updated changelog. 2017-10-02 11:09:15 +02:00
Mark Paluch
a30a13dced DATAES-395 - Downgrade to CDI 1.0. 2017-09-21 14:39:22 +02:00
Mark Paluch
e0d85f0c2a DATAES-397 - Added explicit automatic module name for JDK 9. 2017-09-21 14:02:37 +02:00
Mark Paluch
960263837b DATAES-395 - Polishing.
Fix line endings.
2017-09-18 15:36:39 +02:00
Mark Paluch
6dd4d28067 DATAES-395 - Upgrade to OpenWebBeans 2.0.1. 2017-09-18 15:36:20 +02:00
Oliver Gierke
adf846d665 DATAES-376 - After release cleanups. 2017-09-11 17:40:22 +02:00
Oliver Gierke
8193212d5b DATAES-376 - Prepare next development iteration. 2017-09-11 17:40:19 +02:00
Oliver Gierke
e529c56ced DATAES-376 - Release version 3.0 RC3 (Kay). 2017-09-11 17:24:46 +02:00
Oliver Gierke
7ba5195c6e DATAES-376 - Prepare 3.0 RC3 (Kay). 2017-09-11 17:23:52 +02:00
Oliver Gierke
f899cf389f DATAES-376 - Updated changelog. 2017-09-11 17:23:49 +02:00
Mark Paluch
196ab5b5e2 DATAES-378 - Updated changelog. 2017-09-11 12:44:07 +02:00
Oliver Gierke
771e01189e DATAES-374 - Updated changelog. 2017-07-27 00:49:04 +02:00
Mohsin Husen
54d1b2f3dd DATAES-375 - update README 2017-07-26 11:58:24 +01:00
Oliver Gierke
527d594389 DATAES-375 - After release cleanups. 2017-07-25 16:10:39 +02:00
Oliver Gierke
8d0e1df742 DATAES-375 - Prepare next development iteration. 2017-07-25 16:10:36 +02:00
985 changed files with 112262 additions and 24506 deletions

View File

@ -1,12 +1,17 @@
<!--
Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
When contributing, please make sure an issue exists in issue tracker and comment on this issue with how you want to address it. By this we not only know that someone is working on an issue, we can also align architectural questions and possible solutions before work is invested . We so can prevent that much work is put into Pull Requests that have little or no chances of being merged.
Make sure that:
-->
- [ ] You have read the [Spring Data contribution guidelines](https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.adoc).
- [ ] There is a ticket in the bug tracker for the project in our [JIRA](https://jira.spring.io/browse/DATAES).
- [ ] **There is a ticket in the bug tracker for the project in our [issue tracker](https://github.com/spring-projects/spring-data-elasticsearch/issues)**. Add the issue number to the _Closes #issue-number_ line below
- [ ] You use the code formatters provided [here](https://github.com/spring-projects/spring-data-build/tree/master/etc/ide) and have them applied to your changes. Dont submit any formatting related changes.
- [ ] You submit test cases (unit or integration tests) that back your changes.
- [ ] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
Closes #issue-number

18
.gitignore vendored
View File

@ -1,3 +1,7 @@
.DS_Store
*.graphml
.springBeans
atlassian-ide-plugin.xml
## Ignore svn files
@ -16,3 +20,17 @@ target
*.ipr
*.iws
.idea
/.env
/zap.env
/localdocker.env
.localdocker-env
build/
node_modules
node
package-lock.json
.mvn/.develocity
/src/test/resources/testcontainers-local.properties

8
.mvn/extensions.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>io.spring.develocity.conventions</groupId>
<artifactId>develocity-conventions-maven-extension</artifactId>
<version>0.0.22</version>
</extension>
</extensions>

14
.mvn/jvm.config Normal file
View File

@ -0,0 +1,14 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.text=ALL-UNNAMED
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED

115
.mvn/wrapper/MavenWrapperDownloader.java vendored Normal file
View File

@ -0,0 +1,115 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to use instead of the default
* one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using transport directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println("- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

BIN
.mvn/wrapper/maven-wrapper.jar vendored Normal file

Binary file not shown.

3
.mvn/wrapper/maven-wrapper.properties vendored Normal file
View File

@ -0,0 +1,3 @@
#Thu Jul 17 13:59:56 CEST 2025
wrapperUrl=https\://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip

43
CI.adoc Normal file
View File

@ -0,0 +1,43 @@
= Continuous Integration
image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-elasticsearch%2Fmain&subject=2020.0.0%20(main)[link=https://jenkins.spring.io/view/SpringData/job/spring-data-elasticsearch/]
image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-elasticsearch%2F4.0.x&subject=Neumann%20(4.0.x)[link=https://jenkins.spring.io/view/SpringData/job/spring-data-elasticsearch/]
image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-elasticsearch%2F3.2.x&subject=Moore%20(3.2.x)[link=https://jenkins.spring.io/view/SpringData/job/spring-data-elasticsearch/]
== Running CI tasks locally
Since this pipeline is purely Docker-based, it's easy to:
* Debug what went wrong on your local machine.
* Test out a a tweak to your `verify.sh` script before sending it out.
* Experiment against a new image before submitting your pull request.
All of these use cases are great reasons to essentially run what the CI server does on your local machine.
IMPORTANT: To do this you must have Docker installed on your machine.
1. `docker run -it --mount type=bind,source="$(pwd)",target=/spring-data-elasticsearch-github adoptopenjdk/openjdk8:latest /bin/bash`
+
This will launch the Docker image and mount your source code at `spring-data-elasticsearch-github`.
+
2. `cd spring-data-elasticsearch-github`
+
Next, run your tests from inside the container:
+
3. `./mvnw clean dependency:list test -Dsort` (or whatever profile you need to test out)
Since the container is binding to your source, you can make edits from your IDE and continue to run build jobs.
If you need to package things up, do this:
1. `docker run -it -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source="$(pwd)",target=/spring-data-elasticsearch-github adoptopenjdk/openjdk8:latest /bin/bash`
+
This will launch the Docker image and mount your source code at `spring-data-elasticsearch-github`.
+
2. `cd spring-data-elasticsearch-github`
+
Next, try to package everything up from inside the container:
+
3. `./mvnw -Pci,snapshot -Dmaven.test.skip=true clean package`
NOTE: Docker containers can eat up disk space fast! From time to time, run `docker system prune` to clean out old images.

View File

@ -1,27 +0,0 @@
= Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses,
without explicit permission
* Other unethical or unprofessional conduct
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at spring-code-of-conduct@pivotal.io.
All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.
This Code of Conduct is adapted from the http://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at http://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/].

View File

@ -1,3 +1,10 @@
= Spring Data contribution guidelines
You find the contribution guidelines for Spring Data projects https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.adoc[here].
You find the contribution guidelines for Spring Data projects https://github.com/spring-projects/spring-data-build/blob/main/CONTRIBUTING.adoc[here].
**Please read these carefully!**
Do not submit a Pull Request before having created an issue and having discussed it. This prevents you from doing work that might be rejected.
== Running the test locally
In order to run the tests locally with `./mvnw test` you need to have docker running because Spring Data Elasticsearch uses https://www.testcontainers.org/[Testcontainers] to start a local running Elasticsearch instance.

132
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,132 @@
def p = [:]
node {
checkout scm
p = readProperties interpolate: true, file: 'ci/pipeline.properties'
}
pipeline {
agent none
triggers {
pollSCM 'H/10 * * * *'
upstream(upstreamProjects: "spring-data-commons/main", threshold: hudson.model.Result.SUCCESS)
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '14'))
}
stages {
stage("test: baseline (main)") {
when {
beforeAgent(true)
anyOf {
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
not { triggeredBy 'UpstreamCause' }
}
}
agent {
label 'data'
}
options { timeout(time: 30, unit: 'MINUTES') }
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
}
steps {
script {
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
sh "PROFILE=none JENKINS_USER_NAME=${p['jenkins.user.name']} ci/verify.sh"
sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh"
}
}
}
}
}
stage("Test other configurations") {
when {
beforeAgent(true)
allOf {
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
not { triggeredBy 'UpstreamCause' }
}
}
parallel {
stage("test: baseline (next)") {
agent {
label 'data'
}
options { timeout(time: 30, unit: 'MINUTES') }
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
}
steps {
script {
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
docker.image(p['docker.java.next.image']).inside(p['docker.java.inside.docker']) {
sh "PROFILE=none JENKINS_USER_NAME=${p['jenkins.user.name']} ci/verify.sh"
sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh"
}
}
}
}
}
}
}
stage('Release to artifactory') {
when {
beforeAgent(true)
anyOf {
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
not { triggeredBy 'UpstreamCause' }
}
}
agent {
label 'data'
}
options { timeout(time: 20, unit: 'MINUTES') }
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
}
steps {
script {
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
"./mvnw -s settings.xml -Pci,artifactory " +
"-Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root " +
"-Dartifactory.server=${p['artifactory.url']} " +
"-Dartifactory.username=${ARTIFACTORY_USR} " +
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
"-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " +
"-Dartifactory.build-name=spring-data-elasticsearch " +
"-Dartifactory.build-number=spring-data-elasticsearch-${BRANCH_NAME}-build-${BUILD_NUMBER} " +
"-Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch " +
"-Dmaven.test.skip=true clean deploy -U -B"
}
}
}
}
}
}
post {
changed {
script {
emailext(
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
mimeType: 'text/html',
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']],
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>")
}
}
}
}

202
LICENSE.txt Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

179
README.adoc Normal file
View File

@ -0,0 +1,179 @@
= Spring Data for Elasticsearch image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-elasticsearch%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-elasticsearch/] https://gitter.im/spring-projects/spring-data[image:https://badges.gitter.im/spring-projects/spring-data.svg[Gitter]] image:https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Develocity", link="https://ge.spring.io/scans?search.rootProjectNames=Spring Data Elasticsearch"]
The primary goal of the https://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.
The Spring Data Elasticsearch project provides integration with the https://www.elastic.co/[Elasticsearch] search engine.
Key functional areas of Spring Data Elasticsearch are a POJO centric model for interacting with Elasticsearch Documents and easily writing a Repository style data access layer.
This project is lead and maintained by the community.
== Features
* Spring configuration support using Java based `@Configuration` classes or an XML namespace for an ES client instances.
* `ElasticsearchOperations` class and implementations that increases productivity performing common ES operations.
Includes integrated object mapping between documents and POJOs.
* Feature Rich Object Mapping integrated with Springs Conversion Service
* Annotation based mapping metadata
* Automatic implementation of `Repository` interfaces including support for custom search methods.
* CDI support for repositories
== Code of Conduct
This project is governed by the https://github.com/spring-projects/.github/blob/e3cc2ff230d8f1dca06535aa6b5a4a23815861d4/CODE_OF_CONDUCT.md[Spring Code of Conduct].
By participating, you are expected to uphold this code of conduct.
Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
== Getting Started
Here is a quick teaser of an application using Spring Data Repositories in Java:
[source,java]
----
public interface PersonRepository extends CrudRepository<Person, Long> {
List<Person> findByLastname(String lastname);
List<Person> findByFirstnameLike(String firstname);
}
@Service
public class MyService {
private final PersonRepository repository;
public MyService(PersonRepository repository) {
this.repository = repository;
}
public void doWork() {
repository.deleteAll();
Person person = new Person();
person.setFirstname("Oliver");
person.setLastname("Gierke");
repository.save(person);
List<Person> lastNameResults = repository.findByLastname("Gierke");
List<Person> firstNameResults = repository.findByFirstnameLike("Oli");
}
}
----
=== Using the RestClient
Please check the https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.configuration[official documentation].
=== Maven configuration
Add the Maven dependency:
[source,xml]
----
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>${version}</version>
</dependency>
----
**Compatibility Matrix**
The compatibility between Spring Data Elasticsearch, Elasticsearch client drivers and Spring Boot versions can be found in the https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#preface.versions[reference documentation].
To use the Release candidate versions of the upcoming major version, use our Maven milestone repository and declare the appropriate dependency version:
[source,xml]
----
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>${version}.RCx</version> <!-- x being 1, 2, ... -->
</dependency>
<repository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/milestone</url>
</repository>
----
If you'd rather like the latest snapshots of the upcoming major version, use our Maven snapshot repository and declare the appropriate dependency version:
[source,xml]
----
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>${version}-SNAPSHOT</version>
</dependency>
<repository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/snapshot</url>
</repository>
----
== Getting Help
Having trouble with Spring Data?
Wed love to help!
* Check the
https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/[reference documentation], and https://docs.spring.io/spring-data/elasticsearch/docs/current/api/[Javadocs].
* Learn the Spring basics Spring Data builds on Spring Framework, check the https://spring.io[spring.io] web-site for a wealth of reference documentation.
If you are just starting out with Spring, try one of the https://spring.io/guides[guides].
* Ask a question or chat with the community on https://app.gitter.im/#/room/#spring-projects_spring-data:gitter.im[Gitter].
* Report bugs with Spring Data for Elasticsearch at https://github.com/spring-projects/spring-data-elasticsearch/issues[https://github.com/spring-projects/spring-data-elasticsearch/issues].
== Reporting Issues
Spring Data uses GitHub as issue tracking system to record bugs and feature requests.
If you want to raise an issue, please follow the recommendations below:
* Before you log a bug, please search the
https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] to see if someone has already reported the problem.
* If the issue doesn't already exist, https://github.com/spring-projects/spring-data-elasticsearch/issues/new[create a new issue].
* Please provide as much information as possible with the issue report, we like to know the version of Spring Data Elasticsearch that you are using and JVM version.
* If you need to paste code, or include a stack trace use Markdown +++```+++ escapes before and after your text.
* If possible try to create a test-case or project that replicates the issue.
Attach a link to your code or a compressed file containing your code.
== Building from Source
You dont need to build from source to use Spring Data (binaries in https://repo.spring.io[repo.spring.io]), but if you want to try out the latest and greatest, Spring Data can be easily built with the https://github.com/takari/maven-wrapper[maven wrapper].
You need JDK 17 or above to build the _main_ branch.
For the branches up to and including release 4.4, JDK 8 is required.
[source,bash]
----
$ ./mvnw clean install
----
If you want to build with the regular `mvn` command, you will need https://maven.apache.org/run-maven/index.html[Maven v3.5.0 or above].
_Also see link:CONTRIBUTING.adoc[CONTRIBUTING.adoc] if you wish to submit pull requests, and in particular please sign the https://cla.pivotal.io/sign/spring[Contributors Agreement] before submitting your first pull request._
IMPORTANT: When contributing, please make sure an issue exists in https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] and comment on this issue with how you want to address it.
By this we not only know that someone is working on an issue, we can also align architectural questions and possible solutions before work is invested . We so can prevent that much work is put into Pull Requests that have little or no chances of being merged.
=== Building reference documentation
Building the documentation builds also the project without running tests.
[source,bash]
----
$ ./mvnw clean install -Pantora
----
The generated documentation is available from `target/site/index.html`.
== Examples
For examples on using the Spring Data for Elasticsearch, see the https://github.com/spring-projects/spring-data-examples/tree/main/elasticsearch/example[spring-data-examples] project.
== License
Spring Data for Elasticsearch Open Source software released under the https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].

255
README.md
View File

@ -1,255 +0,0 @@
Spring Data Elasticsearch
=========================
Spring Data implementation for ElasticSearch
Spring Data makes it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services as well as provide improved support for relational database technologies.
The Spring Data Elasticsearch project provides integration with the [elasticsearch](http://www.elasticsearch.org/) search engine.
Guide
------------
* [Reference Documentation](http://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/)
* [API Documentation](http://docs.spring.io/spring-data/elasticsearch/docs/current/api/)
* [Spring Data Project](http://projects.spring.io/spring-data)
* [Sample Test Application](https://github.com/BioMedCentralLtd/spring-data-elasticsearch-sample-application)
* [Issues](https://jira.springsource.org/browse/DATAES)
* [Spring Data Elasticsearch Google Group](https://groups.google.com/d/forum/spring-data-elasticsearch-devs)
* [Questions](http://stackoverflow.com/questions/tagged/spring-data-elasticsearch)
Quick Start
-----------
Wiki page for [Getting Started](https://github.com/spring-projects/spring-data-elasticsearch/wiki/How-to-start-with-spring-data-elasticsearch)
### Maven configuration
Add the Maven dependency:
```xml
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>x.y.z.RELEASE</version>
</dependency>
```
If you'd rather like the latest snapshots of the upcoming major version, use our Maven snapshot repository and declare
the appropriate dependency version.
```xml
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>x.y.z.BUILD-SNAPSHOT</version>
</dependency>
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot</url>
</repository>
```
| spring data elasticsearch | elasticsearch |
|:-----------------------------------:|:-------------:|
| 3.0.0.RC1 | 5.5.0 |
| 3.0.0.M4 | 5.4.0 |
| 2.0.4.RELEASE | 2.4.0 |
| 2.0.0.RELEASE | 2.2.0 |
| 1.4.0.M1 | 1.7.3 |
| 1.3.0.RELEASE | 1.5.2 |
| 1.2.0.RELEASE | 1.4.4 |
| 1.1.0.RELEASE | 1.3.2 |
| 1.0.0.RELEASE | 1.1.1 |
### ElasticsearchRepository
A default implementation of ElasticsearchRepository, aligning to the generic Repository Interfaces, is provided. Spring can do the Repository implementation for you depending on method names in the interface definition.
The ElasticsearchCrudRepository extends PagingAndSortingRepository
```java
public interface ElasticsearchCrudRepository<T, ID extends Serializable> extends ElasticsearchRepository<T, ID>, PagingAndSortingRepository<T, ID> {
}
```
Extending ElasticsearchRepository for custom methods
```java
public interface BookRepository extends Repository<Book, String> {
List<Book> findByNameAndPrice(String name, Integer price);
List<Book> findByNameOrPrice(String name, Integer price);
Page<Book> findByName(String name,Pageable page);
Page<Book> findByNameNot(String name,Pageable page);
Page<Book> findByPriceBetween(int price,Pageable page);
Page<Book> findByNameLike(String name,Pageable page);
@Query("{\"bool\" : {\"must\" : {\"term\" : {\"message\" : \"?0\"}}}}")
Page<Book> findByMessage(String message, Pageable pageable);
}
```
Indexing a single document with Repository
```java
@Autowired
private SampleElasticsearchRepository repository;
String documentId = "123456";
SampleEntity sampleEntity = new SampleEntity();
sampleEntity.setId(documentId);
sampleEntity.setMessage("some message");
repository.save(sampleEntity);
```
Indexing multiple Document(bulk index) using Repository
```java
@Autowired
private SampleElasticsearchRepository repository;
String documentId = "123456";
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setMessage("some message");
String documentId2 = "123457"
SampleEntity sampleEntity2 = new SampleEntity();
sampleEntity2.setId(documentId2);
sampleEntity2.setMessage("test message");
List<SampleEntity> sampleEntities = Arrays.asList(sampleEntity1, sampleEntity2);
//bulk index
repository.save(sampleEntities);
```
### ElasticsearchTemplate
ElasticsearchTemplate is the central support class for elasticsearch operations.
Indexing a single document using Elasticsearch Template
```java
String documentId = "123456";
SampleEntity sampleEntity = new SampleEntity();
sampleEntity.setId(documentId);
sampleEntity.setMessage("some message");
IndexQuery indexQuery = new IndexQueryBuilder().withId(sampleEntity.getId()).withObject(sampleEntity).build();
elasticsearchTemplate.index(indexQuery);
```
Indexing multiple Document(bulk index) using Elasticsearch Template
```java
@Autowired
private ElasticsearchTemplate elasticsearchTemplate;
List<IndexQuery> indexQueries = new ArrayList<IndexQuery>();
//first document
String documentId = "123456";
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setMessage("some message");
IndexQuery indexQuery1 = new IndexQueryBuilder().withId(sampleEntity1.getId()).withObject(sampleEntity1).build();
indexQueries.add(indexQuery1);
//second document
String documentId2 = "123457";
SampleEntity sampleEntity2 = new SampleEntity();
sampleEntity2.setId(documentId2);
sampleEntity2.setMessage("some message");
IndexQuery indexQuery2 = new IndexQueryBuilder().withId(sampleEntity2.getId()).withObject(sampleEntity2).build()
indexQueries.add(indexQuery2);
//bulk index
elasticsearchTemplate.bulkIndex(indexQueries);
```
Searching entities using Elasticsearch Template
```java
@Autowired
private ElasticsearchTemplate elasticsearchTemplate;
SearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(queryString(documentId).field("id"))
.build();
Page<SampleEntity> sampleEntities = elasticsearchTemplate.queryForPage(searchQuery,SampleEntity.class);
```
### XML Namespace
You can set up repository scanning via xml configuration, which will happily create your repositories.
Using Node Client
```xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
xsi:schemaLocation="http://www.springframework.org/schema/data/elasticsearch http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<elasticsearch:node-client id="client" local="true"/>
<bean name="elasticsearchTemplate" class="org.springframework.data.elasticsearch.core.ElasticsearchTemplate">
<constructor-arg name="client" ref="client"/>
</bean>
</beans>
```
Using Transport Client
```xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
xsi:schemaLocation="http://www.springframework.org/schema/data/elasticsearch http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<elasticsearch:repositories base-package="com.xyz.acme"/>
<elasticsearch:transport-client id="client" cluster-nodes="ip:9300,ip:9300" cluster-name="elasticsearch" />
<bean name="elasticsearchTemplate" class="org.springframework.data.elasticsearch.core.ElasticsearchTemplate">
<constructor-arg name="client" ref="client"/>
</bean>
</beans>
```
## Help Pages
* [Geo distance and location search](https://github.com/spring-projects/spring-data-elasticsearch/wiki/Geo-indexing-and-request)
* [Custom object mapper](https://github.com/spring-projects/spring-data-elasticsearch/wiki/Custom-ObjectMapper)
## Contributing to Spring Data
Here are some ways for you to get involved in the community:
* Get involved with the Spring community on Stack OverFlow. Please help out on the [forum](https://stackoverflow.com/questions/tagged/spring-data-elasticsearch) by responding to questions and joining the debate.
* Create [JIRA](https://jira.spring.io/browse/DATAES/) tickets for bugs and new features and comment and vote on the ones that you are interested in.
* Github is for social coding: if you want to write code, we encourage contributions through pull requests from [forks of this repository](http://help.github.com/forking/). If you want to contribute code this way, please reference a JIRA ticket as well covering the specific issue you are addressing.
* Watch for upcoming articles on Spring by [subscribing](http://www.springsource.org/node/feed) to springframework.org
Before we accept a non-trivial patch or pull request we will need you to [sign the Contributor License Agreement](https://cla.pivotal.io/sign/spring). Signing the contributors agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. If you forget to do so, you'll be reminded when you submit a pull request. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
Code formatting for [Eclipse and Intellij](https://github.com/spring-projects/spring-data-build/tree/master/etc/ide)
[More information about contributing to Spring Data](https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.adoc)

9
SECURITY.adoc Normal file
View File

@ -0,0 +1,9 @@
# Security Policy
## Supported Versions
Please see the https://spring.io/projects/spring-data-elasticsearch[Spring Data Elasticsearch] project page for supported versions.
## Reporting a Vulnerability
Please don't raise security vulnerabilities here. Head over to https://pivotal.io/security to learn how to disclose them responsibly.

20
TESTING.adoc Normal file
View File

@ -0,0 +1,20 @@
= Testing
== Unit tests
Unit tests in the project are run with
----
./mvnw test
----
== Integration tests
Integration tests are executed when
----
./mvnw verify
----
is run. There must be _docker_ running, as the integration tests use docker to start an Elasticsearch server.
Integration tests are tests that have the Junit5 Tag `@Tag("integration-test")` on the test class. Normally this should not be set explicitly, but the annotation `@SpringIntegrationTest` should be used. This not only marks the test as integration test, but integrates an automatic setup of an Elasticsearch Testcontainer and integrate this with Spring, so
that the required Beans can be automatically injected. Check _src/test/java/org/springframework/data/elasticsearch/JUnit5SampleRestClientBasedTests.java_ as a reference setup

8
ci/clean.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash -x
set -euo pipefail
export JENKINS_USER=${JENKINS_USER_NAME}
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \
./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root

31
ci/pipeline.properties Normal file
View File

@ -0,0 +1,31 @@
# Java versions
java.main.tag=24.0.1_9-jdk-noble
java.next.tag=24.0.1_9-jdk-noble
# Docker container images - standard
docker.java.main.image=library/eclipse-temurin:${java.main.tag}
docker.java.next.image=library/eclipse-temurin:${java.next.tag}
# Supported versions of MongoDB
docker.mongodb.6.0.version=6.0.23
docker.mongodb.7.0.version=7.0.20
docker.mongodb.8.0.version=8.0.9
# Supported versions of Redis
docker.redis.6.version=6.2.13
docker.redis.7.version=7.2.4
# Docker environment settings
docker.java.inside.basic=-v $HOME:/tmp/jenkins-home
docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v $HOME:/tmp/jenkins-home
# Credentials
docker.registry=
docker.credentials=hub.docker.com-springbuildmaster
docker.proxy.registry=https://docker-hub.usw1.packages.broadcom.com
docker.proxy.credentials=usw1_packages_broadcom_com-jenkins-token
artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c
artifactory.url=https://repo.spring.io
artifactory.repository.snapshot=libs-snapshot-local
develocity.access-key=gradle_enterprise_secret_access_key
jenkins.user.name=spring-builds+jenkins

10
ci/verify.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash -x
set -euo pipefail
mkdir -p /tmp/jenkins-home/.m2/spring-data-elasticsearch
export JENKINS_USER=${JENKINS_USER_NAME}
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \
./mvnw -s settings.xml \
-P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root

310
mvnw vendored Executable file
View File

@ -0,0 +1,310 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project transport directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

182
mvnw.cmd vendored Normal file
View File

@ -0,0 +1,182 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%

10
package.json Normal file
View File

@ -0,0 +1,10 @@
{
"dependencies": {
"antora": "3.2.0-alpha.6",
"@antora/atlas-extension": "1.0.0-alpha.2",
"@antora/collector-extension": "1.0.0-alpha.7",
"@asciidoctor/tabs": "1.0.0-beta.6",
"@springio/antora-extensions": "1.13.0",
"@springio/asciidoctor-extensions": "1.0.0-alpha.11"
}
}

669
pom.xml
View File

@ -1,243 +1,490 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>3.0.0.RC2</version>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>2.0.0.RC2</version>
</parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>6.0.0-SNAPSHOT</version>
<name>Spring Data Elasticsearch</name>
<description>Spring Data Implementation for Elasticsearch</description>
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<properties>
<commonscollections>3.2.1</commonscollections>
<commonslang>2.6</commonslang>
<elasticsearch>5.5.0</elasticsearch>
<springdata.commons>2.0.0.RC2</springdata.commons>
</properties>
<name>Spring Data Elasticsearch</name>
<description>Spring Data Implementation for Elasticsearch</description>
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
<dependencies>
<properties>
<springdata.commons>4.0.0-SNAPSHOT</springdata.commons>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- version of the ElasticsearchClient -->
<elasticsearch-java>9.0.4</elasticsearch-java>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
<hoverfly>0.19.0</hoverfly>
<log4j>2.23.1</log4j>
<jsonassert>1.5.3</jsonassert>
<testcontainers>1.20.0</testcontainers>
<wiremock>3.9.1</wiremock>
<!-- SPRING DATA -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>${springdata.commons}</version>
</dependency>
<java-module-name>spring.data.elasticsearch</java-module-name>
<!-- APACHE -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commonslang}</version>
</dependency>
<!--
properties defining the maven phase for the tests and integration tests
set to "none" to disable the corresponding test execution (-Dmvn.unit-test.goal=none)
default execution for unit-test: "test", for the integration tests: "integration-test"
-->
<mvn.unit-test.goal>test</mvn.unit-test.goal>
<mvn.integration-test-elasticsearch.goal>integration-test</mvn.integration-test-elasticsearch.goal>
</properties>
<!-- JODA Time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime}</version>
</dependency>
<developers>
<developer>
<id>biomedcentral</id>
<name>BioMed Central Development Team</name>
<timezone>+0</timezone>
</developer>
<developer>
<id>cstrobl</id>
<name>Christoph Strobl</name>
<email>cstrobl at pivotal.io</email>
<organization>Pivotal</organization>
<organizationUrl>https://www.pivotal.io</organizationUrl>
<roles>
<role>Developer</role>
</roles>
<timezone>+1</timezone>
</developer>
<developer>
<id>mpaluch</id>
<name>Mark Paluch</name>
<email>mpaluch at pivotal.io</email>
<organization>Pivotal</organization>
<organizationUrl>https://www.pivotal.io</organizationUrl>
<roles>
<role>Developer</role>
</roles>
<timezone>+1</timezone>
</developer>
</developers>
<!-- Elasticsearch -->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch}</version>
</dependency>
<scm>
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
<connection>scm:git:git://github.com/spring-projects/spring-data-elasticsearch.git</connection>
<developerConnection>scm:git:ssh://git@github.com/spring-projects/spring-data-elasticsearch.git
</developerConnection>
</scm>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>${elasticsearch}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<ciManagement>
<system>Bamboo</system>
<url>https://build.spring.io/browse/SPRINGDATAES</url>
</ciManagement>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.7.22</version>
</dependency>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/spring-projects/spring-data-elasticsearch/issues</url>
</issueManagement>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
</dependency>
<dependencies>
<!-- Jackson JSON Mapper -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson}</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<!-- CDI -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>${cdi}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans.test</groupId>
<artifactId>cditest-owb</artifactId>
<version>${webbeans}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcdi_1.0_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0-alpha-1</version>
<scope>test</scope>
</dependency>
<!-- SPRING DATA -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>${springdata.commons}</version>
</dependency>
<dependency>
<!-- required by elasticsearch -->
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>transport-netty4-client</artifactId>
<version>${elasticsearch}</version>
<!--<scope>test</scope>-->
</dependency>
<!-- Reactive Infrastructure -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>co.elastic.clients</groupId>
<artifactId>elasticsearch-java</artifactId>
<version>${elasticsearch-java}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- the old RestCLient is an optional dependency for user that still want to use it-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>${elasticsearch-java}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
<optional>true</optional>
</dependency>
</dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>${querydsl}</version>
<optional>true</optional>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<!-- Jackson JSON Mapper -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<inherited>false</inherited>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- CDI -->
<developers>
<developer>
<id>biomedcentral</id>
<name>BioMed Central Development Team</name>
<timezone>+0</timezone>
</developer>
</developers>
<dependency>
<groupId>javax.interceptor</groupId>
<artifactId>javax.interceptor-api</artifactId>
<version>1.2.2</version>
<scope>test</scope>
</dependency>
<repositories>
<repository>
<id>spring-libs-milestone</id>
<url>https://repo.spring.io/libs-milestone</url>
</repository>
</repositories>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<pluginRepositories>
<pluginRepository>
<id>spring-plugins-release</id>
<url>https://repo.spring.io/plugins-release</url>
</pluginRepository>
</pluginRepositories>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta-annotation-api}</version>
<scope>test</scope>
</dependency>
<scm>
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
<connection>scm:git:git://github.com/spring-projects/spring-data-elasticsearch.git</connection>
<developerConnection>scm:git:ssh://git@github.com/spring-projects/spring-data-elasticsearch.git
</developerConnection>
</scm>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-se</artifactId>
<version>${webbeans}</version>
<scope>test</scope>
</dependency>
<ciManagement>
<system>Bamboo</system>
<url>https://build.spring.io/browse/SPRINGDATAES</url>
</ciManagement>
<!-- Kotlin extension -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<optional>true</optional>
</dependency>
<issueManagement>
<system>JIRA</system>
<url>https://jira.spring.io/browse/DATAES</url>
</issueManagement>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-reactor</artifactId>
<optional>true</optional>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-test</artifactId>
<scope>test</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>${slf4j}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>${log4j}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>${jsonassert}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>${wiremock}</version>
<scope>test</scope>
<exclusions>
<!-- these exclusions are needed because of Elasticsearch JarHell-->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.specto</groupId>
<artifactId>hoverfly-java-junit5</artifactId>
<version>${hoverfly}</version>
<scope>test</scope>
</dependency>
<!-- Upgrade xbean to 4.5 to prevent incompatibilities due to ASM versions -->
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-asm5-shaded</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>elasticsearch</artifactId>
<version>${testcontainers}</version>
<scope>test</scope>
</dependency>
<!--we need Murmur3Hash in a test, before 5.2 we had it from the old Elasticsearch dependency -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
<version>${archunit}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/versions.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/versions.properties</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<useSystemClassLoader>true</useSystemClassLoader>
<useFile>false</useFile>
<includes>
<include>**/*Tests.java</include>
<include>**/*Test.java</include>
</includes>
<systemPropertyVariables>
<es.set.netty.runtime.available.processors>false</es.set.netty.runtime.available.processors>
</systemPropertyVariables>
</configuration>
<executions>
<!-- the default-test execution runs only the unit tests -->
<execution>
<id>default-test</id>
<phase>${mvn.unit-test.goal}</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludedGroups>integration-test</excludedGroups>
</configuration>
</execution>
<!-- execution to run the integration tests against Elasticsearch -->
<execution>
<id>integration-test-elasticsearch</id>
<phase>${mvn.integration-test-elasticsearch.goal}</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<groups>integration-test</groups>
<systemPropertyVariables>
<sde.integration-test.environment>elasticsearch</sde.integration-test.environment>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>ci</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<checkstyleRules>
<module name="Checker">
<!-- Configure checker to use UTF-8 encoding -->
<property name="charset" value="UTF-8"/>
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck"/>
</module>
</checkstyleRules>
<includes>**/*</includes>
<excludes>
.git/**/*,target/**/*,**/target/**/*,.idea/**/*,**/spring.schemas,**/*.svg,mvnw,mvnw.cmd,**/*.policy
</excludes>
<sourceDirectories>./</sourceDirectories>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>antora-process-resources</id>
<build>
<resources>
<resource>
<directory>src/main/antora/resources/antora-resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
<profile>
<id>antora</id>
<build>
<plugins>
<plugin>
<groupId>org.antora</groupId>
<artifactId>antora-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>spring-snapshot</id>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>spring-milestone</id>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
</project>

29
settings.xml Normal file
View File

@ -0,0 +1,29 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>spring-plugins-release</id>
<username>${env.ARTIFACTORY_USR}</username>
<password>${env.ARTIFACTORY_PSW}</password>
</server>
<server>
<id>spring-libs-snapshot</id>
<username>${env.ARTIFACTORY_USR}</username>
<password>${env.ARTIFACTORY_PSW}</password>
</server>
<server>
<id>spring-libs-milestone</id>
<username>${env.ARTIFACTORY_USR}</username>
<password>${env.ARTIFACTORY_PSW}</password>
</server>
<server>
<id>spring-libs-release</id>
<username>${env.ARTIFACTORY_USR}</username>
<password>${env.ARTIFACTORY_PSW}</password>
</server>
</servers>
</settings>

View File

@ -0,0 +1,40 @@
# PACKAGES antora@3.2.0-alpha.2 @antora/atlas-extension:1.0.0-alpha.1 @antora/collector-extension@1.0.0-alpha.3 @springio/antora-extensions@1.1.0-alpha.2 @asciidoctor/tabs@1.0.0-alpha.12 @opendevise/antora-release-line-extension@1.0.0-alpha.2
#
# The purpose of this Antora playbook is to build the docs in the current branch.
antora:
extensions:
- require: '@springio/antora-extensions'
root_component_name: 'data-elasticsearch'
site:
title: Spring Data Elasticsearch
url: https://docs.spring.io/spring-data-elasticsearch/reference/
content:
sources:
- url: ./../../..
branches: HEAD
start_path: src/main/antora
worktrees: true
- url: https://github.com/spring-projects/spring-data-commons
# Refname matching:
# https://docs.antora.org/antora/latest/playbook/content-refname-matching/
branches: [ main, 3.4.x, 3.3.x ]
start_path: src/main/antora
asciidoc:
attributes:
hide-uri-scheme: '@'
tabs-sync-option: '@'
extensions:
- '@asciidoctor/tabs'
- '@springio/asciidoctor-extensions'
- '@springio/asciidoctor-extensions/javadoc-extension'
sourcemap: true
urls:
latest_version_segment: ''
runtime:
log:
failure_level: warn
format: pretty
ui:
bundle:
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.16/ui-bundle.zip
snapshot: true

View File

@ -0,0 +1,17 @@
name: data-elasticsearch
version: true
title: Spring Data Elasticsearch
nav:
- modules/ROOT/nav.adoc
ext:
collector:
- run:
command: ./mvnw validate process-resources -am -Pantora-process-resources
local: true
scan:
dir: target/classes/
- run:
command: ./mvnw package -Pdistribute
local: true
scan:
dir: target/antora

View File

@ -0,0 +1,47 @@
* xref:index.adoc[Overview]
** xref:commons/upgrade.adoc[]
** xref:migration-guides.adoc[]
*** xref:migration-guides/migration-guide-3.2-4.0.adoc[]
*** xref:migration-guides/migration-guide-4.0-4.1.adoc[]
*** xref:migration-guides/migration-guide-4.1-4.2.adoc[]
*** xref:migration-guides/migration-guide-4.2-4.3.adoc[]
*** xref:migration-guides/migration-guide-4.3-4.4.adoc[]
*** xref:migration-guides/migration-guide-4.4-5.0.adoc[]
*** xref:migration-guides/migration-guide-5.0-5.1.adoc[]
*** xref:migration-guides/migration-guide-5.1-5.2.adoc[]
*** xref:migration-guides/migration-guide-5.2-5.3.adoc[]
*** xref:migration-guides/migration-guide-5.3-5.4.adoc[]
*** xref:migration-guides/migration-guide-5.4-5.5.adoc[]
*** xref:migration-guides/migration-guide-5.5-6.0.adoc[]
* xref:elasticsearch.adoc[]
** xref:elasticsearch/clients.adoc[]
** xref:elasticsearch/object-mapping.adoc[]
** xref:elasticsearch/template.adoc[]
** xref:elasticsearch/reactive-template.adoc[]
** xref:elasticsearch/entity-callbacks.adoc[]
** xref:elasticsearch/auditing.adoc[]
** xref:elasticsearch/join-types.adoc[]
** xref:elasticsearch/routing.adoc[]
** xref:elasticsearch/misc.adoc[]
** xref:elasticsearch/scripted-and-runtime-fields.adoc[]
* xref:repositories.adoc[]
** xref:repositories/core-concepts.adoc[]
** xref:repositories/definition.adoc[]
** xref:elasticsearch/repositories/elasticsearch-repositories.adoc[]
** xref:elasticsearch/repositories/reactive-elasticsearch-repositories.adoc[]
** xref:repositories/create-instances.adoc[]
** xref:repositories/query-methods-details.adoc[]
** xref:elasticsearch/repositories/elasticsearch-repository-queries.adoc[]
** xref:repositories/projections.adoc[]
** xref:repositories/custom-implementations.adoc[]
** xref:repositories/core-domain-events.adoc[]
** xref:repositories/null-handling.adoc[]
** xref:elasticsearch/repositories/cdi-integration.adoc[]
** xref:repositories/query-keywords-reference.adoc[]
** xref:repositories/query-return-types-reference.adoc[]
* xref:attachment$api/java/index.html[Javadoc,role=link-external,window=_blank]
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki,role=link-external,window=_blank]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$upgrade.adoc[]

View File

@ -0,0 +1,16 @@
[[elasticsearch.core]]
= Elasticsearch Support
:page-section-summary-toc: 1
Spring Data support for Elasticsearch contains a wide range of features:
* Spring configuration support for various xref:elasticsearch/clients.adoc[Elasticsearch clients].
* The xref:elasticsearch/template.adoc[`ElasticsearchTemplate` and `ReactiveElasticsearchTemplate`] helper classes that provide object mapping between ES index operations and POJOs.
* xref:elasticsearch/template.adoc#exception-translation[Exception translation] into Spring's portable {springDocsUrl}data-access.html#dao-exceptions[Data Access Exception Hierarchy].
* Feature rich xref:elasticsearch/object-mapping.adoc[object mapping] integrated with _Spring's_ {springDocsUrl}core.html#core-convert[Conversion Service].
* xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.annotations[Annotation-based mapping] metadata that is extensible to support other metadata formats.
* Java-based xref:elasticsearch/template.adoc#cassandra.template.query[query, criteria, and update DSLs].
* Automatic implementation of xref:repositories.adoc[imperative and reactive `Repository` interfaces] including support for xref:repositories/custom-implementations.adoc[custom query methods].
For most data-oriented tasks, you can use the `[Reactive]ElasticsearchTemplate` or the `Repository` support, both of which use the rich object-mapping functionality.
Spring Data Elasticsearch uses consistent naming conventions on objects in various APIs to those found in the DataStax Java Driver so that they are familiar and so that you can map your existing knowledge onto the Spring APIs.

View File

@ -0,0 +1,85 @@
[[elasticsearch.auditing]]
= Elasticsearch Auditing
[[elasticsearch.auditing.preparing]]
== Preparing entities
In order for the auditing code to be able to decide whether an entity instance is new, the entity must implement the `Persistable<ID>` interface which is defined as follows:
[source,java]
----
package org.springframework.data.domain;
import org.jspecify.annotations.Nullable;
public interface Persistable<ID> {
@Nullable
ID getId();
boolean isNew();
}
----
As the existence of an Id is not a sufficient criterion to determine if an enitity is new in Elasticsearch, additional information is necessary. One way is to use the creation-relevant auditing fields for this decision:
A `Person` entity might look as follows - omitting getter and setter methods for brevity:
[source,java]
----
@Document(indexName = "person")
public class Person implements Persistable<Long> {
@Id private Long id;
private String lastName;
private String firstName;
@CreatedDate
@Field(type = FieldType.Date, format = DateFormat.basic_date_time)
private Instant createdDate;
@CreatedBy
private String createdBy
@Field(type = FieldType.Date, format = DateFormat.basic_date_time)
@LastModifiedDate
private Instant lastModifiedDate;
@LastModifiedBy
private String lastModifiedBy;
public Long getId() { // <.>
return id;
}
@Override
public boolean isNew() {
return id == null || (createdDate == null && createdBy == null); // <.>
}
}
----
<.> the getter is the required implementation from the interface
<.> an object is new if it either has no `id` or none of fields containing creation attributes are set.
[[elasticsearch.auditing.activating]]
== Activating auditing
After the entities have been set up and providing the `AuditorAware` - or `ReactiveAuditorAware` - the Auditing must be activated by setting the `@EnableElasticsearchAuditing` on a configuration class:
[source,java]
----
@Configuration
@EnableElasticsearchRepositories
@EnableElasticsearchAuditing
class MyConfiguration {
// configuration code
}
----
When using the reactive stack this must be:
[source,java]
----
@Configuration
@EnableReactiveElasticsearchRepositories
@EnableReactiveElasticsearchAuditing
class MyConfiguration {
// configuration code
}
----
If your code contains more than one `AuditorAware` bean for different types, you must provide the name of the bean to use as an argument to the `auditorAwareRef` parameter of the
`@EnableElasticsearchAuditing` annotation.

View File

@ -0,0 +1,460 @@
[[elasticsearch.clients]]
= Elasticsearch Clients
This chapter illustrates configuration and usage of supported Elasticsearch client implementations.
Spring Data Elasticsearch operates upon an Elasticsearch client (provided by Elasticsearch client libraries) that is connected to a single Elasticsearch node or a cluster.
Although the Elasticsearch Client can be used directly to work with the cluster, applications using Spring Data Elasticsearch normally use the higher level abstractions of xref:elasticsearch/template.adoc[Elasticsearch Operations] and xref:elasticsearch/repositories/elasticsearch-repositories.adoc[Elasticsearch Repositories].
[[elasticsearch.clients.rest5client]]
== Imperative Rest5Client
To use the imperative (non-reactive) Rest5Client, a configuration bean must be configured like this:
====
[source,java]
----
import org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration;
@Configuration
public class MyClientConfig extends ElasticsearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder() <.>
.connectedTo("localhost:9200")
.build();
}
}
----
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
====
The javadoc:org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration[] class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
The following beans can then be injected in other Spring components:
====
[source,java]
----
import org.springframework.beans.factory.annotation.Autowired;@Autowired
ElasticsearchOperations operations; <.>
@Autowired
ElasticsearchClient elasticsearchClient; <.>
@Autowired
Rest5Client rest5Client; <.>
@Autowired
JsonpMapper jsonpMapper; <.>
----
<.> an implementation of javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[]
<.> the `co.elastic.clients.elasticsearch.ElasticsearchClient` that is used.
<.> the low level `Rest5Client` from the Elasticsearch libraries
<.> the `JsonpMapper` user by the Elasticsearch `Transport`
====
Basically one should just use the javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[] to interact with the Elasticsearch cluster.
When using repositories, this instance is used under the hood as well.
[[elasticsearch.clients.restclient]]
== Deprecated Imperative RestClient
To use the imperative (non-reactive) RestClient - deprecated since version 6 - , the following dependency needs to be added, adapt the correct version. The exclusion is needed in a Spring Boot application:
====
[source,xml]
----
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>${elasticsearch-client.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
----
====
The configuration bean must be configured like this:
====
[source,java]
----
import org.springframework.data.elasticsearch.client.elc.ElasticsearchLegacyRestClientConfiguration;
@Configuration
public class MyClientConfig extends ElasticsearchLegacyRestClientConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder() <.>
.connectedTo("localhost:9200")
.build();
}
}
----
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
====
The javadoc:org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration[] class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
The following beans can then be injected in other Spring components:
====
[source,java]
----
import org.springframework.beans.factory.annotation.Autowired;@Autowired
ElasticsearchOperations operations; <.>
@Autowired
ElasticsearchClient elasticsearchClient; <.>
@Autowired
RestClient restClient; <.>
@Autowired
JsonpMapper jsonpMapper; <.>
----
<.> an implementation of javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[]
<.> the `co.elastic.clients.elasticsearch.ElasticsearchClient` that is used.
<.> the low level `RestClient` from the Elasticsearch libraries
<.> the `JsonpMapper` user by the Elasticsearch `Transport`
====
Basically one should just use the javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[] to interact with the Elasticsearch cluster.
When using repositories, this instance is used under the hood as well.
[[elasticsearch.clients.reactiverest5client]]
== Reactive Rest5Client
When working with the reactive stack, the configuration must be derived from a different class:
====
[source,java]
----
import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchConfiguration;
@Configuration
public class MyClientConfig extends ReactiveElasticsearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder() <.>
.connectedTo("localhost:9200")
.build();
}
}
----
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
====
The javadoc:org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchConfiguration[] class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
The following beans can then be injected in other Spring components:
====
[source,java]
----
@Autowired
ReactiveElasticsearchOperations operations; <.>
@Autowired
ReactiveElasticsearchClient elasticsearchClient; <.>
@Autowired
Rest5Client rest5Client; <.>
@Autowired
JsonpMapper jsonpMapper; <.>
----
the following can be injected:
<.> an implementation of javadoc:org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations[]
<.> the `org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient` that is used.
This is a reactive implementation based on the Elasticsearch client implementation.
<.> the low level `RestClient` from the Elasticsearch libraries
<.> the `JsonpMapper` user by the Elasticsearch `Transport`
====
Basically one should just use the javadoc:org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations[] to interact with the Elasticsearch cluster.
When using repositories, this instance is used under the hood as well.
[[elasticsearch.clients.reactiverestclient]]
== Deprecated Reactive RestClient
See the section above for the imperative code to use the deprecated RestClient for the necessary dependencies to include.
When working with the reactive stack, the configuration must be derived from a different class:
====
[source,java]
----
import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchLegacyRestClientConfiguration;
@Configuration
public class MyClientConfig extends ReactiveElasticsearchLegacyRestClientConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder() <.>
.connectedTo("localhost:9200")
.build();
}
}
----
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
====
The javadoc:org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchConfiguration[] class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
The following beans can then be injected in other Spring components:
====
[source,java]
----
@Autowired
ReactiveElasticsearchOperations operations; <.>
@Autowired
ReactiveElasticsearchClient elasticsearchClient; <.>
@Autowired
RestClient restClient; <.>
@Autowired
JsonpMapper jsonpMapper; <.>
----
the following can be injected:
<.> an implementation of javadoc:org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations[]
<.> the `org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient` that is used.
This is a reactive implementation based on the Elasticsearch client implementation.
<.> the low level `RestClient` from the Elasticsearch libraries
<.> the `JsonpMapper` user by the Elasticsearch `Transport`
====
Basically one should just use the javadoc:org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations[] to interact with the Elasticsearch cluster.
When using repositories, this instance is used under the hood as well.
[[elasticsearch.clients.configuration]]
== Client Configuration
Client behaviour can be changed via the javadoc:org.springframework.data.elasticsearch.client.ClientConfiguration[] that allows to set options for SSL, connect and socket timeouts, headers and other parameters.
.Client Configuration
====
[source,java]
----
import org.springframework.data.elasticsearch.client.ClientConfiguration;
import org.springframework.data.elasticsearch.support.HttpHeaders;
import static org.springframework.data.elasticsearch.client.elc.ElasticsearchClients.*;
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("some-header", "on every request") <.>
ClientConfiguration clientConfiguration = ClientConfiguration.builder()
.connectedTo("localhost:9200", "localhost:9291") <.>
.usingSsl() <.>
.withProxy("localhost:8888") <.>
.withPathPrefix("ela") <.>
.withConnectTimeout(Duration.ofSeconds(5)) <.>
.withSocketTimeout(Duration.ofSeconds(3)) <.>
.withDefaultHeaders(defaultHeaders) <.>
.withBasicAuth(username, password) <.>
.withHeaders(() -> { <.>
HttpHeaders headers = new HttpHeaders();
headers.add("currentTime", LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
return headers;
})
.withClientConfigurer( <.>
ElasticsearchHttpClientConfigurationCallback.from(clientBuilder -> {
// ...
return clientBuilder;
}))
. // ... other options
.build();
----
<.> Define default headers, if they need to be customized
<.> Use the builder to provide cluster addresses, set default `HttpHeaders` or enable SSL.
<.> Optionally enable SSL.There exist overloads of this function that can take a `SSLContext` or as an alternative the fingerprint of the certificate as it is output by Elasticsearch 8 on startup.
<.> Optionally set a proxy.
<.> Optionally set a path prefix, mostly used when different clusters a behind some reverse proxy.
<.> Set the connection timeout.
<.> Set the socket timeout.
<.> Optionally set headers.
<.> Add basic authentication.
<.> A `Supplier<HttpHeaders>` function can be specified which is called every time before a request is sent to Elasticsearch - here, as an example, the current time is written in a header.
<.> a function to configure the created client (see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration.callbacks[Client configuration callbacks]), can be added multiple times.
====
IMPORTANT: Adding a Header supplier as shown in above example allows to inject headers that may change over the time, like authentication JWT tokens.
If this is used in the reactive setup, the supplier function *must not* block!
[[elasticsearch.clients.configuration.callbacks]]
=== Client configuration callbacks
The javadoc:org.springframework.data.elasticsearch.client.ClientConfiguration[] class offers the most common parameters to configure the client.
In the case this is not enough, the user can add callback functions by using the `withClientConfigurer(ClientConfigurationCallback<?>)` method.
The following callbacks are provided:
[[elasticsearch.clients.configuration.callbacks.rest5]]
==== Configuration of the low level Elasticsearch `Rest5Client`:
This callback provides a `org.elasticsearch.client.RestClientBuilder` that can be used to configure the Elasticsearch
`RestClient`:
====
[source,java]
----
ClientConfiguration.builder()
.connectedTo("localhost:9200", "localhost:9291")
.withClientConfigurer(Rest5Clients.ElasticsearchRest5ClientConfigurationCallback.from(restClientBuilder -> {
// configure the Elasticsearch Rest5Client
return restClientBuilder;
}))
.build();
----
====
[[elasticsearch.clients.configuration.callbacks.rest]]
==== Configuration of the deprecated low level Elasticsearch `RestClient`:
This callback provides a `org.elasticsearch.client.RestClientBuilder` that can be used to configure the Elasticsearch
`RestClient`:
====
[source,java]
----
ClientConfiguration.builder()
.connectedTo("localhost:9200", "localhost:9291")
.withClientConfigurer(RestClients.ElasticsearchRestClientConfigurationCallback.from(restClientBuilder -> {
// configure the Elasticsearch RestClient
return restClientBuilder;
}))
.build();
----
====
[[elasticsearch.clients.configurationcallbacks.httpasync5]]
==== Configuration of the HttpAsyncClient used by the low level Elasticsearch `Rest5Client`:
This callback provides a `org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder` to configure the HttpClient that is
used by the `Rest5Client`.
====
[source,java]
----
ClientConfiguration.builder()
.connectedTo("localhost:9200", "localhost:9291")
.withClientConfigurer(Rest5Clients.ElasticsearchHttpClientConfigurationCallback.from(httpAsyncClientBuilder -> {
// configure the HttpAsyncClient
return httpAsyncClientBuilder;
}))
.build();
----
====
[[elasticsearch.clients.configurationcallbacks.httpasync]]
==== Configuration of the HttpAsyncClient used by the deprecated low level Elasticsearch `RestClient`:
This callback provides a `org.apache.http.impl.nio.client.HttpAsyncClientBuilder` to configure the HttpClient that is
used by the `RestClient`.
====
[source,java]
----
ClientConfiguration.builder()
.connectedTo("localhost:9200", "localhost:9291")
.withClientConfigurer(RestClients.ElasticsearchHttpClientConfigurationCallback.from(httpAsyncClientBuilder -> {
// configure the HttpAsyncClient
return httpAsyncClientBuilder;
}))
.build();
----
====
[[elasticsearch.clients.configurationcallbacks.connectionconfig]]
==== Configuration of the ConnectionConfig used by the low level Elasticsearch `Rest5Client`:
This callback provides a `org.apache.hc.client5.http.config.ConnectionConfig` to configure the connection that is
used by the `Rest5Client`.
====
[source,java]
----
ClientConfiguration.builder()
.connectedTo("localhost:9200", "localhost:9291")
.withClientConfigurer(Rest5Clients.ElasticsearchConnectionConfigurationCallback.from(connectionConfigBuilder -> {
// configure the connection
return connectionConfigBuilder;
}))
.build();
----
====
[[elasticsearch.clients.configurationcallbacks.connectioncmanager]]
==== Configuration of the ConnectionManager used by the low level Elasticsearch `Rest5Client`:
This callback provides a `org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder` to configure the connection manager that is
used by the `Rest5Client`.
====
[source,java]
----
ClientConfiguration.builder()
.connectedTo("localhost:9200", "localhost:9291")
.withClientConfigurer(Rest5Clients.ElasticsearchConnectionManagerCallback.from(connectionManagerBuilder -> {
// configure the connection manager
return connectionManagerBuilder;
}))
.build();
----
====
[[elasticsearch.clients.configurationcallbacks.requestconfig]]
==== Configuration of the RequestConfig used by the low level Elasticsearch `Rest5Client`:
This callback provides a `org.apache.hc.client5.http.config.RequestConfig` to configure the RequestConfig that is
used by the `Rest5Client`.
====
[source,java]
----
ClientConfiguration.builder()
.connectedTo("localhost:9200", "localhost:9291")
.withClientConfigurer(Rest5Clients.ElasticsearchRequestConfigCallback.from(requestConfigBuilder -> {
// configure the request config
return requestConfigBuilder;
}))
.build();
----
====
[[elasticsearch.clients.logging]]
== Client Logging
To see what is actually sent to and received from the server `Request` / `Response` logging on the transport level needs to be turned on as outlined in the snippet below.
This can be enabled in the Elasticsearch client by setting the level of the `tracer` package to "trace" (see
https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/java-rest-low-usage-logging.html)
.Enable transport layer logging
[source,xml]
----
<logger name="tracer" level="trace"/>
----

View File

@ -0,0 +1,122 @@
[[new-features]]
= What's new
[[new-features.6-0-0]]
== New in Spring Data Elasticsearch 6.0
* Upgarde to Spring 7
* Switch to jspecify nullability annotations
* Upgrade to Elasticsearch 9.0.4
* Use the new Elasticsearch Rest5Client as default
[[new-features.5-5-0]]
== New in Spring Data Elasticsearch 5.5
* Upgrade to Elasticsearch 8.18.1.
* Add support for the `@SearchTemplateQuery` annotation on repository methods.
* Scripted field properties of type collection can be populated from scripts returning arrays.
[[new-features.5-4-0]]
== New in Spring Data Elasticsearch 5.4
* Upgrade to Elasticsearch 8.15.3.
* Allow to customize the mapped type name for `@InnerField` and `@Field` annotations.
* Support for Elasticsearch SQL.
* Add support for retrieving request executionDuration.
[[new-features.5-3-0]]
== New in Spring Data Elasticsearch 5.3
* Upgrade to Elasticsearch 8.13.2.
* Add support for highlight queries in highlighting.
* Add shard statistics to the `SearchHit` class.
* Add support for multi search template API.
* Add support for SpEL in @Query.
* Add support for field aliases in the index mapping.
* Add support for has_child and has_parent queries.
[[new-features.5-2-0]]
== New in Spring Data Elasticsearch 5.2
* Upgrade to Elasticsearch 8.11.1
* The `JsonpMapper` for Elasticsearch is now configurable and provided as bean.
* Improved AOT runtime hints for Elasticsearch client library classes.
* Add Kotlin extensions and repository coroutine support.
* Introducing `VersionConflictException` class thrown in case thatElasticsearch reports an 409 error with a version conflict.
* Enable MultiField annotation on property getter
* Support nested sort option
* Improved scripted und runtime field support
* Improved refresh policy support
[[new-features.5-1-0]]
== New in Spring Data Elasticsearch 5.1
* Upgrade to Elasticsearch 8.7.1
* Allow specification of the TLS certificate when connecting to an Elasticsearch 8 cluster
[[new-features.5-0-0]]
== New in Spring Data Elasticsearch 5.0
* Upgrade to Java 17 baseline
* Upgrade to Spring Framework 6
* Upgrade to Elasticsearch 8.5.0
* Use the new Elasticsearch client library
[[new-features.4-4-0]]
== New in Spring Data Elasticsearch 4.4
* Introduction of new imperative and reactive clients using the classes from the new Elasticsearch Java client
* Upgrade to Elasticsearch 7.17.3.
[[new-features.4-3-0]]
== New in Spring Data Elasticsearch 4.3
* Upgrade to Elasticsearch 7.15.2.
* Allow runtime_fields to be defined in the index mapping.
* Add native support for range field types by using a range object.
* Add repository search for nullable or empty properties.
* Enable custom converters for single fields.
* Supply a custom `Sort.Order` providing Elasticsearch specific parameters.
[[new-features.4-2-0]]
== New in Spring Data Elasticsearch 4.2
* Upgrade to Elasticsearch 7.10.0.
* Support for custom routing values
[[new-features.4-1-0]]
== New in Spring Data Elasticsearch 4.1
* Uses Spring 5.3.
* Upgrade to Elasticsearch 7.9.3.
* Improved API for alias management.
* Introduction of `ReactiveIndexOperations` for index management.
* Index templates support.
* Support for Geo-shape data with GeoJson.
[[new-features.4-0-0]]
== New in Spring Data Elasticsearch 4.0
* Uses Spring 5.2.
* Upgrade to Elasticsearch 7.6.2.
* Deprecation of `TransportClient` usage.
* Implements most of the mapping-types available for the index mappings.
* Removal of the Jackson `ObjectMapper`, now using the xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model[MappingElasticsearchConverter]
* Cleanup of the API in the `*Operations` interfaces, grouping and renaming methods so that they match the Elasticsearch API, deprecating the old methods, aligning with other Spring Data modules.
* Introduction of `SearchHit<T>` class to represent a found document together with the relevant result metadata for this document (i.e. _sortValues_).
* Introduction of the `SearchHits<T>` class to represent a whole search result together with the metadata for the complete search result (i.e. _max_score_).
* Introduction of `SearchPage<T>` class to represent a paged result containing a `SearchHits<T>` instance.
* Introduction of the `GeoDistanceOrder` class to be able to create sorting by geographical distance
* Implementation of Auditing Support
* Implementation of lifecycle entity callbacks
[[new-features.3-2-0]]
== New in Spring Data Elasticsearch 3.2
* Secured Elasticsearch cluster support with Basic Authentication and SSL transport.
* Upgrade to Elasticsearch 6.8.1.
* Reactive programming support with xref:elasticsearch/repositories/reactive-elasticsearch-repositories.adoc[Reactive Elasticsearch Repositories] and xref:.
* Introduction of the xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model[ElasticsearchEntityMapper] as an alternative to the Jackson `ObjectMapper`.
* Field name customization in `@Field`.
* Support for Delete by Query.

View File

@ -0,0 +1,42 @@
include::{commons}@data-commons::page$entity-callbacks.adoc[]
[[elasticsearch.entity-callbacks]]
== Store specific EntityCallbacks
Spring Data Elasticsearch uses the `EntityCallback` API internally for its auditing support and reacts on the following callbacks:
.Supported Entity Callbacks
[%header,cols="4"]
|===
| Callback
| Method
| Description
| Order
| Reactive/BeforeConvertCallback
| `onBeforeConvert(T entity, IndexCoordinates index)`
| Invoked before a domain object is converted to `org.springframework.data.elasticsearch.core.document.Document`.
Can return the `entity` or a modified entity which then will be converted.
| `Ordered.LOWEST_PRECEDENCE`
| Reactive/AfterLoadCallback
| `onAfterLoad(Document document, Class<T> type, IndexCoordinates indexCoordinates)`
| Invoked after the result from Elasticsearch has been read into a `org.springframework.data.elasticsearch.core.document.Document`.
| `Ordered.LOWEST_PRECEDENCE`
| Reactive/AfterConvertCallback
| `onAfterConvert(T entity, Document document, IndexCoordinates indexCoordinates)`
| Invoked after a domain object is converted from `org.springframework.data.elasticsearch.core.document.Document` on reading result data from Elasticsearch.
| `Ordered.LOWEST_PRECEDENCE`
| Reactive/AuditingEntityCallback
| `onBeforeConvert(Object entity, IndexCoordinates index)`
| Marks an auditable entity _created_ or _modified_
| 100
| Reactive/AfterSaveCallback
| `T onAfterSave(T entity, IndexCoordinates index)`
| Invoked after a domain object is saved.
| `Ordered.LOWEST_PRECEDENCE`
|===

View File

@ -0,0 +1,239 @@
[[elasticsearch.jointype]]
= Join-Type implementation
Spring Data Elasticsearch supports the https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html[Join data type] for creating the corresponding index mappings and for storing the relevant information.
[[elasticsearch.jointype.setting-up]]
== Setting up the data
For an entity to be used in a parent child join relationship, it must have a property of type `JoinField` which must be annotated.
Let's assume a `Statement` entity where a statement may be a _question_, an _answer_, a _comment_ or a _vote_ (a _Builder_ is also shown in this example, it's not necessary, but later used in the sample code):
====
[source,java]
----
@Document(indexName = "statements")
@Routing("routing") <.>
public class Statement {
@Id
private String id;
@Field(type = FieldType.Text)
private String text;
@Field(type = FieldType.Keyword)
private String routing;
@JoinTypeRelations(
relations =
{
@JoinTypeRelation(parent = "question", children = {"answer", "comment"}), <.>
@JoinTypeRelation(parent = "answer", children = "vote") <.>
}
)
private JoinField<String> relation; <.>
private Statement() {
}
public static StatementBuilder builder() {
return new StatementBuilder();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getRouting() {
return routing;
}
public void setRouting(String routing) {
this.routing = routing;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public JoinField<String> getRelation() {
return relation;
}
public void setRelation(JoinField<String> relation) {
this.relation = relation;
}
public static final class StatementBuilder {
private String id;
private String text;
private String routing;
private JoinField<String> relation;
private StatementBuilder() {
}
public StatementBuilder withId(String id) {
this.id = id;
return this;
}
public StatementBuilder withRouting(String routing) {
this.routing = routing;
return this;
}
public StatementBuilder withText(String text) {
this.text = text;
return this;
}
public StatementBuilder withRelation(JoinField<String> relation) {
this.relation = relation;
return this;
}
public Statement build() {
Statement statement = new Statement();
statement.setId(id);
statement.setRouting(routing);
statement.setText(text);
statement.setRelation(relation);
return statement;
}
}
}
----
<.> for routing related info see xref:elasticsearch/routing.adoc[Routing values]
<.> a question can have answers and comments
<.> an answer can have votes
<.> the `JoinField` property is used to combine the name (_question_, _answer_, _comment_ or _vote_) of the relation with the parent id.
The generic type must be the same as the `@Id` annotated property.
====
Spring Data Elasticsearch will build the following mapping for this class:
====
[source,json]
----
{
"statements": {
"mappings": {
"properties": {
"_class": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"routing": {
"type": "keyword"
},
"relation": {
"type": "join",
"eager_global_ordinals": true,
"relations": {
"question": [
"answer",
"comment"
],
"answer": "vote"
}
},
"text": {
"type": "text"
}
}
}
}
}
----
====
[[elasticsearch.jointype.storing]]
== Storing data
Given a repository for this class the following code inserts a question, two answers, a comment and a vote:
====
[source,java]
----
void init() {
repository.deleteAll();
Statement savedWeather = repository.save(
Statement.builder()
.withText("How is the weather?")
.withRelation(new JoinField<>("question")) <1>
.build());
Statement sunnyAnswer = repository.save(
Statement.builder()
.withText("sunny")
.withRelation(new JoinField<>("answer", savedWeather.getId())) <2>
.build());
repository.save(
Statement.builder()
.withText("rainy")
.withRelation(new JoinField<>("answer", savedWeather.getId())) <3>
.build());
repository.save(
Statement.builder()
.withText("I don't like the rain")
.withRelation(new JoinField<>("comment", savedWeather.getId())) <4>
.build());
repository.save(
Statement.builder()
.withText("+1 for the sun")
.withRouting(savedWeather.getId())
.withRelation(new JoinField<>("vote", sunnyAnswer.getId())) <5>
.build());
}
----
<1> create a question statement
<2> the first answer to the question
<3> the second answer
<4> a comment to the question
<5> a vote for the first answer, this needs to have the routing set to the weather document, see xref:elasticsearch/routing.adoc[Routing values].
====
[[elasticsearch.jointype.retrieving]]
== Retrieving data
Currently native queries must be used to query the data, so there is no support from standard repository methods. xref:repositories/custom-implementations.adoc[] can be used instead.
The following code shows as an example how to retrieve all entries that have a _vote_ (which must be _answers_, because only answers can have a vote) using an `ElasticsearchOperations` instance:
====
[source,java]
----
SearchHits<Statement> hasVotes() {
Query query = NativeQuery.builder()
.withQuery(co.elastic.clients.elasticsearch._types.query_dsl.Query.of(qb -> qb
.hasChild(hc -> hc
.type("answer")
.queryName("vote")
.query(matchAllQueryAsQuery())
.scoreMode(ChildScoreMode.None)
)))
.build();
return operations.search(query, Statement.class);
}
----
====

View File

@ -0,0 +1,453 @@
[[elasticsearch.misc]]
= Miscellaneous Elasticsearch Operation Support
This chapter covers additional support for Elasticsearch operations that cannot be directly accessed via the repository interface.
It is recommended to add those operations as custom implementation as described in xref:repositories/custom-implementations.adoc[] .
[[elasticsearc.misc.index.settings]]
== Index settings
When creating Elasticsearch indices with Spring Data Elasticsearch different index settings can be defined by using the `@Setting` annotation.
The following arguments are available:
* `useServerConfiguration` does not send any settings parameters, so the Elasticsearch server configuration determines them.
* `settingPath` refers to a JSON file defining the settings that must be resolvable in the classpath
* `shards` the number of shards to use, defaults to _1_
* `replicas` the number of replicas, defaults to _1_
* `refreshIntervall`, defaults to _"1s"_
* `indexStoreType`, defaults to _"fs"_
It is as well possible to define https://www.elastic.co/guide/en/elasticsearch/reference/7.11/index-modules-index-sorting.html[index sorting] (check the linked Elasticsearch documentation for the possible field types and values):
====
[source,java]
----
@Document(indexName = "entities")
@Setting(
sortFields = { "secondField", "firstField" }, <.>
sortModes = { Setting.SortMode.max, Setting.SortMode.min }, <.>
sortOrders = { Setting.SortOrder.desc, Setting.SortOrder.asc },
sortMissingValues = { Setting.SortMissing._last, Setting.SortMissing._first })
class Entity {
@Nullable
@Id private String id;
@Nullable
@Field(name = "first_field", type = FieldType.Keyword)
private String firstField;
@Nullable @Field(name = "second_field", type = FieldType.Keyword)
private String secondField;
// getter and setter...
}
----
<.> when defining sort fields, use the name of the Java property (_firstField_), not the name that might be defined for Elasticsearch (_first_field_)
<.> `sortModes`, `sortOrders` and `sortMissingValues` are optional, but if they are set, the number of entries must match the number of `sortFields` elements
====
[[elasticsearch.misc.mappings]]
== Index Mapping
When Spring Data Elasticsearch creates the index mapping with the `IndexOperations.createMapping()` methods, it uses the annotations described in xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.annotations[Mapping Annotation Overview], especially the `@Field` annotation.
In addition to that it is possible to add the `@Mapping` annotation to a class.
This annotation has the following properties:
* `mappingPath` a classpath resource in JSON format; if this is not empty it is used as the mapping, no other mapping processing is done.
* `enabled` when set to false, this flag is written to the mapping and no further processing is done.
* `dateDetection` and `numericDetection` set the corresponding properties in the mapping when not set to `DEFAULT`.
* `dynamicDateFormats` when this String array is not empty, it defines the date formats used for automatic date detection.
* `runtimeFieldsPath` a classpath resource in JSON format containing the definition of runtime fields which is written to the index mappings, for example:
====
[source,json]
----
{
"day_of_week": {
"type": "keyword",
"script": {
"source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
}
}
}
----
====
[[elasticsearch.misc.filter]]
== Filter Builder
Filter Builder improves query speed.
====
[source,java]
----
private ElasticsearchOperations operations;
IndexCoordinates index = IndexCoordinates.of("sample-index");
Query query = NativeQuery.builder()
.withQuery(q -> q
.matchAll(ma -> ma))
.withFilter( q -> q
.bool(b -> b
.must(m -> m
.term(t -> t
.field("id")
.value(documentId))
)))
.build();
SearchHits<SampleEntity> sampleEntities = operations.search(query, SampleEntity.class, index);
----
====
[[elasticsearch.scroll]]
== Using Scroll For Big Result Set
Elasticsearch has a scroll API for getting big result set in chunks.
This is internally used by Spring Data Elasticsearch to provide the implementations of the `<T> SearchHitsIterator<T> SearchOperations.searchForStream(Query query, Class<T> clazz, IndexCoordinates index)` method.
====
[source,java]
----
IndexCoordinates index = IndexCoordinates.of("sample-index");
Query searchQuery = NativeQuery.builder()
.withQuery(q -> q
.matchAll(ma -> ma))
.withFields("message")
.withPageable(PageRequest.of(0, 10))
.build();
SearchHitsIterator<SampleEntity> stream = elasticsearchOperations.searchForStream(searchQuery, SampleEntity.class,
index);
List<SampleEntity> sampleEntities = new ArrayList<>();
while (stream.hasNext()) {
sampleEntities.add(stream.next());
}
stream.close();
----
====
There are no methods in the `SearchOperations` API to access the scroll id, if it should be necessary to access this, the following methods of the `AbstractElasticsearchTemplate` can be used (this is the base implementation for the different `ElasticsearchOperations` implementations):
====
[source,java]
----
@Autowired ElasticsearchOperations operations;
AbstractElasticsearchTemplate template = (AbstractElasticsearchTemplate)operations;
IndexCoordinates index = IndexCoordinates.of("sample-index");
Query query = NativeQuery.builder()
.withQuery(q -> q
.matchAll(ma -> ma))
.withFields("message")
.withPageable(PageRequest.of(0, 10))
.build();
SearchScrollHits<SampleEntity> scroll = template.searchScrollStart(1000, query, SampleEntity.class, index);
String scrollId = scroll.getScrollId();
List<SampleEntity> sampleEntities = new ArrayList<>();
while (scroll.hasSearchHits()) {
sampleEntities.addAll(scroll.getSearchHits());
scrollId = scroll.getScrollId();
scroll = template.searchScrollContinue(scrollId, 1000, SampleEntity.class);
}
template.searchScrollClear(scrollId);
----
====
To use the Scroll API with repository methods, the return type must defined as `Stream` in the Elasticsearch Repository.
The implementation of the method will then use the scroll methods from the ElasticsearchTemplate.
====
[source,java]
----
interface SampleEntityRepository extends Repository<SampleEntity, String> {
Stream<SampleEntity> findBy();
}
----
====
[[elasticsearch.misc.sorts]]
== Sort options
In addition to the default sort options described in xref:repositories/query-methods-details.adoc#repositories.paging-and-sorting[Paging and Sorting], Spring Data Elasticsearch provides the class `org.springframework.data.elasticsearch.core.query.Order` which derives from `org.springframework.data.domain.Sort.Order`.
It offers additional parameters that can be sent to Elasticsearch when specifying the sorting of the result (see https://www.elastic.co/guide/en/elasticsearch/reference/7.15/sort-search-results.html).
There also is the `org.springframework.data.elasticsearch.core.query.GeoDistanceOrder` class which can be used to have the result of a search operation ordered by geographical distance.
If the class to be retrieved has a `GeoPoint` property named _location_, the following `Sort` would sort the results by distance to the given point:
====
[source,java]
----
Sort.by(new GeoDistanceOrder("location", new GeoPoint(48.137154, 11.5761247)))
----
====
[[elasticsearch.misc.runtime-fields]]
== Runtime Fields
From version 7.12 on Elasticsearch has added the feature of runtime fields (https://www.elastic.co/guide/en/elasticsearch/reference/7.12/runtime.html).
Spring Data Elasticsearch supports this in two ways:
[[elasticsearch.misc.runtime-fields.index-mappings]]
=== Runtime field definitions in the index mappings
The first way to define runtime fields is by adding the definitions to the index mappings (see https://www.elastic.co/guide/en/elasticsearch/reference/7.12/runtime-mapping-fields.html).
To use this approach in Spring Data Elasticsearch the user must provide a JSON file that contains the corresponding definition, for example:
.runtime-fields.json
====
[source,json]
----
{
"day_of_week": {
"type": "keyword",
"script": {
"source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
}
}
}
----
====
The path to this JSON file, which must be present on the classpath, must then be set in the `@Mapping` annotation of the entity:
====
[source,java]
----
@Document(indexName = "runtime-fields")
@Mapping(runtimeFieldsPath = "/runtime-fields.json")
public class RuntimeFieldEntity {
// properties, getter, setter,...
}
----
====
[[elasticsearch.misc.runtime-fields.query]]
=== Runtime fields definitions set on a Query
The second way to define runtime fields is by adding the definitions to a search query (see https://www.elastic.co/guide/en/elasticsearch/reference/7.12/runtime-search-request.html).
The following code example shows how to do this with Spring Data Elasticsearch :
The entity used is a simple object that has a `price` property:
====
[source,java]
----
@Document(indexName = "some_index_name")
public class SomethingToBuy {
private @Id @Nullable String id;
@Nullable @Field(type = FieldType.Text) private String description;
@Nullable @Field(type = FieldType.Double) private Double price;
// getter and setter
}
----
====
The following query uses a runtime field that calculates a `priceWithTax` value by adding 19% to the price and uses this value in the search query to find all entities where `priceWithTax` is higher or equal than a given value:
====
[source,java]
----
RuntimeField runtimeField = new RuntimeField("priceWithTax", "double", "emit(doc['price'].value * 1.19)");
Query query = new CriteriaQuery(new Criteria("priceWithTax").greaterThanEqual(16.5));
query.addRuntimeField(runtimeField);
SearchHits<SomethingToBuy> searchHits = operations.search(query, SomethingToBuy.class);
----
====
This works with every implementation of the `Query` interface.
[[elasticsearch.misc.point-in-time]]
== Point In Time (PIT) API
`ElasticsearchOperations` supports the point in time API of Elasticsearch (see https://www.elastic.co/guide/en/elasticsearch/reference/8.3/point-in-time-api.html).
The following code snippet shows how to use this feature with a fictional `Person` class:
====
[source,java]
----
ElasticsearchOperations operations; // autowired
Duration tenSeconds = Duration.ofSeconds(10);
String pit = operations.openPointInTime(IndexCoordinates.of("person"), tenSeconds); <.>
// create query for the pit
Query query1 = new CriteriaQueryBuilder(Criteria.where("lastName").is("Smith"))
.withPointInTime(new Query.PointInTime(pit, tenSeconds)) <.>
.build();
SearchHits<Person> searchHits1 = operations.search(query1, Person.class);
// do something with the data
// create 2nd query for the pit, use the id returned in the previous result
Query query2 = new CriteriaQueryBuilder(Criteria.where("lastName").is("Miller"))
.withPointInTime(
new Query.PointInTime(searchHits1.getPointInTimeId(), tenSeconds)) <.>
.build();
SearchHits<Person> searchHits2 = operations.search(query2, Person.class);
// do something with the data
operations.closePointInTime(searchHits2.getPointInTimeId()); <.>
----
<.> create a point in time for an index (can be multiple names) and a keep-alive duration and retrieve its id
<.> pass that id into the query to search together with the next keep-alive value
<.> for the next query, use the id returned from the previous search
<.> when done, close the point in time using the last returned id
====
[[elasticsearch.misc.searchtemplates]]
== Search Template support
Use of the search template API is supported.
To use this, it first is necessary to create a stored script.
The `ElasticsearchOperations` interface extends `ScriptOperations` which provides the necessary functions.
The example used here assumes that we have `Person` entity with a property named `firstName`.
A search template script can be saved like this:
====
[source,java]
----
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import org.springframework.data.elasticsearch.core.script.Script;
operations.putScript( <.>
Script.builder()
.withId("person-firstname") <.>
.withLanguage("mustache") <.>
.withSource(""" <.>
{
"query": {
"bool": {
"must": [
{
"match": {
"firstName": "{{firstName}}" <.>
}
}
]
}
},
"from": "{{from}}", <.>
"size": "{{size}}" <.>
}
""")
.build()
);
----
<.> Use the `putScript()` method to store a search template script
<.> The name / id of the script
<.> Scripts that are used in search templates must be in the _mustache_ language.
<.> The script source
<.> The search parameter in the script
<.> Paging request offset
<.> Paging request size
====
To use a search template in a search query, Spring Data Elasticsearch provides the `SearchTemplateQuery`, an implementation of the `org.springframework.data.elasticsearch.core.query.Query` interface.
NOTE: Although `SearchTemplateQuery` is an implementation of the `Query` interface, not all of the functionality provided by the base class is available for a `SearchTemplateQuery` like setting a `Pageable` or a `Sort`. Values for this functionality must be added to the stored script like shown in the following example for paging parameters. If these values are set on the `Query` object, they will be ignored.
In the following code, we will add a call using a search template query to a custom repository implementation (see
xref:repositories/custom-implementations.adoc[]) as an example how this can be integrated into a repository call.
We first define the custom repository fragment interface:
====
[source,java]
----
interface PersonCustomRepository {
SearchPage<Person> findByFirstNameWithSearchTemplate(String firstName, Pageable pageable);
}
----
====
The implementation of this repository fragment looks like this:
====
[source,java]
----
public class PersonCustomRepositoryImpl implements PersonCustomRepository {
private final ElasticsearchOperations operations;
public PersonCustomRepositoryImpl(ElasticsearchOperations operations) {
this.operations = operations;
}
@Override
public SearchPage<Person> findByFirstNameWithSearchTemplate(String firstName, Pageable pageable) {
var query = SearchTemplateQuery.builder() <.>
.withId("person-firstname") <.>
.withParams(
Map.of( <.>
"firstName", firstName,
"from", pageable.getOffset(),
"size", pageable.getPageSize()
)
)
.build();
SearchHits<Person> searchHits = operations.search(query, Person.class); <.>
return SearchHitSupport.searchPageFor(searchHits, pageable);
}
}
----
<.> Create a `SearchTemplateQuery`
<.> Provide the id of the search template
<.> The parameters are passed in a `Map<String,Object>`
<.> Do the search in the same way as with the other query types.
====
[[elasticsearch.misc.nested-sort]]
== Nested sort
Spring Data Elasticsearch supports sorting within nested objects (https://www.elastic.co/guide/en/elasticsearch/reference/8.9/sort-search-results.html#nested-sorting)
The following example, taken from the `org.springframework.data.elasticsearch.core.query.sort.NestedSortIntegrationTests` class, shows how to define the nested sort.
====
[source,java]
----
var filter = StringQuery.builder("""
{ "term": {"movies.actors.sex": "m"} }
""").build();
var order = new org.springframework.data.elasticsearch.core.query.Order(Sort.Direction.DESC,
"movies.actors.yearOfBirth")
.withNested(
Nested.builder("movies")
.withNested(
Nested.builder("movies.actors")
.withFilter(filter)
.build())
.build());
var query = Query.findAll().addSort(Sort.by(order));
----
====
About the filter query: It is not possible to use a `CriteriaQuery` here, as this query would be converted into a Elasticsearch nested query which does not work in the filter context. So only `StringQuery` or `NativeQuery` can be used here. When using one of these, like the term query above, the Elasticsearch field names must be used, so take care, when these are redefined with the `@Field(name="...")` definition.
For the definition of the order path and the nested paths, the Java entity property names should be used.

View File

@ -0,0 +1,478 @@
[[elasticsearch.mapping]]
= Elasticsearch Object Mapping
Spring Data Elasticsearch Object Mapping is the process that maps a Java object - the domain entity - into the JSON representation that is stored in Elasticsearch and back.
The class that is internally used for this mapping is the
`MappingElasticsearchConverter`.
[[elasticsearch.mapping.meta-model]]
== Meta Model Object Mapping
The Metamodel based approach uses domain type information for reading/writing from/to Elasticsearch.
This allows to register `Converter` instances for specific domain type mapping.
[[elasticsearch.mapping.meta-model.annotations]]
=== Mapping Annotation Overview
The `MappingElasticsearchConverter` uses metadata to drive the mapping of objects to documents.
The metadata is taken from the entity's properties which can be annotated.
The following annotations are available:
* `@Document`: Applied at the class level to indicate this class is a candidate for mapping to the database.
The most important attributes are (check the API documentation for the complete list of attributes):
** `indexName`: the name of the index to store this entity in.
This can contain a SpEL template expression like `"log-#{T(java.time.LocalDate).now().toString()}"`
** `createIndex`: flag whether to create an index on repository bootstrapping.
Default value is _true_.
See xref:elasticsearch/repositories/elasticsearch-repositories.adoc#elasticsearch.repositories.autocreation[Automatic creation of indices with the corresponding mapping]
* `@Id`: Applied at the field level to mark the field used for identity purpose.
* `@Transient`, `@ReadOnlyProperty`, `@WriteOnlyProperty`: see the following section xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.annotations.read-write[Controlling which properties are written to and read from Elasticsearch] for detailed information.
* `@PersistenceConstructor`: Marks a given constructor - even a package protected one - to use when instantiating the object from the database.
Constructor arguments are mapped by name to the key values in the retrieved Document.
* `@Field`: Applied at the field level and defines properties of the field, most of the attributes map to the respective https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html[Elasticsearch Mapping] definitions (the following list is not complete, check the annotation Javadoc for a complete reference):
** `name`: The name of the field as it will be represented in the Elasticsearch document, if not set, the Java field name is used.
** `type`: The field type, can be one of _Text, Keyword, Long, Integer, Short, Byte, Double, Float, Half_Float, Scaled_Float, Date, Date_Nanos, Boolean, Binary, Integer_Range, Float_Range, Long_Range, Double_Range, Date_Range, Ip_Range, Object, Nested, Ip, TokenCount, Percolator, Flattened, Search_As_You_Type_.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html[Elasticsearch Mapping Types].
If the field type is not specified, it defaults to `FieldType.Auto`.
This means, that no mapping entry is written for the property and that Elasticsearch will add a mapping entry dynamically when the first data for this property is stored (check the Elasticsearch documentation for dynamic mapping rules).
** `format`: One or more built-in date formats, see the next section xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.annotations.date-formats[Date format mapping].
** `pattern`: One or more custom date formats, see the next section xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.annotations.date-formats[Date format mapping].
** `store`: Flag whether the original field value should be store in Elasticsearch, default value is _false_.
** `analyzer`, `searchAnalyzer`, `normalizer` for specifying custom analyzers and normalizer.
* `@GeoPoint`: Marks a field as _geo_point_ datatype.
Can be omitted if the field is an instance of the `GeoPoint` class.
* `@ValueConverter` defines a class to be used to convert the given property.
In difference to a registered Spring `Converter` this only converts the annotated property and not every property of the given type.
The mapping metadata infrastructure is defined in a separate spring-data-commons project that is technology agnostic.
[[elasticsearch.mapping.meta-model.annotations.read-write]]
==== Controlling which properties are written to and read from Elasticsearch
This section details the annotations that define if the value of a property is written to or read from Elasticsearch.
`@Transient`: A property annotated with this annotation will not be written to the mapping, it's value will not be sent to Elasticsearch and when documents are returned from Elasticsearch, this property will not be set in the resulting entity.
`@ReadOnlyProperty`: A property with this annotation will not have its value written to Elasticsearch, but when returning data, the property will be filled with the value returned in the document from Elasticsearch.
One use case for this are runtime fields defined in the index mapping.
`@WriteOnlyProperty`: A property with this annotation will have its value stored in Elasticsearch but will not be set with any value when reading document.
This can be used for example for synthesized fields which should go into the Elasticsearch index but are not used elsewhere.
[[elasticsearch.mapping.meta-model.annotations.date-formats]]
==== Date format mapping
Properties that derive from `TemporalAccessor` or are of type `java.util.Date` must either have a `@Field` annotation of type `FieldType.Date` or a custom converter must be registered for this type.
This paragraph describes the use of
`FieldType.Date`.
There are two attributes of the `@Field` annotation that define which date format information is written to the mapping (also see https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html#built-in-date-formats[Elasticsearch Built In Formats] and https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html#custom-date-formats[Elasticsearch Custom Date Formats])
The `format` attribute is used to define at least one of the predefined formats.
If it is not defined, then a default value of __date_optional_time_ and _epoch_millis_ is used.
The `pattern` attribute can be used to add additional custom format strings.
If you want to use only custom date formats, you must set the `format` property to empty `{}`.
The following table shows the different attributes and the mapping created from their values:
[cols=2*,options=header]
|===
| annotation
| format string in Elasticsearch mapping
| @Field(type=FieldType.Date)
| "date_optional_time\|\|epoch_millis",
| @Field(type=FieldType.Date, format=DateFormat.basic_date)
| "basic_date"
| @Field(type=FieldType.Date, format={DateFormat.basic_date, DateFormat.basic_time})
| "basic_date\|\|basic_time"
| @Field(type=FieldType.Date, pattern="dd.MM.uuuu")
| "date_optional_time\|\|epoch_millis\|\|dd.MM.uuuu",
| @Field(type=FieldType.Date, format={}, pattern="dd.MM.uuuu")
| "dd.MM.uuuu"
|===
NOTE: If you are using a custom date format, you need to use _uuuu_ for the year instead of _yyyy_.
This is due to a https://www.elastic.co/guide/en/elasticsearch/reference/current/migrate-to-java-time.html#java-time-migration-incompatible-date-formats[change in Elasticsearch 7].
Check the code of the `org.springframework.data.elasticsearch.annotations.DateFormat` enum for a complete list of predefined values and their patterns.
[[elasticsearch.mapping.meta-model.annotations.range]]
==== Range types
When a field is annotated with a type of one of _Integer_Range, Float_Range, Long_Range, Double_Range, Date_Range,_ or _Ip_Range_ the field must be an instance of a class that will be mapped to an Elasticsearch range, for example:
====
[source,java]
----
class SomePersonData {
@Field(type = FieldType.Integer_Range)
private ValidAge validAge;
// getter and setter
}
class ValidAge {
@Field(name="gte")
private Integer from;
@Field(name="lte")
private Integer to;
// getter and setter
}
----
====
As an alternative Spring Data Elasticsearch provides a `Range<T>` class so that the previous example can be written as:
====
[source,java]
----
class SomePersonData {
@Field(type = FieldType.Integer_Range)
private Range<Integer> validAge;
// getter and setter
}
----
====
Supported classes for the type `<T>` are `Integer`, `Long`, `Float`, `Double`, `Date` and classes that implement the
`TemporalAccessor` interface.
[[elasticsearch.mapping.meta-model.annotations.mapped-names]]
==== Mapped field names
Without further configuration, Spring Data Elasticsearch will use the property name of an object as field name in Elasticsearch.
This can be changed for individual field by using the `@Field` annotation on that property.
It is also possible to define a `FieldNamingStrategy` in the configuration of the client (xref:elasticsearch/clients.adoc[Elasticsearch Clients]).
If for example a `SnakeCaseFieldNamingStrategy` is configured, the property _sampleProperty_ of the object would be mapped to _sample_property_ in Elasticsearch.
A `FieldNamingStrategy` applies to all entities; it can be overwritten by setting a specific name with `@Field` on a property.
[[elasticsearch.mapping.meta-model.annotations.non-field-backed-properties]]
==== Non-field-backed properties
Normally the properties used in an entity are fields of the entity class.
There might be cases, when a property value is calculated in the entity and should be stored in Elasticsearch.
In this case, the getter method (`getProperty()`) can be annotated with the `@Field` annotation, in addition to that the method must be annotated with `@AccessType(AccessType.Type
.PROPERTY)`.
The third annotation that is needed in such a case is `@WriteOnlyProperty`, as such a value is only written to Elasticsearch.
A full example:
====
[source,java]
----
@Field(type = Keyword)
@WriteOnlyProperty
@AccessType(AccessType.Type.PROPERTY)
public String getProperty() {
return "some value that is calculated here";
}
----
====
[[elasticsearch.mapping.meta-model.annotations.misc]]
==== Other property annotations
[[indexedindexname]]
===== @IndexedIndexName
This annotation can be set on a String property of an entity.
This property will not be written to the mapping, it will not be stored in Elasticsearch and its value will not be read from an Elasticsearch document.
After an entity is persisted, for example with a call to `ElasticsearchOperations.save(T entity)`, the entity returned from that call will contain the name of the index that an entity was saved to in that property.
This is useful when the index name is dynamically set by a bean, or when writing to a write alias.
Putting some value into such a property does not set the index into which an entity is stored!
[[elasticsearch.mapping.meta-model.rules]]
=== Mapping Rules
[[elasticsearch.mapping.meta-model.rules.typehints]]
==== Type Hints
Mapping uses _type hints_ embedded in the document sent to the server to allow generic type mapping.
Those type hints are represented as `_class` attributes within the document and are written for each aggregate root.
.Type Hints
====
[source,java]
----
public class Person { <1>
@Id String id;
String firstname;
String lastname;
}
----
[source,json]
----
{
"_class" : "com.example.Person", <1>
"id" : "cb7bef",
"firstname" : "Sarah",
"lastname" : "Connor"
}
----
<1> By default the domain types class name is used for the type hint.
====
Type hints can be configured to hold custom information.
Use the `@TypeAlias` annotation to do so.
NOTE: Make sure to add types with `@TypeAlias` to the initial entity set (`AbstractElasticsearchConfiguration#getInitialEntitySet`) to already have entity information available when first reading data from the store.
.Type Hints with Alias
====
[source,java]
----
@TypeAlias("human") <1>
public class Person {
@Id String id;
// ...
}
----
[source,json]
----
{
"_class" : "human", <1>
"id" : ...
}
----
<1> The configured alias is used when writing the entity.
====
NOTE: Type hints will not be written for nested Objects unless the properties type is `Object`, an interface or the actual value type does not match the properties declaration.
[[disabling-type-hints]]
===== Disabling Type Hints
It may be necessary to disable writing of type hints when the index that should be used already exists without having the type hints defined in its mapping and with the mapping mode set to strict.
In this case, writing the type hint will produce an error, as the field cannot be added automatically.
Type hints can be disabled for the whole application by overriding the method `writeTypeHints()` in a configuration class derived from `AbstractElasticsearchConfiguration` (see xref:elasticsearch/clients.adoc[Elasticsearch Clients]).
As an alternative they can be disabled for a single index with the `@Document` annotation:
====
[source,java]
----
@Document(indexName = "index", writeTypeHint = WriteTypeHint.FALSE)
----
====
WARNING: We strongly advise against disabling Type Hints.
Only do this if you are forced to.
Disabling type hints can lead to documents not being retrieved correctly from Elasticsearch in case of polymorphic data or document retrieval may fail completely.
[[elasticsearch.mapping.meta-model.rules.geospatial]]
==== Geospatial Types
Geospatial types like `Point` & `GeoPoint` are converted into _lat/lon_ pairs.
.Geospatial types
====
[source,java]
----
public class Address {
String city, street;
Point location;
}
----
[source,json]
----
{
"city" : "Los Angeles",
"street" : "2800 East Observatory Road",
"location" : { "lat" : 34.118347, "lon" : -118.3026284 }
}
----
====
[[elasticsearch.mapping.meta-model.rules.geojson]]
==== GeoJson Types
Spring Data Elasticsearch supports the GeoJson types by providing an interface `GeoJson` and implementations for the different geometries.
They are mapped to Elasticsearch documents according to the GeoJson specification.
The corresponding properties of the entity are specified in the index mappings as `geo_shape` when the index mappings is written. (check the https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html[Elasticsearch documentation] as well)
.GeoJson types
====
[source,java]
----
public class Address {
String city, street;
GeoJsonPoint location;
}
----
[source,json]
----
{
"city": "Los Angeles",
"street": "2800 East Observatory Road",
"location": {
"type": "Point",
"coordinates": [-118.3026284, 34.118347]
}
}
----
====
The following GeoJson types are implemented:
* `GeoJsonPoint`
* `GeoJsonMultiPoint`
* `GeoJsonLineString`
* `GeoJsonMultiLineString`
* `GeoJsonPolygon`
* `GeoJsonMultiPolygon`
* `GeoJsonGeometryCollection`
[[elasticsearch.mapping.meta-model.rules.collections]]
==== Collections
For values inside Collections apply the same mapping rules as for aggregate roots when it comes to _type hints_ and xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.conversions[Custom Conversions].
.Collections
====
[source,java]
----
public class Person {
// ...
List<Person> friends;
}
----
[source,json]
----
{
// ...
"friends" : [ { "firstname" : "Kyle", "lastname" : "Reese" } ]
}
----
====
[[elasticsearch.mapping.meta-model.rules.maps]]
==== Maps
For values inside Maps apply the same mapping rules as for aggregate roots when it comes to _type hints_ and xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.conversions[Custom Conversions].
However the Map key needs to a String to be processed by Elasticsearch.
.Collections
====
[source,java]
----
public class Person {
// ...
Map<String, Address> knownLocations;
}
----
[source,json]
----
{
// ...
"knownLocations" : {
"arrivedAt" : {
"city" : "Los Angeles",
"street" : "2800 East Observatory Road",
"location" : { "lat" : 34.118347, "lon" : -118.3026284 }
}
}
}
----
====
[[elasticsearch.mapping.meta-model.conversions]]
=== Custom Conversions
Looking at the `Configuration` from the xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model[previous section] `ElasticsearchCustomConversions` allows registering specific rules for mapping domain and simple types.
.Meta Model Object Mapping Configuration
====
[source,java]
----
@Configuration
public class Config extends ElasticsearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder() //
.connectedTo("localhost:9200") //
.build();
}
@Bean
@Override
public ElasticsearchCustomConversions elasticsearchCustomConversions() {
return new ElasticsearchCustomConversions(
Arrays.asList(new AddressToMap(), new MapToAddress())); <1>
}
@WritingConverter <2>
static class AddressToMap implements Converter<Address, Map<String, Object>> {
@Override
public Map<String, Object> convert(Address source) {
LinkedHashMap<String, Object> target = new LinkedHashMap<>();
target.put("ciudad", source.getCity());
// ...
return target;
}
}
@ReadingConverter <3>
static class MapToAddress implements Converter<Map<String, Object>, Address> {
@Override
public Address convert(Map<String, Object> source) {
// ...
return address;
}
}
}
----
[source,json]
----
{
"ciudad" : "Los Angeles",
"calle" : "2800 East Observatory Road",
"localidad" : { "lat" : 34.118347, "lon" : -118.3026284 }
}
----
<1> Add `Converter` implementations.
<2> Set up the `Converter` used for writing `DomainType` to Elasticsearch.
<3> Set up the `Converter` used for reading `DomainType` from search result.
====

View File

@ -0,0 +1,65 @@
[[elasticsearch.reactive.operations]]
= Reactive Elasticsearch Operations
`ReactiveElasticsearchOperations` is the gateway to executing high level commands against an Elasticsearch cluster using the `ReactiveElasticsearchClient`.
The `ReactiveElasticsearchTemplate` is the default implementation of `ReactiveElasticsearchOperations`.
To get started the `ReactiveElasticsearchOperations` needs to know about the actual client to work with.
Please see xref:elasticsearch/clients.adoc#elasticsearch.clients.reactiverestclient[Reactive Rest Client] for details on the client and how to configure it.
[[elasticsearch.reactive.operations.usage]]
== Reactive Operations Usage
`ReactiveElasticsearchOperations` lets you save, find and delete your domain objects and map those objects to documents stored in Elasticsearch.
Consider the following:
.Use the ReactiveElasticsearchOperations
====
[source,java]
----
@Document(indexName = "marvel")
public class Person {
private @Id String id;
private String name;
private int age;
// Getter/Setter omitted...
}
----
[source,java]
----
ReactiveElasticsearchOperations operations;
// ...
operations.save(new Person("Bruce Banner", 42)) <.>
.doOnNext(System.out::println)
.flatMap(person -> operations.get(person.id, Person.class)) <.>
.doOnNext(System.out::println)
.flatMap(person -> operations.delete(person)) <.>
.doOnNext(System.out::println)
.flatMap(id -> operations.count(Person.class)) <.>
.doOnNext(System.out::println)
.subscribe(); <.>
----
The above outputs the following sequence on the console.
[source,text]
----
> Person(id=QjWCWWcBXiLAnp77ksfR, name=Bruce Banner, age=42)
> Person(id=QjWCWWcBXiLAnp77ksfR, name=Bruce Banner, age=42)
> QjWCWWcBXiLAnp77ksfR
> 0
----
<.> Insert a new `Person` document into the _marvel_ index . The `id` is generated on server side and set into the instance returned.
<.> Lookup the `Person` with matching `id` in the _marvel_ index.
<.> Delete the `Person` with matching `id`, extracted from the given instance, in the _marvel_ index.
<.> Count the total number of documents in the _marvel_ index.
<.> Don't forget to _subscribe()_.
====

View File

@ -0,0 +1,35 @@
[[elasticsearch.cdi]]
= CDI Integration
The Spring Data Elasticsearch repositories can also be set up using CDI functionality.
.Spring Data Elasticsearch repositories using CDI
====
[source,java]
----
class ElasticsearchTemplateProducer {
@Produces
@ApplicationScoped
public ElasticsearchOperations createElasticsearchTemplate() {
// ... <1>
}
}
class ProductService {
private ProductRepository repository; <2>
public Page<Product> findAvailableBookByName(String name, Pageable pageable) {
return repository.findByAvailableTrueAndNameStartingWith(name, pageable);
}
@Inject
public void setRepository(ProductRepository repository) {
this.repository = repository;
}
}
----
<1> Create a component by using the same calls as are used in the xref:elasticsearch/template.adoc[Elasticsearch Operations] chapter.
<2> Let the CDI framework inject the Repository into your class.
====

View File

@ -0,0 +1,197 @@
[[elasticsearch.repositories]]
= Elasticsearch Repositories
This chapter includes details of the Elasticsearch repository implementation.
.The sample `Book` entity
====
[source,java]
----
@Document(indexName="books")
class Book {
@Id
private String id;
@Field(type = FieldType.Text)
private String name;
@Field(type = FieldType.Text)
private String summary;
@Field(type = FieldType.Integer)
private Integer price;
// getter/setter ...
}
----
====
[[elasticsearch.repositories.autocreation]]
== Automatic creation of indices with the corresponding mapping
The `@Document` annotation has an argument `createIndex`.
If this argument is set to true - which is the default value - Spring Data Elasticsearch will during bootstrapping the repository support on application startup check if the index defined by the `@Document` annotation exists.
If it does not exist, the index will be created and the mappings derived from the entity's annotations (see xref:elasticsearch/object-mapping.adoc[Elasticsearch Object Mapping]) will be written to the newly created index.
Details of the index that will be created can be set by using the `@Setting` annotation, refer to xref:elasticsearch/misc.adoc#elasticsearc.misc.index.settings[Index settings] for further information.
[[elasticsearch.repositories.annotations]]
== Annotations for repository methods
[[elasticsearch.repositories.annotations.highlight]]
=== @Highlight
The `@Highlight` annotation on a repository method defines for which fields of the returned entity highlighting should be included.To search for some text in a `Book` 's name or summary and have the found data highlighted, the following repository method can be used:
====
[source,java]
----
interface BookRepository extends Repository<Book, String> {
@Highlight(fields = {
@HighlightField(name = "name"),
@HighlightField(name = "summary")
})
SearchHits<Book> findByNameOrSummary(String text, String summary);
}
----
====
It is possible to define multiple fields to be highlighted like above, and both the `@Highlight` and the `@HighlightField` annotation can further be customized with a `@HighlightParameters` annotation. Check the Javadocs for the possible configuration options.
In the search results the highlight data can be retrieved from the `SearchHit` class.
[[elasticsearch.repositories.annotations.sourcefilters]]
=== @SourceFilters
Sometimes the user does not need to have all the properties of an entity returned from a search but only a subset.
Elasticsearch provides source filtering to reduce the amount of data that is transferred across the network to the
application.
When working with `Query` implementations and the `ElasticsearchOperations` this is easily possible by setting a
source filter on the query.
When using repository methods there is the `@SourceFilters` annotation:
====
[source,java]
----
interface BookRepository extends Repository<Book, String> {
@SourceFilters(includes = "name")
SearchHits<Book> findByName(String text);
}
----
====
In this example, all the properties of the returned `Book` objects would be `null` except the name.
[[elasticsearch.annotation]]
== Annotation based configuration
The Spring Data Elasticsearch repositories support can be activated using an annotation through JavaConfig.
.Spring Data Elasticsearch repositories using JavaConfig
====
[source,java]
----
@Configuration
@EnableElasticsearchRepositories( <1>
basePackages = "org.springframework.data.elasticsearch.repositories"
)
static class Config {
@Bean
public ElasticsearchOperations elasticsearchTemplate() { <2>
// ...
}
}
class ProductService {
private ProductRepository repository; <3>
public ProductService(ProductRepository repository) {
this.repository = repository;
}
public Page<Product> findAvailableBookByName(String name, Pageable pageable) {
return repository.findByAvailableTrueAndNameStartingWith(name, pageable);
}
}
----
<1> The `EnableElasticsearchRepositories` annotation activates the Repository support.
If no base package is configured, it will use the one of the configuration class it is put on.
<2> Provide a Bean named `elasticsearchTemplate` of type `ElasticsearchOperations` by using one of the configurations shown in the xref:elasticsearch/template.adoc[Elasticsearch Operations] chapter.
<3> Let Spring inject the Repository bean into your class.
====
[[elasticsearch.namespace]]
== Spring Namespace
The Spring Data Elasticsearch module contains a custom namespace allowing definition of repository beans as well as elements for instantiating a `ElasticsearchServer` .
Using the `repositories` element looks up Spring Data repositories as described in xref:repositories/create-instances.adoc[].
.Setting up Elasticsearch repositories using Namespace
====
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
xsi:schemaLocation="http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/data/elasticsearch
https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd">
<elasticsearch:repositories base-package="com.acme.repositories" />
</beans>
----
====
Using the `Transport Client` or `Rest Client` element registers an instance of `Elasticsearch Server` in the context.
.Transport Client using Namespace
====
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
xsi:schemaLocation="http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/data/elasticsearch
https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd">
<elasticsearch:transport-client id="client" cluster-nodes="localhost:9300,someip:9300" />
</beans>
----
====
.Rest Client using Namespace
====
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
xsi:schemaLocation="http://www.springframework.org/schema/data/elasticsearch
https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
<elasticsearch:rest-client id="restClient" hosts="http://localhost:9200">
</beans>
----
====

View File

@ -0,0 +1,592 @@
[[elasticsearch.query-methods]]
= Query methods
[[elasticsearch.query-methods.finders]]
== Query lookup strategies
The Elasticsearch module supports all basic query building feature as string queries, native search queries, criteria based queries or have it being derived from the method name.
[[elasticsearch.query-methods.finders.declared]]
=== Declared queries
Deriving the query from the method name is not always sufficient and/or may result in unreadable method names.
In this case one might make use of the `@Query` annotation (see xref:elasticsearch/repositories/elasticsearch-repository-queries.adoc#elasticsearch.query-methods.at-query[Using the @Query Annotation] ).
Another possibility is the use of a search-template, (see xref:elasticsearch/repositories/elasticsearch-repository-queries.adoc#elasticsearch.query-methods.at-searchtemplate-query[Using the @SearchTemplateQuery Annotation] ).
[[elasticsearch.query-methods.criterions]]
== Query creation
Generally the query creation mechanism for Elasticsearch works as described in xref:repositories/query-methods-details.adoc[].
Here's a short example of what a Elasticsearch query method translates into:
.Query creation from method names
====
[source,java]
----
interface BookRepository extends Repository<Book, String> {
List<Book> findByNameAndPrice(String name, Integer price);
}
----
====
The method name above will be translated into the following Elasticsearch json query
[source]
----
{
"query": {
"bool" : {
"must" : [
{ "query_string" : { "query" : "?", "fields" : [ "name" ] } },
{ "query_string" : { "query" : "?", "fields" : [ "price" ] } }
]
}
}
}
----
A list of supported keywords for Elasticsearch is shown below.
[cols="1,2,3",options="header"]
.Supported keywords inside method names
|===
| Keyword
| Sample
| Elasticsearch Query String
| `And`
| `findByNameAndPrice`
| `{ "query" : {
"bool" : {
"must" : [
{ "query_string" : { "query" : "?", "fields" : [ "name" ] } },
{ "query_string" : { "query" : "?", "fields" : [ "price" ] } }
]
}
}}`
| `Or`
| `findByNameOrPrice`
| `{ "query" : {
"bool" : {
"should" : [
{ "query_string" : { "query" : "?", "fields" : [ "name" ] } },
{ "query_string" : { "query" : "?", "fields" : [ "price" ] } }
]
}
}}`
| `Is`
| `findByName`
| `{ "query" : {
"bool" : {
"must" : [
{ "query_string" : { "query" : "?", "fields" : [ "name" ] } }
]
}
}}`
| `Not`
| `findByNameNot`
| `{ "query" : {
"bool" : {
"must_not" : [
{ "query_string" : { "query" : "?", "fields" : [ "name" ] } }
]
}
}}`
| `Between`
| `findByPriceBetween`
| `{ "query" : {
"bool" : {
"must" : [
{"range" : {"price" : {"from" : ?, "to" : ?, "include_lower" : true, "include_upper" : true } } }
]
}
}}`
| `LessThan`
| `findByPriceLessThan`
| `{ "query" : {
"bool" : {
"must" : [
{"range" : {"price" : {"from" : null, "to" : ?, "include_lower" : true, "include_upper" : false } } }
]
}
}}`
| `LessThanEqual`
| `findByPriceLessThanEqual`
| `{ "query" : {
"bool" : {
"must" : [
{"range" : {"price" : {"from" : null, "to" : ?, "include_lower" : true, "include_upper" : true } } }
]
}
}}`
| `GreaterThan`
| `findByPriceGreaterThan`
| `{ "query" : {
"bool" : {
"must" : [
{"range" : {"price" : {"from" : ?, "to" : null, "include_lower" : false, "include_upper" : true } } }
]
}
}}`
| `GreaterThanEqual`
| `findByPriceGreaterThanEqual`
| `{ "query" : {
"bool" : {
"must" : [
{"range" : {"price" : {"from" : ?, "to" : null, "include_lower" : true, "include_upper" : true } } }
]
}
}}`
| `Before`
| `findByPriceBefore`
| `{ "query" : {
"bool" : {
"must" : [
{"range" : {"price" : {"from" : null, "to" : ?, "include_lower" : true, "include_upper" : true } } }
]
}
}}`
| `After`
| `findByPriceAfter`
| `{ "query" : {
"bool" : {
"must" : [
{"range" : {"price" : {"from" : ?, "to" : null, "include_lower" : true, "include_upper" : true } } }
]
}
}}`
| `Like`
| `findByNameLike`
| `{ "query" : {
"bool" : {
"must" : [
{ "query_string" : { "query" : "?*", "fields" : [ "name" ] }, "analyze_wildcard": true }
]
}
}}`
| `StartingWith`
| `findByNameStartingWith`
| `{ "query" : {
"bool" : {
"must" : [
{ "query_string" : { "query" : "?*", "fields" : [ "name" ] }, "analyze_wildcard": true }
]
}
}}`
| `EndingWith`
| `findByNameEndingWith`
| `{ "query" : {
"bool" : {
"must" : [
{ "query_string" : { "query" : "*?", "fields" : [ "name" ] }, "analyze_wildcard": true }
]
}
}}`
| `Contains/Containing`
| `findByNameContaining`
| `{ "query" : {
"bool" : {
"must" : [
{ "query_string" : { "query" : "\*?*", "fields" : [ "name" ] }, "analyze_wildcard": true }
]
}
}}`
| `In` (when annotated as FieldType.Keyword)
| `findByNameIn(Collection<String>names)`
| `{ "query" : {
"bool" : {
"must" : [
{"bool" : {"must" : [
{"terms" : {"name" : ["?","?"]}}
]
}
}
]
}
}}`
| `In`
| `findByNameIn(Collection<String>names)`
| `{ "query": {"bool": {"must": [{"query_string":{"query": "\"?\" \"?\"", "fields": ["name"]}}]}}}`
| `NotIn` (when annotated as FieldType.Keyword)
| `findByNameNotIn(Collection<String>names)`
| `{ "query" : {
"bool" : {
"must" : [
{"bool" : {"must_not" : [
{"terms" : {"name" : ["?","?"]}}
]
}
}
]
}
}}`
| `NotIn`
| `findByNameNotIn(Collection<String>names)`
| `{"query": {"bool": {"must": [{"query_string": {"query": "NOT(\"?\" \"?\")", "fields": ["name"]}}]}}}`
| `True`
| `findByAvailableTrue`
| `{ "query" : {
"bool" : {
"must" : [
{ "query_string" : { "query" : "true", "fields" : [ "available" ] } }
]
}
}}`
| `False`
| `findByAvailableFalse`
| `{ "query" : {
"bool" : {
"must" : [
{ "query_string" : { "query" : "false", "fields" : [ "available" ] } }
]
}
}}`
| `OrderBy`
| `findByAvailableTrueOrderByNameDesc`
| `{ "query" : {
"bool" : {
"must" : [
{ "query_string" : { "query" : "true", "fields" : [ "available" ] } }
]
}
}, "sort":[{"name":{"order":"desc"}}]
}`
| `Exists`
| `findByNameExists`
| `{"query":{"bool":{"must":[{"exists":{"field":"name"}}]}}}`
| `IsNull`
| `findByNameIsNull`
| `{"query":{"bool":{"must_not":[{"exists":{"field":"name"}}]}}}`
| `IsNotNull`
| `findByNameIsNotNull`
| `{"query":{"bool":{"must":[{"exists":{"field":"name"}}]}}}`
| `IsEmpty`
| `findByNameIsEmpty`
| `{"query":{"bool":{"must":[{"bool":{"must":[{"exists":{"field":"name"}}],"must_not":[{"wildcard":{"name":{"wildcard":"*"}}}]}}]}}}`
| `IsNotEmpty`
| `findByNameIsNotEmpty`
| `{"query":{"bool":{"must":[{"wildcard":{"name":{"wildcard":"*"}}}]}}}`
|===
NOTE: Methods names to build Geo-shape queries taking `GeoJson` parameters are not supported.
Use `ElasticsearchOperations` with `CriteriaQuery` in a custom repository implementation if you need to have such a function in a repository.
[[elasticsearch.query-methods.return-types]]
== Method return types
Repository methods can be defined to have the following return types for returning multiple Elements:
* `List<T>`
* `Stream<T>`
* `SearchHits<T>`
* `List<SearchHit<T>>`
* `Stream<SearchHit<T>>`
* `SearchPage<T>`
[[elasticsearch.query-methods.at-query]]
== Using the @Query Annotation
.Declare query on the method using the `@Query` annotation.
====
The arguments passed to the method can be inserted into placeholders in the query string.
The placeholders are of the form `?0`, `?1`, `?2` etc. for the first, second, third parameter and so on.
[source,java]
----
interface BookRepository extends ElasticsearchRepository<Book, String> {
@Query("{\"match\": {\"name\": {\"query\": \"?0\"}}}")
Page<Book> findByName(String name,Pageable pageable);
}
----
The String that is set as the annotation argument must be a valid Elasticsearch JSON query.
It will be sent to Easticsearch as value of the query element; if for example the function is called with the parameter _John_, it would produce the following query body:
[source,json]
----
{
"query": {
"match": {
"name": {
"query": "John"
}
}
}
}
----
====
.`@Query` annotation on a method taking a Collection argument
====
A repository method such as
[source,java]
----
@Query("{\"ids\": {\"values\": ?0 }}")
List<SampleEntity> getByIds(Collection<String> ids);
----
would make an https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html[IDs query] to return all the matching documents.
So calling the method with a `List` of `["id1", "id2", "id3"]` would produce the query body
[source,json]
----
{
"query": {
"ids": {
"values": ["id1", "id2", "id3"]
}
}
}
----
====
[[elasticsearch.query-methods.at-query.spel]]
=== Using SpEL Expressions
.Declare query on the method using the `@Query` annotation with SpEL expression.
====
https://docs.spring.io/spring-framework/reference/core/expressions.html[SpEL expression] is also supported when defining query in `@Query`.
[source,java]
----
interface BookRepository extends ElasticsearchRepository<Book, String> {
@Query("""
{
"bool":{
"must":[
{
"term":{
"name": "#{#name}"
}
}
]
}
}
""")
Page<Book> findByName(String name, Pageable pageable);
}
----
If for example the function is called with the parameter _John_, it would produce the following query body:
[source,json]
----
{
"bool":{
"must":[
{
"term":{
"name": "John"
}
}
]
}
}
----
====
.accessing parameter property.
====
Supposing that we have the following class as query parameter type:
[source,java]
----
public record QueryParameter(String value) {
}
----
It's easy to access the parameter by `#` symbol, then reference the property `value` with a simple `.`:
[source,java]
----
interface BookRepository extends ElasticsearchRepository<Book, String> {
@Query("""
{
"bool":{
"must":[
{
"term":{
"name": "#{#parameter.value}"
}
}
]
}
}
""")
Page<Book> findByName(QueryParameter parameter, Pageable pageable);
}
----
We can pass `new QueryParameter("John")` as the parameter now, and it will produce the same query string as above.
====
.accessing bean property.
====
https://docs.spring.io/spring-framework/reference/core/expressions/language-ref/bean-references.html[Bean property] is also supported to access.
Given that there is a bean named `queryParameter` of type `QueryParameter`, we can access the bean with symbol `@` rather than `#`, and there is no need to declare a parameter of type `QueryParameter` in the query method:
[source,java]
----
interface BookRepository extends ElasticsearchRepository<Book, String> {
@Query("""
{
"bool":{
"must":[
{
"term":{
"name": "#{@queryParameter.value}"
}
}
]
}
}
""")
Page<Book> findByName(Pageable pageable);
}
----
====
.SpEL and `Collection` param.
====
`Collection` parameter is also supported and is as easy to use as normal `String`, such as the following `terms` query:
[source,java]
----
interface BookRepository extends ElasticsearchRepository<Book, String> {
@Query("""
{
"bool":{
"must":[
{
"terms":{
"name": #{#names}
}
}
]
}
}
""")
Page<Book> findByName(Collection<String> names, Pageable pageable);
}
----
NOTE: collection values should not be quoted when declaring the elasticsearch json query.
A collection of `names` like `List.of("name1", "name2")` will produce the following terms query:
[source,json]
----
{
"bool":{
"must":[
{
"terms":{
"name": ["name1", "name2"]
}
}
]
}
}
----
====
.access property in the `Collection` param.
====
https://docs.spring.io/spring-framework/reference/core/expressions/language-ref/collection-projection.html[SpEL Collection Projection] is convenient to use when values in the `Collection` parameter is not plain `String`:
[source,java]
----
interface BookRepository extends ElasticsearchRepository<Book, String> {
@Query("""
{
"bool":{
"must":[
{
"terms":{
"name": #{#parameters.![value]}
}
}
]
}
}
""")
Page<Book> findByName(Collection<QueryParameter> parameters, Pageable pageable);
}
----
This will extract all the `value` property values as a new `Collection` from `QueryParameter` collection, thus takes the same effect as above.
====
.alter parameter name by using `@Param`
====
When accessing the parameter by SpEL, it's also useful to alter the parameter name to another one by `@Param` annotation in Sping Data:
[source,java]
----
interface BookRepository extends ElasticsearchRepository<Book, String> {
@Query("""
{
"bool":{
"must":[
{
"terms":{
"name": #{#another.![value]}
}
}
]
}
}
""")
Page<Book> findByName(@Param("another") Collection<QueryParameter> parameters, Pageable pageable);
}
----
====
[[elasticsearch.query-methods.at-searchtemplate-query]]
== Using the @SearchTemplateQuery Annotation
When using Elasticsearch search templates - (see xref:elasticsearch/misc.adoc#elasticsearch.misc.searchtemplates [Search Template support]) it is possible to specify that a repository method should use a template by adding the `@SearchTemplateQuery` annotation to that method.
Let's assume that there is a search template stored with the name "book-by-title" and this template need a parameter named "title", then a repository method using that search template can be defined like this:
[source,java]
----
interface BookRepository extends ElasticsearchRepository<Book, String> {
@SearchTemplateQuery(id = "book-by-title")
SearchHits<Book> findByTitle(String title);
}
----
The parameters of the repository method are sent to the seacrh template as key/value pairs where the key is the parameter name and the value is taken from the actual value when the method is invoked.

View File

@ -0,0 +1,128 @@
[[elasticsearch.reactive.repositories]]
= Reactive Elasticsearch Repositories
Reactive Elasticsearch repository support builds on the core repository support explained in xref:repositories.adoc[] utilizing operations provided via xref:elasticsearch/reactive-template.adoc[] executed by a xref:elasticsearch/clients.adoc#elasticsearch.clients.reactiverestclient[Reactive REST Client].
Spring Data Elasticsearch reactive repository support uses https://projectreactor.io/[Project Reactor] as its reactive composition library of choice.
There are 3 main interfaces to be used:
* `ReactiveRepository`
* `ReactiveCrudRepository`
* `ReactiveSortingRepository`
[[elasticsearch.reactive.repositories.usage]]
== Usage
To access domain objects stored in a Elasticsearch using a `Repository`, just create an interface for it.
Before you can actually go on and do that you will need an entity.
.Sample `Person` entity
====
[source,java]
----
public class Person {
@Id
private String id;
private String firstname;
private String lastname;
private Address address;
// … getters and setters omitted
}
----
====
NOTE: Please note that the `id` property needs to be of type `String`.
.Basic repository interface to persist Person entities
====
[source]
----
interface ReactivePersonRepository extends ReactiveSortingRepository<Person, String> {
Flux<Person> findByFirstname(String firstname); <1>
Flux<Person> findByFirstname(Publisher<String> firstname); <2>
Flux<Person> findByFirstnameOrderByLastname(String firstname); <3>
Flux<Person> findByFirstname(String firstname, Sort sort); <4>
Flux<Person> findByFirstname(String firstname, Pageable page); <5>
Mono<Person> findByFirstnameAndLastname(String firstname, String lastname); <6>
Mono<Person> findFirstByLastname(String lastname); <7>
@Query("{ \"bool\" : { \"must\" : { \"term\" : { \"lastname\" : \"?0\" } } } }")
Flux<Person> findByLastname(String lastname); <8>
Mono<Long> countByFirstname(String firstname) <9>
Mono<Boolean> existsByFirstname(String firstname) <10>
Mono<Long> deleteByFirstname(String firstname) <11>
}
----
<1> The method shows a query for all people with the given `lastname`.
<2> Finder method awaiting input from `Publisher` to bind parameter value for `firstname`.
<3> Finder method ordering matching documents by `lastname`.
<4> Finder method ordering matching documents by the expression defined via the `Sort` parameter.
<5> Use `Pageable` to pass offset and sorting parameters to the database.
<6> Finder method concating criteria using `And` / `Or` keywords.
<7> Find the first matching entity.
<8> The method shows a query for all people with the given `lastname` looked up by running the annotated `@Query` with given
parameters.
<9> Count all entities with matching `firstname`.
<10> Check if at least one entity with matching `firstname` exists.
<11> Delete all entities with matching `firstname`.
====
[[elasticsearch.reactive.repositories.configuration]]
== Configuration
For Java configuration, use the `@EnableReactiveElasticsearchRepositories` annotation. If no base package is configured,
the infrastructure scans the package of the annotated configuration class.
The following listing shows how to use Java configuration for a repository:
.Java configuration for repositories
====
[source,java]
----
@Configuration
@EnableReactiveElasticsearchRepositories
public class Config extends AbstractReactiveElasticsearchConfiguration {
@Override
public ReactiveElasticsearchClient reactiveElasticsearchClient() {
return ReactiveRestClients.create(ClientConfiguration.localhost());
}
}
----
====
Because the repository from the previous example extends `ReactiveSortingRepository`, all CRUD operations are available
as well as methods for sorted access to the entities. Working with the repository instance is a matter of dependency
injecting it into a client, as the following example shows:
.Sorted access to Person entities
====
[source,java]
----
public class PersonRepositoryTests {
@Autowired ReactivePersonRepository repository;
@Test
public void sortsElementsCorrectly() {
Flux<Person> persons = repository.findAll(Sort.by(new Order(ASC, "lastname")));
// ...
}
}
----
====

View File

@ -0,0 +1,106 @@
[[elasticsearch.routing]]
= Routing values
When Elasticsearch stores a document in an index that has multiple shards, it determines the shard to you use based on the _id_ of the document.
Sometimes it is necessary to predefine that multiple documents should be indexed on the same shard (join-types, faster search for related data).
For this Elasticsearch offers the possibility to define a routing, which is the value that should be used to calculate the shard from instead of the _id_.
Spring Data Elasticsearch supports routing definitions on storing and retrieving data in the following ways:
[[elasticsearch.routing.join-types]]
== Routing on join-types
When using join-types (see xref:elasticsearch/join-types.adoc[Join-Type implementation]), Spring Data Elasticsearch will automatically use the `parent` property of the entity's `JoinField` property as the value for the routing.
This is correct for all the use-cases where the parent-child relationship has just one level.
If it is deeper, like a child-parent-grandparent relationship - like in the above example from _vote_ -> _answer_ -> _question_ - then the routing needs to explicitly specified by using the techniques described in the next section (the _vote_ needs the _question.id_ as routing value).
[[elasticsearch.routing.custom]]
== Custom routing values
To define a custom routing for an entity, Spring Data Elasticsearch provides a `@Routing` annotation (reusing the `Statement` class from above):
====
[source,java]
----
@Document(indexName = "statements")
@Routing("routing") <.>
public class Statement {
@Id
private String id;
@Field(type = FieldType.Text)
private String text;
@JoinTypeRelations(
relations =
{
@JoinTypeRelation(parent = "question", children = {"answer", "comment"}),
@JoinTypeRelation(parent = "answer", children = "vote")
}
)
private JoinField<String> relation;
@Nullable
@Field(type = FieldType.Keyword)
private String routing; <.>
// getter/setter...
}
----
<.> This defines _"routing"_ as routing specification
<.> a property with the name _routing_
====
If the `routing` specification of the annotation is a plain string and not a SpEL expression, it is interpreted as the name of a property of the entity, in the example it's the _routing_ property.
The value of this property will then be used as the routing value for all requests that use the entity.
It is also possible to us a SpEL expression in the `@Document` annotation like this:
====
[source,java]
----
@Document(indexName = "statements")
@Routing("@myBean.getRouting(#entity)")
public class Statement{
// all the needed stuff
}
----
====
In this case the user needs to provide a bean with the name _myBean_ that has a method `String getRouting(Object)`. To reference the entity _"#entity"_ must be used in the SpEL expression, and the return value must be `null` or the routing value as a String.
If plain property's names and SpEL expressions are not enough to customize the routing definitions, it is possible to define provide an implementation of the `RoutingResolver` interface. This can then be set on the `ElasticOperations` instance:
====
[source,java]
----
RoutingResolver resolver = ...;
ElasticsearchOperations customOperations= operations.withRouting(resolver);
----
====
The `withRouting()` functions return a copy of the original `ElasticsearchOperations` instance with the customized routing set.
When a routing has been defined on an entity when it is stored in Elasticsearch, the same value must be provided when doing a _get_ or _delete_ operation. For methods that do not use an entity - like `get(ID)` or `delete(ID)` - the `ElasticsearchOperations.withRouting(RoutingResolver)` method can be used like this:
====
[source,java]
----
String id = "someId";
String routing = "theRoutingValue";
// get an entity
Statement s = operations
.withRouting(RoutingResolver.just(routing)) <.>
.get(id, Statement.class);
// delete an entity
operations.withRouting(RoutingResolver.just(routing)).delete(id);
----
<.> `RoutingResolver.just(s)` returns a resolver that will just return the given String.
====

View File

@ -0,0 +1,228 @@
[[elasticsearch.misc.scripted-and-runtime-fields]]
= Scripted and runtime fields
Spring Data Elasticsearch supports scripted fields and runtime fields.
Please refer to the Elasticsearch documentation about scripting (https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html) and runtime fields (https://www.elastic.co/guide/en/elasticsearch/reference/8.9/runtime.html) for detailed information about this.
In the context of Spring Data Elasticsearch you can use
* scripted fields that are used to return fields that are calculated on the result documents and added to the returned document.
* runtime fields that are calculated on the stored documents and can be used in a query and/or be returned in the search result.
The following code snippets will show what you can do (these show imperative code, but the reactive implementation works similar).
[[the-person-entity]]
== The person entity
The enity that is used in these examples is a `Person` entity.
This entity has a `birthDate` and an `age` property.
Whereas the birthdate is fix, the age depends on the time when a query is issued and needs to be calculated dynamically.
====
[source,java]
----
import org.jspecify.annotations.Nullable;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.ScriptedField;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
import java.lang.Integer;
@Document(indexName = "persons")
public record Person(
@Id
@Nullable
String id,
@Field(type = Text)
String lastName,
@Field(type = Text)
String firstName,
@Field(type = Keyword)
String gender,
@Field(type = Date, format = DateFormat.basic_date)
LocalDate birthDate,
@Nullable
@ScriptedField Integer age <.>
) {
public Person(String id,String lastName, String firstName, String gender, String birthDate) {
this(id, <.>
lastName,
firstName,
LocalDate.parse(birthDate, DateTimeFormatter.ISO_LOCAL_DATE),
gender,
null);
}
}
----
<.> the `age` property will be calculated and filled in search results.
<.> a convenience constructor to set up the test data.
====
Note that the `age` property is annotated with `@ScriptedField`.
This inhibits the writing of a corresponding entry in the index mapping and marks the property as a target to put a calculated field from a search response.
[[the-repository-interface]]
== The repository interface
The repository used in this example:
====
[source,java]
----
public interface PersonRepository extends ElasticsearchRepository<Person, String> {
SearchHits<Person> findAllBy(ScriptedField scriptedField);
SearchHits<Person> findByGenderAndAgeLessThanEqual(String gender, Integer age, RuntimeField runtimeField);
}
----
====
[[the-service-class]]
== The service class
The service class has a repository injected and an `ElasticsearchOperations` instance to show several ways of populating and using the `age` property.
We show the code split up in different pieces to put the explanations in
====
[source,java]
----
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.core.query.Criteria;
import org.springframework.data.elasticsearch.core.query.CriteriaQuery;
import org.springframework.data.elasticsearch.core.query.FetchSourceFilter;
import org.springframework.data.elasticsearch.core.query.RuntimeField;
import org.springframework.data.elasticsearch.core.query.ScriptData;
import org.springframework.data.elasticsearch.core.query.ScriptType;
import org.springframework.data.elasticsearch.core.query.ScriptedField;
import org.springframework.data.elasticsearch.core.query.StringQuery;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class PersonService {
private final ElasticsearchOperations operations;
private final PersonRepository repository;
public PersonService(ElasticsearchOperations operations, SaRPersonRepository repository) {
this.operations = operations;
this.repository = repository;
}
public void save() { <.>
List<Person> persons = List.of(
new Person("1", "Smith", "Mary", "f", "1987-05-03"),
new Person("2", "Smith", "Joshua", "m", "1982-11-17"),
new Person("3", "Smith", "Joanna", "f", "2018-03-27"),
new Person("4", "Smith", "Alex", "m", "2020-08-01"),
new Person("5", "McNeill", "Fiona", "f", "1989-04-07"),
new Person("6", "McNeill", "Michael", "m", "1984-10-20"),
new Person("7", "McNeill", "Geraldine", "f", "2020-03-02"),
new Person("8", "McNeill", "Patrick", "m", "2022-07-04"));
repository.saveAll(persons);
}
----
<.> a utility method to store some data in Elasticsearch.
====
[[scripted-fields]]
=== Scripted fields
The next piece shows how to use a scripted field to calculate and return the age of the persons.
Scripted fields can only add something to the returned data, the age cannot be used in the query (see runtime fields for that).
====
[source,java]
----
public SearchHits<Person> findAllWithAge() {
var scriptedField = ScriptedField.of("age", <.>
ScriptData.of(b -> b
.withType(ScriptType.INLINE)
.withScript("""
Instant currentDate = Instant.ofEpochMilli(new Date().getTime());
Instant startDate = doc['birth-date'].value.toInstant();
return (ChronoUnit.DAYS.between(startDate, currentDate) / 365);
""")));
// version 1: use a direct query
var query = new StringQuery("""
{ "match_all": {} }
""");
query.addScriptedField(scriptedField); <.>
query.addSourceFilter(FetchSourceFilter.of(b -> b.withIncludes("*"))); <.>
var result1 = operations.search(query, Person.class); <.>
// version 2: use the repository
var result2 = repository.findAllBy(scriptedField); <.>
return result1;
}
----
<.> define the `ScriptedField` that calculates the age of a person.
<.> when using a `Query`, add the scripted field to the query.
<.> when adding a scripted field to a `Query`, an additional source filter is needed to also retrieve the _normal_ fields from the document source.
<.> get the data where the `Person` entities now have the values set in their `age` property.
<.> when using the repository, all that needs to be done is adding the scripted field as method parameter.
====
[[runtime-fields]]
=== Runtime fields
When using runtime fields, the calculated value can be used in the query itself.
In the following code this is used to run a query for a given gender and maximum age of persons:
====
[source,java]
----
public SearchHits<Person> findWithGenderAndMaxAge(String gender, Integer maxAge) {
var runtimeField = new RuntimeField("age", "long", """ <.>
Instant currentDate = Instant.ofEpochMilli(new Date().getTime());
Instant startDate = doc['birthDate'].value.toInstant();
emit (ChronoUnit.DAYS.between(startDate, currentDate) / 365);
""");
// variant 1 : use a direct query
var query = CriteriaQuery.builder(Criteria
.where("gender").is(gender)
.and("age").lessThanEqual(maxAge))
.withRuntimeFields(List.of(runtimeField)) <.>
.withFields("age") <.>
.withSourceFilter(FetchSourceFilter.of(b -> b.withIncludes("*"))) <.>
.build();
var result1 = operations.search(query, Person.class); <.>
// variant 2: use the repository <.>
var result2 = repository.findByGenderAndAgeLessThanEqual(gender, maxAge, runtimeField);
return result1;
}
}
----
<.> define the runtime field that calculates the age of a person. // see https://asciidoctor.org/docs/user-manual/#builtin-attributes for builtin attributes.
<.> when using `Query`, add the runtime field.
<.> when adding a scripted field to a `Query`, an additional field parameter is needed to have the calculated value returned.
<.> when adding a scripted field to a `Query`, an additional source filter is needed to also retrieve the _normal_ fields from the document source.
<.> get the data filtered with the query and where the returned entites have the age property set.
<.> when using the repository, all that needs to be done is adding the runtime field as method parameter.
====
In addition to define a runtime fields on a query, they can also be defined in the index by setting the `runtimeFieldsPath` property of the `@Mapping` annotation to point to a JSON file that contains the runtime field definitions.

View File

@ -0,0 +1,241 @@
[[elasticsearch.operations]]
= Elasticsearch Operations
Spring Data Elasticsearch uses several interfaces to define the operations that can be called against an Elasticsearch index (for a description of the reactive interfaces see xref:elasticsearch/reactive-template.adoc[]).
* javadoc:org.springframework.data.elasticsearch.core.IndexOperations[] defines actions on index level like creating or deleting an index.
* javadoc:org.springframework.data.elasticsearch.core.DocumentOperations[] defines actions to store, update and retrieve entities based on their id.
* javadoc:org.springframework.data.elasticsearch.core.SearchOperations[] define the actions to search for multiple entities using queries
* javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[] combines the `DocumentOperations` and `SearchOperations` interfaces.
These interfaces correspond to the structuring of the https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html[Elasticsearch API].
The default implementations of the interfaces offer:
* index management functionality.
* Read/Write mapping support for domain types.
* A rich query and criteria api.
* Resource management and Exception translation.
[NOTE]
====
.Index management and automatic creation of indices and mappings.
The `IndexOperations` interface and the provided implementation which can be obtained from an `ElasticsearchOperations` instance - for example with a call to `operations.indexOps(clazz)`- give the user the ability to create indices, put mappings or store template and alias information in the Elasticsearch cluster.
Details of the index that will be created can be set by using the `@Setting` annotation, refer to xref:elasticsearch/misc.adoc#elasticsearc.misc.index.settings[Index settings] for further information.
**None of these operations are done automatically** by the implementations of `IndexOperations` or `ElasticsearchOperations`.
It is the user's responsibility to call the methods.
There is support for automatic creation of indices and writing the mappings when using Spring Data Elasticsearch repositories, see xref:elasticsearch/repositories/elasticsearch-repositories.adoc#elasticsearch.repositories.autocreation[Automatic creation of indices with the corresponding mapping]
====
[[elasticsearch.operations.usage]]
== Usage examples
The example shows how to use an injected `ElasticsearchOperations` instance in a Spring REST controller.
The example assumes that `Person` is a class that is annotated with `@Document`, `@Id` etc (see xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.annotations[Mapping Annotation Overview]).
.ElasticsearchOperations usage
====
[source,java]
----
@RestController
@RequestMapping("/")
public class TestController {
private ElasticsearchOperations elasticsearchOperations;
public TestController(ElasticsearchOperations elasticsearchOperations) { <.>
this.elasticsearchOperations = elasticsearchOperations;
}
@PostMapping("/person")
public String save(@RequestBody Person person) { <.>
Person savedEntity = elasticsearchOperations.save(person);
return savedEntity.getId();
}
@GetMapping("/person/{id}")
public Person findById(@PathVariable("id") Long id) { <.>
Person person = elasticsearchOperations.get(id.toString(), Person.class);
return person;
}
}
----
<.> Let Spring inject the provided `ElasticsearchOperations` bean in the constructor.
<.> Store some entity in the Elasticsearch cluster.
The id is read from the returned entity, as it might have been null in the `person` object and been created by Elasticsearch.
<.> Retrieve the entity with a get by id.
====
To see the full possibilities of `ElasticsearchOperations` please refer to the API documentation.
[[elasticsearch.operations.searchresulttypes]]
== Search Result Types
When a document is retrieved with the methods of the `DocumentOperations` interface, just the found entity will be returned.
When searching with the methods of the `SearchOperations` interface, additional information is available for each entity, for example the _score_ or the _sortValues_ of the found entity.
In order to return this information, each entity is wrapped in a `SearchHit` object that contains this entity-specific additional information.
These `SearchHit` objects themselves are returned within a `SearchHits` object which additionally contains informations about the whole search like the _maxScore_ or requested aggregations or the execution duration it took to complete the request.
The following classes and interfaces are now available:
.SearchHit<T>
Contains the following information:
* Id
* Score
* Sort Values
* Highlight fields
* Inner hits (this is an embedded `SearchHits` object containing eventually returned inner hits)
* The retrieved entity of type <T>
.SearchHits<T>
Contains the following information:
* Number of total hits
* Total hits relation
* Maximum score
* A list of `SearchHit<T>` objects
* Returned aggregations
* Returned suggest results
.SearchPage<T>
Defines a Spring Data `Page` that contains a `SearchHits<T>` element and can be used for paging access using repository methods.
.SearchScrollHits<T>
Returned by the low level scroll API functions in `ElasticsearchRestTemplate`, it enriches a `SearchHits<T>` with the Elasticsearch scroll id.
.SearchHitsIterator<T>
An Iterator returned by the streaming functions of the `SearchOperations` interface.
.ReactiveSearchHits
`ReactiveSearchOperations` has methods returning a `Mono<ReactiveSearchHits<T>>`, this contains the same information as a `SearchHits<T>` object, but will provide the contained `SearchHit<T>` objects as a `Flux<SearchHit<T>>` and not as a list.
[[elasticsearch.operations.queries]]
== Queries
Almost all of the methods defined in the `SearchOperations` and `ReactiveSearchOperations` interface take a `Query` parameter that defines the query to execute for searching. `Query` is an interface and Spring Data Elasticsearch provides three implementations: `CriteriaQuery`, `StringQuery` and `NativeQuery`.
[[elasticsearch.operations.criteriaquery]]
=== CriteriaQuery
`CriteriaQuery` based queries allow the creation of queries to search for data without knowing the syntax or basics of Elasticsearch queries.
They allow the user to build queries by simply chaining and combining `Criteria` objects that specify the criteria the searched documents must fulfill.
NOTE: when talking about AND or OR when combining criteria keep in mind, that in Elasticsearch AND are converted to a **must** condition and OR to a **should**
`Criteria` and their usage are best explained by example (let's assume we have a `Book` entity with a `price` property):
.Get books with a given price
====
[source,java]
----
Criteria criteria = new Criteria("price").is(42.0);
Query query = new CriteriaQuery(criteria);
----
====
Conditions for the same field can be chained, they will be combined with a logical AND:
.Get books with a given price
====
[source,java]
----
Criteria criteria = new Criteria("price").greaterThan(42.0).lessThan(34.0);
Query query = new CriteriaQuery(criteria);
----
====
When chaining `Criteria`, by default a AND logic is used:
.Get all persons with first name _James_ and last name _Miller_:
====
[source,java]
----
Criteria criteria = new Criteria("lastname").is("Miller") <1>
.and("firstname").is("James") <2>
Query query = new CriteriaQuery(criteria);
----
<1> the first `Criteria`
<2> the and() creates a new `Criteria` and chaines it to the first one.
====
If you want to create nested queries, you need to use subqueries for this.
Let's assume we want to find all persons with a last name of _Miller_ and a first name of either _Jack_ or _John_:
.Nested subqueries
====
[source,java]
----
Criteria miller = new Criteria("lastName").is("Miller") <.>
.subCriteria( <.>
new Criteria().or("firstName").is("John") <.>
.or("firstName").is("Jack") <.>
);
Query query = new CriteriaQuery(criteria);
----
<.> create a first `Criteria` for the last name
<.> this is combined with AND to a subCriteria
<.> This sub Criteria is an OR combination for the first name _John_
<.> and the first name Jack
====
Please refer to the API documentation of the `Criteria` class for a complete overview of the different available operations.
[[elasticsearch.operations.stringquery]]
=== StringQuery
This class takes an Elasticsearch query as JSON String.
The following code shows a query that searches for persons having the first name "Jack":
====
[source,java]
----
Query query = new StringQuery("{ \"match\": { \"firstname\": { \"query\": \"Jack\" } } } ");
SearchHits<Person> searchHits = operations.search(query, Person.class);
----
====
Using `StringQuery` may be appropriate if you already have an Elasticsearch query to use.
[[elasticsearch.operations.nativequery]]
=== NativeQuery
`NativeQuery` is the class to use when you have a complex query, or a query that cannot be expressed by using the `Criteria` API, for example when building queries and using aggregates.
It allows to use all the different `co.elastic.clients.elasticsearch._types.query_dsl.Query` implementations from the Elasticsearch library therefore named "native".
The following code shows how to search for persons with a given `firstName` and for the found documents have a terms aggregation that counts the number of occurrences of the `lastName` for these persons:
====
[source,java]
----
Query query = NativeQuery.builder()
.withAggregation("lastNames", Aggregation.of(a -> a
.terms(ta -> ta.field("lastName").size(10))))
.withQuery(q -> q
.match(m -> m
.field("firstName")
.query(firstName)
)
)
.withPageable(pageable)
.build();
SearchHits<Person> searchHits = operations.search(query, Person.class);
----
====
[[elasticsearch.operations.searchtemplatequery]]
=== SearchTemplateQuery
This is a special implementation of the `Query` interface to be used in combination with a stored search template.
See xref:elasticsearch/misc.adoc#elasticsearch.misc.searchtemplates[Search Template support] for further information.

View File

@ -0,0 +1,27 @@
[[preface.versions]]
= Versions
The following table shows the Elasticsearch and Spring versions that are used by Spring Data release trains and the version of Spring Data Elasticsearch included in that.
[cols="^,^,^,^",options="header"]
|===
| Spring Data Release Train | Spring Data Elasticsearch | Elasticsearch | Spring Framework
| 2025.1 (in development) | 6.0.x | 9.0.4 | 7.0.x
| 2025.0 | 5.5.x | 8.18.1 | 6.2.x
| 2024.1 | 5.4.x | 8.15.5 | 6.1.x
| 2024.0 | 5.3.xfootnote:oom[Out of maintenance] | 8.13.4 | 6.1.x
| 2023.1 (Vaughan) | 5.2.xfootnote:oom[] | 8.11.1 | 6.1.x
| 2023.0 (Ullmann) | 5.1.xfootnote:oom[] | 8.7.1 | 6.0.x
| 2022.0 (Turing) | 5.0.xfootnote:oom[] | 8.5.3 | 6.0.x
| 2021.2 (Raj) | 4.4.xfootnote:oom[] | 7.17.3 | 5.3.x
| 2021.1 (Q) | 4.3.xfootnote:oom[] | 7.15.2 | 5.3.x
| 2021.0 (Pascal) | 4.2.xfootnote:oom[] | 7.12.0 | 5.3.x
| 2020.0 (Ockham) | 4.1.xfootnote:oom[] | 7.9.3 | 5.3.2
| Neumann | 4.0.xfootnote:oom[] | 7.6.2 | 5.2.12
| Moore | 3.2.xfootnote:oom[] |6.8.12 | 5.2.12
| Lovelace | 3.1.xfootnote:oom[] | 6.2.2 | 5.1.19
| Kay | 3.0.xfootnote:oom[] | 5.5.0 | 5.0.13
| Ingalls | 2.1.xfootnote:oom[] | 2.4.0 | 4.3.25
|===
Support for upcoming versions of Elasticsearch is being tracked and general compatibility should be given assuming the usage of the xref:elasticsearch/template.adoc[ElasticsearchOperations interface].

View File

@ -0,0 +1,22 @@
[[spring-data-elasticsearch-reference-documentation]]
= Spring Data Elasticsearch
:revnumber: {version}
:revdate: {localdate}
:feature-scroll: true
_Spring Data Elasticsearch provides repository support for the Elasticsearch database.
It eases development of applications with a consistent programming model that need to access Elasticsearch data sources._
[horizontal]
xref:elasticsearch/versions.adoc[Versions] :: Version Compatibility Matrix
xref:elasticsearch/clients.adoc[Clients] :: Elasticsearch Client Configuration
xref:elasticsearch.adoc[Elasticsearch] :: Elasticsearch support
xref:repositories.adoc[Repositories] :: Elasticsearch Repositories
xref:migration-guides.adoc[Migration] :: Migration Guides
https://github.com/spring-projects/spring-data-commons/wiki[Wiki] :: What's New, Upgrade Notes, Supported Versions, additional cross-version information.
BioMed Central Development Team; Oliver Drotbohm; Greg Turnquist; Christoph Strobl; Peter-Josef Meisch
(C) 2008-{copyright-year} VMware, Inc.
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.

View File

@ -0,0 +1,8 @@
[[elasticsearch.migration]]
= Migration Guides
:page-section-summary-toc: 1
This section contains version-specific migration guides explaining how to upgrade across versions.

View File

@ -0,0 +1,144 @@
[[elasticsearch-migration-guide-3.2-4.0]]
= Upgrading from 3.2.x to 4.0.x
This section describes breaking changes from version 3.2.x to 4.0.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-3.2-4.0.jackson-removal]]
== Removal of the used Jackson Mapper
One of the changes in version 4.0.x is that Spring Data Elasticsearch does not use the Jackson Mapper anymore to map an entity to the JSON representation needed for Elasticsearch (see xref:elasticsearch/object-mapping.adoc[Elasticsearch Object Mapping]).
In version 3.2.x the Jackson Mapper was the default that was used.
It was possible to switch to the meta-model based converter (named `ElasticsearchEntityMapper`) by explicitly configuring it (xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model[Meta Model Object Mapping]).
In version 4.0.x the meta-model based converter is the only one that is available and does not need to be configured explicitly.
If you had a custom configuration to enable the meta-model converter by providing a bean like this:
[source,java]
----
@Bean
@Override
public EntityMapper entityMapper() {
ElasticsearchEntityMapper entityMapper = new ElasticsearchEntityMapper(
elasticsearchMappingContext(), new DefaultConversionService()
);
entityMapper.setConversions(elasticsearchCustomConversions());
return entityMapper;
}
----
You now have to remove this bean, the `ElasticsearchEntityMapper` interface has been removed.
.Entity configuration
Some users had custom Jackson annotations on the entity class, for example in order to define a custom name for the mapped document in Elasticsearch or to configure date conversions.
These are not taken into account anymore.
The needed functionality is now provided with Spring Data Elasticsearch's `@Field` annotation.
Please see xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.annotations[Mapping Annotation Overview] for detailed information.
[[elasticsearch-migration-guide-3.2-4.0.implicit-index-name]]
== Removal of implicit index name from query objects
In 3.2.x the different query classes like `IndexQuery` or `SearchQuery` had properties that were taking the index name or index names that they were operating upon.If these were not set, the passed in entity was inspected to retrieve the index name that was set in the `@Document` annotation. +
In 4.0.x the index name(s) must now be provided in an additional parameter of type `IndexCoordinates`.By separating this, it now is possible to use one query object against different indices.
So for example the following code:
[source,java]
----
IndexQuery indexQuery = new IndexQueryBuilder()
.withId(person.getId().toString())
.withObject(person)
.build();
String documentId = elasticsearchOperations.index(indexQuery);
----
must be changed to:
[source,java]
----
IndexCoordinates indexCoordinates = elasticsearchOperations.getIndexCoordinatesFor(person.getClass());
IndexQuery indexQuery = new IndexQueryBuilder()
.withId(person.getId().toString())
.withObject(person)
.build();
String documentId = elasticsearchOperations.index(indexQuery, indexCoordinates);
----
To make it easier to work with entities and use the index name that is contained in the entitie's `@Document` annotation, new methods have been added like `DocumentOperations.save(T entity)`;
[[elasticsearch-migration-guide-3.2-4.0.new-operations]]
== The new Operations interfaces
In version 3.2 there was the `ElasticsearchOperations` interface that defined all the methods for the `ElasticsearchTemplate` class. In version 4 the functions have been split into different interfaces, aligning these interfaces with the Elasticsearch API:
* `DocumentOperations` are the functions related documents like saving, or deleting
* `SearchOperations` contains the functions to search in Elasticsearch
* `IndexOperations` define the functions to operate on indexes, like index creation or mappings creation.
`ElasticsearchOperations` now extends `DocumentOperations` and `SearchOperations` and has methods get access to an `IndexOperations` instance.
NOTE: All the functions from the `ElasticsearchOperations` interface in version 3.2 that are now moved to the `IndexOperations` interface are still available, they are marked as deprecated and have default implementations that delegate to the new implementation:
[source,java]
----
/**
* Create an index for given indexName.
*
* @param indexName the name of the index
* @return {@literal true} if the index was created
* @deprecated since 4.0, use {@link IndexOperations#create()}
*/
@Deprecated
default boolean createIndex(String indexName) {
return indexOps(IndexCoordinates.of(indexName)).create();
}
----
[[elasticsearch-migration-guide-3.2-4.0.deprecations]]
== Deprecations
[[elasticsearch-migration-guide-3.2-4.0.deprecations.methods-classes]]
=== Methods and classes
Many functions and classes have been deprecated. These functions still work, but the Javadocs show with what they should be replaced.
.Example from ElasticsearchOperations
[source,java]
----
/*
* Retrieves an object from an index.
*
* @param query the query defining the id of the object to get
* @param clazz the type of the object to be returned
* @return the found object
* @deprecated since 4.0, use {@link #get(String, Class, IndexCoordinates)}
*/
@Deprecated
@Nullable
<T> T queryForObject(GetQuery query, Class<T> clazz);
----
[[elasticsearch-migration-guide-3.2-4.0.deprecations.elasticsearch]]
=== Elasticsearch deprecations
Since version 7 the Elasticsearch `TransportClient` is deprecated, it will be removed with Elasticsearch version 8. Spring Data Elasticsearch deprecates the `ElasticsearchTemplate` class which uses the `TransportClient` in version 4.0.
Mapping types were removed from Elasticsearch 7, they still exist as deprecated values in the Spring Data `@Document` annotation and the `IndexCoordinates` class but they are not used anymore internally.
[[elasticsearch-migration-guide-3.2-4.0.removal]]
== Removals
* As already described, the `ElasticsearchEntityMapper` interface has been removed.
* The `SearchQuery` interface has been merged into it's base interface `Query`, so it's occurrences can just be replaced with `Query`.
* The method `org.springframework.data.elasticsearch.core.ElasticsearchOperations.query(SearchQuery query, ResultsExtractor<T> resultsExtractor);` and the `org.springframework.data.elasticsearch.core.ResultsExtractor` interface have been removed.
These could be used to parse the result from Elasticsearch for cases in which the response mapping done with the Jackson based mapper was not enough.
Since version 4.0, there are the new xref:elasticsearch/template.adoc#elasticsearch.operations.searchresulttypes[Search Result Types] to return the information from an Elasticsearch response, so there is no need to expose this low level functionality.
* The low level methods `startScroll`, `continueScroll` and `clearScroll` have been removed from the `ElasticsearchOperations` interface.
For low level scroll API access, there now are `searchScrollStart`, `searchScrollContinue` and `searchScrollClear` methods on the `ElasticsearchRestTemplate` class.

View File

@ -0,0 +1,48 @@
[[elasticsearch-migration-guide-4.0-4.1]]
= Upgrading from 4.0.x to 4.1.x
This section describes breaking changes from version 4.0.x to 4.1.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-4.0-4.1.deprecations]]
== Deprecations
.Definition of the id property
It is possible to define a property of en entity as the id property by naming it either `id` or `document`.
This behaviour is now deprecated and will produce a warning.
Please use the `@Id` annotation to mark a property as being the id property.
.Index mappings
In the `ReactiveElasticsearchClient.Indices` interface the `updateMapping` methods are deprecated in favour of the `putMapping` methods.
They do the same, but `putMapping` is consistent with the naming in the Elasticsearch API:
.Alias handling
In the `IndexOperations` interface the methods `addAlias(AliasQuery)`, `removeAlias(AliasQuery)` and `queryForAlias()` have been deprecated.
The new methods `alias(AliasAction)`, `getAliases(String...)` and `getAliasesForIndex(String...)` offer more functionality and a cleaner API.
.Parent-ID
Usage of a parent-id has been removed from Elasticsearch since version 6. We now deprecate the corresponding fields and methods.
[[elasticsearch-migration-guide-4.0-4.1.removal]]
== Removals
.Type mappings
The _type mappings_ parameters of the `@Document` annotation and the `IndexCoordinates` object were removed.
They had been deprecated in Spring Data Elasticsearch 4.0 and their values weren't used anymore.
[[elasticsearch-migration-guide-4.0-4.1.breaking-changes]]
== Breaking Changes
[[elasticsearch-migration-guide-4.0-4.1.breaking-changes.returntypes-1]]
=== Return types of ReactiveElasticsearchClient.Indices methods
The methods in the `ReactiveElasticsearchClient.Indices` were not used up to now.
With the introduction of the `ReactiveIndexOperations` it became necessary to change some of the return types:
* the `createIndex` variants now return a `Mono<Boolean>` instead of a `Mono<Void>` to signal successful index creation.
* the `updateMapping` variants now return a `Mono<Boolean>` instead of a `Mono<Void>` to signal successful mappings storage.
[[elasticsearch-migration-guide-4.0-4.1.breaking-changes.returntypes-2]]
=== Return types of DocumentOperations.bulkIndex methods
These methods were returning a `List<String>` containing the ids of the new indexed records.
Now they return a `List<IndexedObjectInformation>`; these objects contain the id and information about optimistic locking (seq_no and primary_term)

View File

@ -0,0 +1,74 @@
[[elasticsearch-migration-guide-4.1-4.2]]
= Upgrading from 4.1.x to 4.2.x
This section describes breaking changes from version 4.1.x to 4.2.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-4.1-4.2.deprecations]]
== Deprecations
[[elasticsearch-migration-guide-4.1-4.2.deprecations.document]]
=== @Document parameters
The parameters of the `@Document` annotation that are relevant for the index settings (`useServerConfiguration`, `shards`. `replicas`, `refreshIntervall` and `indexStoretype`) have been moved to the `@Setting` annotation. Use in `@Document` is still possible but deprecated.
[[elasticsearch-migration-guide-4.1-4.2.removal]]
== Removals
The `@Score` annotation that was used to set the score return value in an entity was deprecated in version 4.0 and has been removed.
Score values are returned in the `SearchHit` instances that encapsulate the returned entities.
The `org.springframework.data.elasticsearch.ElasticsearchException` class has been removed.
The remaining usages have been replaced with `org.springframework.data.mapping.MappingException` and `org.springframework.dao.InvalidDataAccessApiUsageException`.
The deprecated `ScoredPage`, `ScrolledPage` `@AggregatedPage` and implementations has been removed.
The deprecated `GetQuery` and `DeleteQuery` have been removed.
The deprecated `find` methods from `ReactiveSearchOperations` and `ReactiveDocumentOperations` have been removed.
[[elasticsearch-migration-guide-4.1-4.2.breaking-changes]]
== Breaking Changes
[[elasticsearch-migration-guide-4.1-4.2.breaking-changes.refresh-policy]]
=== RefreshPolicy
[[elasticsearch-migration-guide-4.1-4.2.breaking-changes.refresh-policy.enum]]
==== Enum package changed
It was possible in 4.1 to configure the refresh policy for the `ReactiveElasticsearchTemplate` by overriding the method `AbstractReactiveElasticsearchConfiguration.refreshPolicy()` in a custom configuration class.
The return value of this method was an instance of the class `org.elasticsearch.action.support.WriteRequest.RefreshPolicy`.
Now the configuration must return `org.springframework.data.elasticsearch.core.RefreshPolicy`.
This enum has the same values and triggers the same behaviour as before, so only the `import` statement has to be adjusted.
[[elasticsearch-migration-guide-4.1-4.2.breaking-changes.refresh-policy.behaviour]]
==== Refresh behaviour
`ElasticsearchOperations` and `ReactiveElasticsearchOperations` now explicitly use the `RefreshPolicy` set on the template for write requests if not null.
If the refresh policy is null, then nothing special is done, so the cluster defaults are used. `ElasticsearchOperations` was always using the cluster default before this version.
The provided implementations for `ElasticsearchRepository` and `ReactiveElasticsearchRepository` will do an explicit refresh when the refresh policy is null.
This is the same behaviour as in previous versions.
If a refresh policy is set, then it will be used by the repositories as well.
[[elasticsearch-migration-guide-4.1-4.2.breaking-changes.refresh-policy.configuration]]
==== Refresh configuration
When configuring Spring Data Elasticsearch like described in xref:elasticsearch/clients.adoc[Elasticsearch Clients] by using `ElasticsearchConfigurationSupport`, `AbstractElasticsearchConfiguration` or `AbstractReactiveElasticsearchConfiguration` the refresh policy will be initialized to `null`.
Previously the reactive code initialized this to `IMMEDIATE`, now reactive and non-reactive code show the same behaviour.
[[elasticsearch-migration-guide-4.1-4.2.breaking-changes.method-return-types]]
=== Method return types
[[elasticsearch-migration-guide-4.1-4.2.breaking-changes.method-return-types.delete]]
==== delete methods that take a Query
The reactive methods previously returned a `Mono<Long>` with the number of deleted documents, the non reactive versions were void. They now return a `Mono<ByQueryResponse>` which contains much more detailed information about the deleted documents and errors that might have occurred.
[[elasticsearch-migration-guide-4.1-4.2.breaking-changes.method-return-types.multiget]]
==== multiget methods
The implementations of _multiget_ previousl only returned the found entities in a `List<T>` for non-reactive implementations and in a `Flux<T>` for reactive implementations. If the request contained ids that were not found, the information that these are missing was not available. The user needed to compare the returned ids to the requested ones to find
which ones were missing.
Now the `multiget` methods return a `MultiGetItem` for every requested id. This contains information about failures (like non existing indices) and the information if the item existed (then it is contained in the `MultiGetItem) or not.

View File

@ -0,0 +1,87 @@
[[elasticsearch-migration-guide-4.2-4.3]]
= Upgrading from 4.2.x to 4.3.x
This section describes breaking changes from version 4.2.x to 4.3.x and how removed features can be replaced by new introduced features.
[NOTE]
====
Elasticsearch is working on a new Client that will replace the `RestHighLevelClient` because the `RestHighLevelClient` uses code from Elasticsearch core libraries which are not Apache 2 licensed anymore.
Spring Data Elasticsearch is preparing for this change as well.
This means that internally the implementations for the `*Operations` interfaces need to change - which should be no problem if users program against the interfaces like `ElasticsearchOperations` or `ReactiveElasticsearchOperations`.
If you are using the implementation classes like `ElasticsearchRestTemplate` directly, you will need to adapt to these changes.
Spring Data Elasticsearch also removes or replaces the use of classes from the `org.elasticsearch` packages in it's API classes and methods, only using them in the implementation where the access to Elasticsearch is implemented.
For the user that means, that some enum classes that were used are replaced by enums that live in `org.springframework.data.elasticsearch` with the same values, these are internally mapped onto the Elasticsearch ones.
Places where classes are used that cannot easily be replaced, this usage is marked as deprecated, we are working on replacements.
Check the sections on xref:migration-guides/migration-guide-4.2-4.3.adoc#elasticsearch-migration-guide-4.2-4.3.deprecations[Deprecations] and xref:migration-guides/migration-guide-4.2-4.3.adoc#elasticsearch-migration-guide-4.2-4.3.breaking-changes[Breaking Changes] for further details.
====
[[elasticsearch-migration-guide-4.2-4.3.deprecations]]
== Deprecations
[[elasticsearch-migration-guide-4.2-4.3.deprecations.suggest]]
=== suggest methods
In `SearchOperations`, and so in `ElasticsearchOperations` as well, the `suggest` methods taking a `org.elasticsearch.search.suggest.SuggestBuilder` as argument and returning a `org.elasticsearch.action.search.SearchResponse` have been deprecated.
Use `SearchHits<T> search(Query query, Class<T> clazz)` instead, passing in a `NativeSearchQuery` which can contain a `SuggestBuilder` and read the suggest results from the returned `SearchHit<T>`.
In `ReactiveSearchOperations` the new `suggest` methods return a `Mono<org.springframework.data.elasticsearch.core.suggest.response.Suggest>` now.
Here as well the old methods are deprecated.
[[elasticsearch-migration-guide-4.2-4.3.breaking-changes]]
== Breaking Changes
[[elasticsearch-migration-guide-4.2-4.3.breaking-changes.1]]
=== Removal of `org.elasticsearch` classes from the API.
* In the `org.springframework.data.elasticsearch.annotations.CompletionContext` annotation the property `type()` has changed from `org.elasticsearch.search.suggest.completion.context.ContextMapping.Type` to `org.springframework.data.elasticsearch.annotations.CompletionContext.ContextMappingType`, the available enum values are the same.
* In the `org.springframework.data.elasticsearch.annotations.Document` annotation the `versionType()` property has changed to `org.springframework.data.elasticsearch.annotations.Document.VersionType`, the available enum values are the same.
* In the `org.springframework.data.elasticsearch.core.query.Query` interface the `searchType()` property has changed to `org.springframework.data.elasticsearch.core.query.Query.SearchType`, the available enum values are the same.
* In the `org.springframework.data.elasticsearch.core.query.Query` interface the return value of `timeout()` was changed to `java.time.Duration`.
* The `SearchHits<T>`class does not contain the `org.elasticsearch.search.aggregations.Aggregations` anymore.
Instead it now contains an instance of the `org.springframework.data.elasticsearch.core.AggregationsContainer<T>` class where `T` is the concrete aggregations type from the underlying client that is used.
Currently this will be a `org
.springframework.data.elasticsearch.core.clients.elasticsearch7.ElasticsearchAggregations` object; later different implementations will be available.
The same change has been done to the `ReactiveSearchOperations.aggregate()` functions, the now return a `Flux<AggregationContainer<?>>`.
Programs using the aggregations need to be changed to cast the returned value to the appropriate class to further proces it.
* methods that might have thrown a `org.elasticsearch.ElasticsearchStatusException` now will throw `org.springframework.data.elasticsearch.RestStatusException` instead.
[[elasticsearch-migration-guide-4.2-4.3.breaking-changes.2]]
=== Handling of field and sourceFilter properties of Query
Up to version 4.2 the `fields` property of a `Query` was interpreted and added to the include list of the `sourceFilter`.
This was not correct, as these are different things for Elasticsearch.
This has been corrected.
As a consequence code might not work anymore that relies on using `fields` to specify which fields should be returned from the document's `_source' and should be changed to use the `sourceFilter`.
[[elasticsearch-migration-guide-4.2-4.3.breaking-changes.3]]
=== search_type default value
The default value for the `search_type` in Elasticsearch is `query_then_fetch`.
This now is also set as default value in the `Query` implementations, it was previously set to `dfs_query_then_fetch`.
[[elasticsearch-migration-guide-4.2-4.3.breaking-changes.4]]
=== BulkOptions changes
Some properties of the `org.springframework.data.elasticsearch.core.query.BulkOptions` class have changed their type:
* the type of the `timeout` property has been changed to `java.time.Duration`.
* the type of the`refreshPolicy` property has been changed to `org.springframework.data.elasticsearch.core.RefreshPolicy`.
[[elasticsearch-migration-guide-4.2-4.3.breaking-changes.5]]
=== IndicesOptions change
Spring Data Elasticsearch now uses `org.springframework.data.elasticsearch.core.query.IndicesOptions` instead of `org.elasticsearch.action.support.IndicesOptions`.
[[elasticsearch-migration-guide-4.2-4.3.breaking-changes.6]]
=== Completion classes
The classes from the package `org.springframework.data.elasticsearch.core.completion` have been moved to `org.springframework.data.elasticsearch.core.suggest`.
[[elasticsearch-migration-guide-4.2-4.3.breaking-changes.7]]
=== Other renamings
The `org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentPropertyConverter` interface has been renamed to `org.springframework.data.elasticsearch.core.mapping.PropertyValueConverter`.
Likewise the implementations classes named _XXPersistentPropertyConverter_ have been renamed to _XXPropertyValueConverter_.

View File

@ -0,0 +1,183 @@
[[elasticsearch-migration-guide-4.3-4.4]]
= Upgrading from 4.3.x to 4.4.x
This section describes breaking changes from version 4.3.x to 4.4.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-4.3-4.4.deprecations]]
== Deprecations
[[elasticsearch-migration-guide-4.3-4.4.deprecations.reactive-operations]]
=== org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations
The method `<T> Publisher<T> execute(ClientCallback<Publisher<T>> callback)` has been deprecated.
As there now are multiple implementations using different client libraries the `execute` method is still available in the different implementations, but there is no more method in the interface, because there is no common callback interface for the different clients.
[[elasticsearch-migration-guide-4.3-4.4.breaking-changes]]
== Breaking Changes
[[elasticsearch-migration-guide-4.3-4.4.breaking-changes.1]]
=== Removal of deprecated classes
[[org-springframework-data-elasticsearch-core-elasticsearchtemplate-has-been-removed]]
==== `org.springframework.data.elasticsearch.core.ElasticsearchTemplate` has been removed
As of version 4.4 Spring Data Elasticsearch does not use the `TransportClient` from Elasticsearch anymore (which itself is deprecated since Elasticsearch 7.0).
This means that the `org.springframework.data.elasticsearch.core.ElasticsearchTemplate` class which was deprecated since Spring Data Elasticsearch 4.0 has been removed.
This was the implementation of the `ElasticsearchOperations` interface that was using the `TransportClient`.
Connections to Elasticsearch must be made using either the imperative `ElasticsearchRestTemplate` or the reactive `ReactiveElasticsearchTemplate`.
[[elasticsearch-migration-guide-4.3-4.4.breaking-changes.2]]
=== Package changes
In 4.3 two classes (`ElasticsearchAggregations` and `ElasticsearchAggregation`) had been moved to the `org.springframework.data.elasticsearch.core.clients.elasticsearch7` package in preparation for the integration of the new Elasticsearch client.
The were moved back to the `org.springframework.data.elasticsearch.core` package as we keep the classes use the old Elasticsearch client where they were.
[[elasticsearch-migration-guide-4.3-4.4.breaking-changes.3]]
=== Behaviour change
The `ReactiveElasticsearchTemplate`, when created directly or by Spring Boot configuration had a default refresh policy of IMMEDIATE.
This could cause performance issues on heavy indexing and was different than the default behaviour of Elasticsearch.
This has been changed to that now the default refresh policy is NONE.
When the
`ReactiveElasticsearchTemplate` was provided by using the configuration like described in xref:elasticsearch/clients.adoc#elasticsearch.clients.reactiverestclient[Reactive REST Client] the default refresh policy already was set to NONE.
[[elasticsearch-migration-guide-4.3-4.4.new-clients]]
== New Elasticsearch client
Elasticsearch has introduced it's new `ElasticsearchClient` and has deprecated the previous `RestHighLevelClient`.
Spring Data Elasticsearch 4.4 still uses the old client as the default client for the following reasons:
* The new client forces applications to use the `jakarta.json.spi.JsonProvider` package whereas Spring Boot will stick to `javax.json.spi.JsonProvider` until version 3. So switching the default implementaiton in Spring Data Elasticsearch can only come with Spring Data Elasticsearch 5 (Spring Data 3, Spring 6).
* There are still some bugs in the Elasticsearch client which need to be resolved
* The implementation using the new client in Spring Data Elasticsearch is not yet complete, due to limited resources working on that - remember Spring Data Elasticsearch is a community driven project that lives from public contributions.
[[elasticsearch-migration-guide-4.3-4.4.new-clients.how-to]]
=== How to use the new client
CAUTION: The implementation using the new client is not complete, some operations will throw a `java.lang.UnsupportedOperationException` or might throw NPE (for example when the Elasticsearch cannot parse a response from the server, this still happens sometimes) +
Use the new client to test the implementations but do not use it in productive code yet!
In order to try and use the new client the following steps are necessary:
[[elasticsearch-migration-guide-4.3-4.4.new-clients.how-to.not]]
==== Make sure not to configure the existing default client
If using Spring Boot, exclude Spring Data Elasticsearch from the autoconfiguration
====
[source,java]
----
@SpringBootApplication(exclude = ElasticsearchDataAutoConfiguration.class)
public class SpringdataElasticTestApplication {
// ...
}
----
====
Remove Spring Data Elasticsearch related properties from your application configuration.
If Spring Data Elasticsearch was configured using a programmatic configuration (see xref:elasticsearch/clients.adoc[Elasticsearch Clients]), remove these beans from the Spring application context.
[[elasticsearch-migration-guide-4.3-4.4.new-clients.how-to.dependencies]]
==== Add dependencies
The dependencies for the new Elasticsearch client are still optional in Spring Data Elasticsearch so they need to be added explicitly:
====
[source,xml]
----
<dependencies>
<dependency>
<groupId>co.elastic.clients</groupId>
<artifactId>elasticsearch-java</artifactId>
<version>7.17.3</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId> <!-- is Apache 2-->
<version>7.17.3</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
----
====
When using Spring Boot, it is necessary to set the following property in the _pom.xml_.
====
[source,xml]
----
<properties>
<jakarta-json.version>2.0.1</jakarta-json.version>
</properties>
----
====
[[elasticsearch-migration-guide-4.3-4.4.new-clients.how-to.configuration]]
==== New configuration classes
[[elasticsearch-migration-guide-4.3-4.4.new-clients.how-to.configuration.imperative]]
===== Imperative style
In order configure Spring Data Elasticsearch to use the new client, it is necessary to create a configuration bean that derives from `org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration`:
====
[source,java]
----
@Configuration
public class NewRestClientConfig extends ElasticsearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder() //
.connectedTo("localhost:9200") //
.build();
}
}
----
====
The configuration is done in the same way as with the old client, but it is not necessary anymore to create more than the configuration bean.
With this configuration, the following beans will be available in the Spring application context:
* a `RestClient` bean, that is the configured low level `RestClient` that is used by the Elasticsearch client
* an `ElasticsearchClient` bean, this is the new client that uses the `RestClient`
* an `ElasticsearchOperations` bean, available with the bean names _elasticsearchOperations_ and _elasticsearchTemplate_, this uses the `ElasticsearchClient`
[[elasticsearch-migration-guide-4.3-4.4.new-clients.how-to.configuration.reactive]]
===== Reactive style
To use the new client in a reactive environment the only difference is the class from which to derive the configuration:
====
[source,java]
----
@Configuration
public class NewRestClientConfig extends ReactiveElasticsearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder() //
.connectedTo("localhost:9200") //
.build();
}
}
----
====
With this configuration, the following beans will be available in the Spring application context:
* a `RestClient` bean, that is the configured low level `RestClient` that is used by the Elasticsearch client
* an `ReactiveElasticsearchClient` bean, this is the new reactive client that uses the `RestClient`
* an `ReactiveElasticsearchOperations` bean, available with the bean names _reactiveElasticsearchOperations_ and _reactiveElasticsearchTemplate_, this uses the `ReactiveElasticsearchClient`

View File

@ -0,0 +1,167 @@
[[elasticsearch-migration-guide-4.4-5.0]]
= Upgrading from 4.4.x to 5.0.x
This section describes breaking changes from version 4.4.x to 5.0.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-4.4-4.5.deprecations]]
== Deprecations
[[custom-trace-level-logging]]
=== Custom trace level logging
Logging by setting the property `logging.level.org.springframework.data.elasticsearch.client.WIRE=trace` is deprecated now, the Elasticsearch `RestClient` provides a better solution that can be activated by setting the logging level of the `tracer` package to "trace".
[[elasticsearch-migration-guide-4.4-4.5.deprecations.package]]
=== `org.springframework.data.elasticsearch.client.erhlc` package
See xref:migration-guides/migration-guide-4.4-5.0.adoc#elasticsearch-migration-guide-4.4-5.0.breaking-changes-packages[Package changes], all classes in this package have been deprecated, as the default client implementations to use are the ones based on the new Java Client from Elasticsearch, see xref:migration-guides/migration-guide-4.4-5.0.adoc#elasticsearch-migration-guide-4.4-5.0.new-clients[New Elasticsearch client]
[[elasticsearch-migration-guide-4.4-4.5.deprecations.code]]
=== Removal of deprecated code
`DateFormat.none` and `DateFormat.custom` had been deprecated since version 4.2 and have been removed.
The properties of `@Document` that were deprecated since 4.2 have been removed.
Use the `@Settings` annotation for these.
`@DynamicMapping` and `@DynamicMappingValue` have been removed.
Use `@Document.dynamic` or `@Field.dynamic` instead.
[[elasticsearch-migration-guide-4.4-5.0.breaking-changes]]
== Breaking Changes
[[elasticsearch-migration-guide-4.4-5.0.breaking-changes.deprecated-calls]]
=== Removal of deprecated calls
[[elasticsearch-migration-guide-4.4-5.0.breaking-changes.deprecated-calls.1]]
==== suggest calls in operations interfaces have been removed
Both `SearchOperations` and `ReactiveSearchOperations` had deprecated calls that were using Elasticsearch classes as parameters.
These now have been removed and so the dependency on Elasticsearch classes in these APIs has been cleaned.
[[elasticsearch-migration-guide-4.4-5.0.breaking-changes-packages]]
=== Package changes
All the classes that are using or depend on the deprecated Elasticsearch `RestHighLevelClient` have been moved to the package `org.springframework.data.elasticsearch.client.erhlc`.
By this change we now have a clear separation of code using the old deprecated Elasticsearch libraries, code using the new Elasticsearch client and code that is independent of the client implementation.
Also the reactive implementation that was provided up to now has been moved here, as this implementation contains code that was copied and adapted from Elasticsearch libraries.
If you are using `ElasticsearchRestTemplate` directly and not the `ElasticsearchOperations` interface you'll need to adjust your imports as well.
When working with the `NativeSearchQuery` class, you'll need to switch to the `NativeQuery` class, which can take a
`Query` instance coming from the new Elasticsearch client libraries.
You'll find plenty of examples in the test code.
[[elasticsearch-migration-guide-4.4-5.0.breaking-changes-records]]
=== Conversion to Java 17 records
The following classes have been converted to `Record`, you might need to adjust the use of getter methods from
`getProp()` to `prop()`:
* `org.springframework.data.elasticsearch.core.AbstractReactiveElasticsearchTemplate.IndexResponseMetaData`
* `org.springframework.data.elasticsearch.core.ActiveShardCount`
* `org.springframework.data.elasticsearch.support.Version`
* `org.springframework.data.elasticsearch.support.ScoreDoc`
* `org.springframework.data.elasticsearch.core.query.ScriptData`
* `org.springframework.data.elasticsearch.core.query.SeqNoPrimaryTerm`
[[elasticsearch-migration-guide-4.4-5.0.breaking-changes-http-headers]]
=== New HttpHeaders class
Until version 4.4 the client configuration used the `HttpHeaders` class from the `org.springframework:spring-web`
project.
This introduces a dependency on that artifact.
Users that do not use spring-web then face an error as this class cannot be found.
In version 5.0 we introduce our own `HttpHeaders` to configure the clients.
So if you are using headers in the client configuration, you need to replace `org.springframework.http.HttpHeaders`
with `org.springframework.data.elasticsearch.support.HttpHeaders`.
Hint: You can pass a `org.springframework.http
.HttpHeaders` to the `addAll()` method of `org.springframework.data.elasticsearch.support.HttpHeaders`.
[[elasticsearch-migration-guide-4.4-5.0.new-clients]]
== New Elasticsearch client
Spring Data Elasticsearch now uses the new `ElasticsearchClient` and has deprecated the use of the previous `RestHighLevelClient`.
[[elasticsearch-migration-guide-4.4-5.0.new-clients.imperative]]
=== Imperative style configuration
To configure Spring Data Elasticsearch to use the new client, it is necessary to create a configuration bean that derives from `org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration`:
====
[source,java]
----
@Configuration
public class NewRestClientConfig extends ElasticsearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder() //
.connectedTo("localhost:9200") //
.build();
}
}
----
====
The configuration is done in the same way as with the old client, but it is not necessary anymore to create more than the configuration bean.
With this configuration, the following beans will be available in the Spring application context:
* a `RestClient` bean, that is the configured low level `RestClient` that is used by the Elasticsearch client
* an `ElasticsearchClient` bean, this is the new client that uses the `RestClient`
* an `ElasticsearchOperations` bean, available with the bean names _elasticsearchOperations_ and _elasticsearchTemplate_, this uses the `ElasticsearchClient`
[[elasticsearch-migration-guide-4.4-5.0.new-clients.reactive]]
=== Reactive style configuration
To use the new client in a reactive environment the only difference is the class from which to derive the configuration:
====
[source,java]
----
@Configuration
public class NewRestClientConfig extends ReactiveElasticsearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder() //
.connectedTo("localhost:9200") //
.build();
}
}
----
====
With this configuration, the following beans will be available in the Spring application context:
* a `RestClient` bean, that is the configured low level `RestClient` that is used by the Elasticsearch client
* an `ReactiveElasticsearchClient` bean, this is the new reactive client that uses the `RestClient`
* an `ReactiveElasticsearchOperations` bean, available with the bean names _reactiveElasticsearchOperations_ and _reactiveElasticsearchTemplate_, this uses the `ReactiveElasticsearchClient`
[[elasticsearch-migration-guide-4.4-5.0.old-client]]
=== Still want to use the old client?
The old deprecated `RestHighLevelClient` can still be used, but you will need to add the dependency explicitly to your application as Spring Data Elasticsearch does not pull it in automatically anymore:
====
[source,xml]
----
<!-- include the RHLC, specify version explicitly -->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.17.5</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
----
====
Make sure to specify the version 7.17.6 explicitly, otherwise maven will resolve to 8.5.0, and this does not exist.

View File

@ -0,0 +1,27 @@
[[elasticsearch-migration-guide-5.0-5.1]]
= Upgrading from 5.0.x to 5.1.x
This section describes breaking changes from version 5.0.x to 5.1.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-5.0-5.1.breaking-changes]]
== Breaking Changes
In the `org.springframework.data.elasticsearch.core.index.AliasData` class, which is used for alias information returned from Elasticsearch, the property `filter` (of type `Document`) is replaced by `filterQuery` which is of type
`org.springframework.data.elasticsearch.core.query.Query`.
`org.springframework.data.elasticsearch.annotations.Similarity` was an enum class until 5.1. This enum was used in the `@Field` annotation to specify a similarity value.
But besides the values defined by the enum, it is possible to have similarities with custom names in Elasticsearch.
Therefore, the annotation property was changed from the type of the enum to a simple `String`.
The previous enum values like `Similarity.Default` do still exist as String constants, so existing code will compile unmodified.
Adaptions are necessary when this enum was used at other places than as a property of the `@Field` annotation.
[[elasticsearch-migration-guide-5.0-5.1.deprecations]]
== Deprecations
[[template-functions]]
=== template functions
The functions in the `IndexOperations` and `ReactiverIndexOperations` to manage index templates that were introduced in Spring Data Elasticsearch 4.1
have been deprecated. They were using the old Elasticsearch API that was deprecated in Elasticsearch version 7.8.
Please use the new functions that are based on the composable index template API instead.

View File

@ -0,0 +1,40 @@
[[elasticsearch-migration-guide-5.1-5.2]]
= Upgrading from 5.1.x to 5.2.x
This section describes breaking changes from version 5.1.x to 5.2.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-5.1-5.2.breaking-changes]]
== Breaking Changes
[[bulk-failures]]
=== Bulk failures
In the `org.springframework.data.elasticsearch.BulkFailureException` class, the return type of the `getFailedDocuments` is changed from `Map<String, String>`
to `Map<String, FailureDetails>`, which allows to get additional details about failure reasons.
The definition of the `FailureDetails` class (inner to `BulkFailureException`):
[source,java]
public record FailureDetails(Integer status, String errorMessage) {
}
[[scripted-and-runtime-fields]]
=== scripted and runtime fields
The classes `org.springframework.data.elasticsearch.core.RuntimeField` and `org.springframework.data.elasticsearch.core.query.ScriptType` have been moved to the subpackage `org.springframework.data.elasticsearch.core.query`.
The `type` parameter of the `ScriptData` constructor is not nullable any longer.
[[elasticsearch-migration-guide-5.1-5.2.deprecations]]
== Deprecations
[[removal-of-deprecated-code]]
=== Removal of deprecated code
* All the code using the old deprecated `RestHighLevelClient` has been removed.
The default Elasticsearch client used since version 5.0 is the (not so) new Elasticsearch Java client.
* The `org.springframework.data.elasticsearch.client.ClientLogger` class has been removed.
This logger was configured with the `org.springframework.data.elasticsearch.client.WIRE` setting, but was not working with all clients.
From version 5 on, use the trace logger available in the Elasticsearch Java client, see xref:elasticsearch/clients.adoc#elasticsearch.clients.logging[Client Logging].
* The method `org.springframework.data.elasticsearch.core.ElasticsearchOperations.stringIdRepresentation(Object)` has been removed, use the `convertId(Object)` method defined in the same interface instead.
* The class `org.springframework.data.elasticsearch.core.Range` has been removed, use `org.springframework.data.domain.Range` instead.
* The methods `org.springframework.data.elasticsearch.core.query.IndexQuery.getParentId() and `setParentId(String)` have been removed, they weren't used anymore and were no-ops.
It has been removed from the `org.springframework.data.elasticsearch.core.query.IndexQuery` class as well.

View File

@ -0,0 +1,21 @@
[[elasticsearch-migration-guide-5.2-5.3]]
= Upgrading from 5.2.x to 5.3.x
This section describes breaking changes from version 5.2.x to 5.3.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-5.2-5.3.breaking-changes]]
== Breaking Changes
During the parameter replacement in `@Query` annotated repository methods previous versions wrote the String `"null"` into the query that was sent to Elasticsearch when the actual parameter value was `null`.
As Elasticsearch does not store `null` values, this behaviour could lead to problems, for example whent the fields to be searched contains the string `"null"`.
In Version 5.3 a `null` value in a parameter will cause a `ConversionException` to be thrown.
If you are using `"null"` as the
`null_value` defined in a field mapping, then pass that string into the query instead of a Java `null`.
[[elasticsearch-migration-guide-5.2-5.3.deprecations]]
== Deprecations
=== Removals
The deprecated classes `org.springframework.data.elasticsearch.ELCQueries`
and `org.springframework.data.elasticsearch.client.elc.QueryBuilders` have been removed, use `org.springframework.data.elasticsearch.client.elc.Queries` instead.

View File

@ -0,0 +1,23 @@
[[elasticsearch-migration-guide-5.3-5.4]]
= Upgrading from 5.3.x to 5.4.x
This section describes breaking changes from version 5.3.x to 5.4.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-5.3-5.4.breaking-changes]]
== Breaking Changes
[[elasticsearch-migration-guide-5.3-5.4.breaking-changes.knn-search]]
=== knn search
The `withKnnQuery` method in `NativeQueryBuilder` has been replaced with `withKnnSearches` to build a `NativeQuery` with knn search.
`KnnQuery` and `KnnSearch` are two different classes in elasticsearch java client and are used for different queries, with different parameters supported:
- `KnnSearch`: is https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-search.html#search-api-knn[the top level `knn` query] in the elasticsearch request;
- `KnnQuery`: is https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-knn-query.html[the `knn` query inside `query` clause];
If `KnnQuery` is still preferable, please be sure to construct it inside `query` clause manually, by means of `withQuery(co.elastic.clients.elasticsearch._types.query_dsl.Query query)` clause in `NativeQueryBuilder`.
[[elasticsearch-migration-guide-5.3-5.4.deprecations]]
== Deprecations
=== Removals

View File

@ -0,0 +1,30 @@
[[elasticsearch-migration-guide-5.4-5.5]]
= Upgrading from 5.4.x to 5.5.x
This section describes breaking changes from version 5.4.x to 5.5.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-5.4-5.5.breaking-changes]]
== Breaking Changes
[[elasticsearch-migration-guide-5.4-5.5.deprecations]]
== Deprecations
Some classes that probably are not used by a library user have been renamed, the classes with the old names are still there, but are deprecated:
|===
|old name|new name
|ElasticsearchPartQuery|RepositoryPartQuery
|ElasticsearchStringQuery|RepositoryStringQuery
|ReactiveElasticsearchStringQuery|ReactiveRepositoryStringQuery
|===
=== Removals
The following methods that had been deprecated since release 5.3 have been removed:
```
DocumentOperations.delete(Query, Class<?>)
DocumentOperations.delete(Query, Class<?>, IndexCoordinates)
ReactiveDocumentOperations.delete(Query, Class<?>)
ReactiveDocumentOperations.delete(Query, Class<?>, IndexCoordinates)
```

View File

@ -0,0 +1,27 @@
[[elasticsearch-migration-guide-5.5-6.0]]
= Upgrading from 5.5.x to 6.0.x
This section describes breaking changes from version 5.5.x to 6.0.x and how removed features can be replaced by new introduced features.
[[elasticsearch-migration-guide-5.5-6.0.breaking-changes]]
== Breaking Changes
From version 6.0 on, Spring Data Elasticsearch uses the Elasticsearch 9 libraries and as default the new `Rest5Client` provided by these libraries. It is still possible to use the old `RestClient`, check xref:elasticsearch/clients.adoc[Elasticsearch clients] for information. The configuration callbacks for this `RestClient` have been moved from `org.springframework.data.elasticsearch.client.elc.ElasticsearchClients` to the `org.springframework.data.elasticsearch.client.elc.rest_client.RestClients` class.
In the `org.springframework.data.elasticsearch.core.query.UpdateQuery` class the type of the two fields `ifSeqNo` and `ifPrimaryTerm` has changed from `Integer` to `Long` to align with the normal query and the underlying Elasticsearch client.
[[elasticsearch-migration-guide-5.5-6.0.deprecations]]
== Deprecations
All the code using the old `RestClient` has been moved to the `org.springframework.data.elasticsearch.client.elc.rest_client` package and has been deprecated. Users should switch to the classes from the `org.springframework.data.elasticsearch.client.elc.rest5_client` package.
=== Removals
The `org.springframework.data.elasticsearch.core.query.ScriptType` enum has been removed. To distinguish between an inline and a stored script set the appropriate values in the `org.springframework.data.elasticsearch.core.query.ScriptData` record.
These methods have been removed because the Elasticsearch Client 9 does not support them anymore:
```
org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchIndicesClient.unfreeze(UnfreezeRequest)
org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchIndicesClient.unfreeze(Function<UnfreezeRequest.Builder, ObjectBuilder<UnfreezeRequest>>)
```

View File

@ -0,0 +1,8 @@
[[elasticsearch.repositories]]
= Repositories
:page-section-summary-toc: 1
This chapter explains the basic foundations of Spring Data repositories and Elasticsearch specifics.
Before continuing to the Elasticsearch specifics, make sure you have a sound understanding of the basic concepts.
The goal of the Spring Data repository abstraction is to significantly reduce the amount of boilerplate code required to implement data access layers for various persistence stores.

View File

@ -0,0 +1,4 @@
include::{commons}@data-commons::page$repositories/core-concepts.adoc[]
[[elasticsearch.entity-persistence.state-detection-strategies]]
include::{commons}@data-commons::page$is-new-state-detection.adoc[leveloffset=+1]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$repositories/core-domain-events.adoc[]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$repositories/core-extensions.adoc[]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$repositories/create-instances.adoc[]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$repositories/custom-implementations.adoc[]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$repositories/definition.adoc[]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$repositories/null-handling.adoc[]

View File

@ -0,0 +1,4 @@
[[elasticsearch.projections]]
= Projections
include::{commons}@data-commons::page$repositories/projections.adoc[leveloffset=+1]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$repositories/query-keywords-reference.adoc[]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$repositories/query-methods-details.adoc[]

View File

@ -0,0 +1 @@
include::{commons}@data-commons::page$repositories/query-return-types-reference.adoc[]

View File

@ -0,0 +1,21 @@
version: ${antora-component.version}
prerelease: ${antora-component.prerelease}
asciidoc:
attributes:
copyright-year: ${current.year}
version: ${project.version}
springversionshort: ${spring.short}
springversion: ${spring}
attribute-missing: 'warn'
commons: ${springdata.commons.docs}
include-xml-namespaces: false
spring-data-commons-docs-url: https://docs.spring.io/spring-data/commons/reference
spring-data-commons-javadoc-base: https://docs.spring.io/spring-data/commons/docs/${springdata.commons}/api/
springdocsurl: https://docs.spring.io/spring-framework/reference/{springversionshort}
springjavadocurl: https://docs.spring.io/spring-framework/docs/${spring}/javadoc-api
spring-framework-docs: '{springdocsurl}'
spring-framework-javadoc: '{springjavadocurl}'
springhateoasversion: ${spring-hateoas}
releasetrainversion: ${releasetrain}
store: Elasticsearch

View File

@ -1,36 +0,0 @@
= Spring Data Elasticsearch
BioMed Central Development Team
:revnumber: {version}
:revdate: {localdate}
:toc:
:toc-placement!:
:spring-data-commons-docs: ../../../../spring-data-commons/src/main/asciidoc
(C) 2013-2015 The original author(s).
NOTE: Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
toc::[]
include::preface.adoc[]
:leveloffset: +1
include::{spring-data-commons-docs}/repositories.adoc[]
:leveloffset: -1
[[reference]]
= Reference Documentation
:leveloffset: +1
include::reference/data-elasticsearch.adoc[]
include::reference/elasticsearch-misc.adoc[]
:leveloffset: -1
[[appendix]]
= Appendix
:numbered!:
:leveloffset: +1
include::{spring-data-commons-docs}/repository-namespace-reference.adoc[]
include::{spring-data-commons-docs}/repository-populator-namespace-reference.adoc[]
include::{spring-data-commons-docs}/repository-query-keywords-reference.adoc[]
include::{spring-data-commons-docs}/repository-query-return-types-reference.adoc[]
:leveloffset: -1

View File

@ -1,20 +0,0 @@
= Preface
The Spring Data Elasticsearch project applies core Spring concepts to the development of solutions using the Elasticsearch Search Engine. We have povided a "template" as a high-level abstraction for storing,querying,sorting and faceting documents. You will notice similarities to the Spring data solr and mongodb support in the Spring Framework.
[[project]]
[preface]
== Project Metadata
* Version Control - https://github.com/spring-projects/spring-data-elasticsearch
* Bugtracker - https://jira.spring.io/browse/DATAES
* Release repository - https://repo.spring.io/libs-release
* Milestone repository - https://repo.spring.io/libs-milestone
* Snapshot repository - https://repo.spring.io/libs-snapshot
[[requirements]]
[preface]
== Requirements
Requires http://www.elasticsearch.org/download/[Elasticsearch] 0.20.2 and above or optional dependency or not even that if you are using Embedded Node Client

View File

@ -1,288 +0,0 @@
[[elasticsearch.repositories]]
= Elasticsearch Repositories
This chapter includes details of the Elasticsearch repository implementation.
[[elasticsearch.introduction]]
== Introduction
[[elasticsearch.namespace]]
=== Spring Namespace
The Spring Data Elasticsearch module contains a custom namespace allowing definition of repository beans as well as elements for instantiating a `ElasticsearchServer` .
Using the `repositories` element looks up Spring Data repositories as described in <<repositories.create-instances>> .
.Setting up Elasticsearch repositories using Namespace
====
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/data/elasticsearch
http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd">
<elasticsearch:repositories base-package="com.acme.repositories" />
</beans>
----
====
Using the `Transport Client` or `Node Client` element registers an instance of `Elasticsearch Server` in the context.
.Transport Client using Namespace
====
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/data/elasticsearch
http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd">
<elasticsearch:transport-client id="client" cluster-nodes="localhost:9300,someip:9300" />
</beans>
----
====
.Node Client using Namespace
====
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/data/elasticsearch
http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd">
<elasticsearch:node-client id="client" local="true"" />
</beans>
----
====
[[elasticsearch.annotation]]
=== Annotation based configuration
The Spring Data Elasticsearch repositories support cannot only be activated through an XML namespace but also using an annotation through JavaConfig.
.Spring Data Elasticsearch repositories using JavaConfig
====
[source,java]
----
@Configuration
@EnableElasticsearchRepositories(basePackages = "org/springframework/data/elasticsearch/repositories")
static class Config {
@Bean
public ElasticsearchOperations elasticsearchTemplate() {
return new ElasticsearchTemplate(nodeBuilder().local(true).node().client());
}
}
----
====
The configuration above sets up an `Embedded Elasticsearch Server` which is used by the `ElasticsearchTemplate` . Spring Data Elasticsearch Repositories are activated using the `@EnableElasticsearchRepositories` annotation, which essentially carries the same attributes as the XML namespace does. If no base package is configured, it will use the one the configuration class resides in.
[[elasticsearch.cdi]]
=== Elasticsearch Repositores using CDI
The Spring Data Elasticsearch repositories can also be set up using CDI functionality.
.Spring Data Elasticsearch repositories using JavaConfig
====
[source,java]
----
class ElasticsearchTemplateProducer {
@Produces
@ApplicationScoped
public ElasticsearchOperations createElasticsearchTemplate() {
return new ElasticsearchTemplate(nodeBuilder().local(true).node().client());
}
}
class ProductService {
private ProductRepository repository;
public Page<Product> findAvailableBookByName(String name, Pageable pageable) {
return repository.findByAvailableTrueAndNameStartingWith(name, pageable);
}
@Inject
public void setRepository(ProductRepository repository) {
this.repository = repository;
}
}
----
====
[[elasticsearch.query-methods]]
== Query methods
[[elasticsearch.query-methods.finders]]
=== Query lookup strategies
The Elasticsearch module supports all basic query building feature as String,Abstract,Criteria or have it being derived from the method name.
==== Declared queries
Deriving the query from the method name is not always sufficient and/or may result in unreadable method names. In this case one might make either use of `@Query` annotation (see <<elasticsearch.query-methods.at-query>> ).
[[elasticsearch.query-methods.criterions]]
=== Query creation
Generally the query creation mechanism for Elasticsearch works as described in <<repositories.query-methods>> . Here's a short example of what a Elasticsearch query method translates into:
.Query creation from method names
====
[source,java]
----
public interface BookRepository extends Repository<Book, String>
{
List<Book> findByNameAndPrice(String name, Integer price);
}
----
====
The method name above will be translated into the following Elasticsearch json query
[source]
----
{ "bool" :
{ "must" :
[
{ "field" : {"name" : "?"} },
{ "field" : {"price" : "?"} }
]
}
}
----
A list of supported keywords for Elasticsearch is shown below.
[cols="1,2,3", options="header"]
.Supported keywords inside method names
|===
| Keyword
| Sample
| Elasticsearch Query String| `And`
| `findByNameAndPrice`
| `{"bool" : {"must" : [ {"field" : {"name" : "?"}},
{"field" : {"price" : "?"}} ]}}`
| `Or`
| `findByNameOrPrice`
| `{"bool" : {"should" : [ {"field" : {"name" : "?"}},
{"field" : {"price" : "?"}} ]}}`
| `Is`
| `findByName`
| `{"bool" : {"must" : {"field" : {"name" : "?"}}}}`
| `Not`
| `findByNameNot`
| `{"bool" : {"must_not" : {"field" : {"name" : "?"}}}}`
| `Between`
| `findByPriceBetween`
| `{"bool" : {"must" : {"range" : {"price" : {"from" :
?,"to" : ?,"include_lower" : true,"include_upper" : true}}}}}`
| `LessThanEqual`
| `findByPriceLessThan`
| `{"bool" : {"must" : {"range" : {"price" : {"from" :
null,"to" : ?,"include_lower" : true,"include_upper" :
true}}}}}`
| `GreaterThanEqual`
| `findByPriceGreaterThan`
| `{"bool" : {"must" : {"range" : {"price" : {"from" :
?,"to" : null,"include_lower" : true,"include_upper" :
true}}}}}`
| `Before`
| `findByPriceBefore`
| `{"bool" : {"must" : {"range" : {"price" : {"from" :
null,"to" : ?,"include_lower" : true,"include_upper" :
true}}}}}`
| `After`
| `findByPriceAfter`
| `{"bool" : {"must" : {"range" : {"price" : {"from" :
?,"to" : null,"include_lower" : true,"include_upper" :
true}}}}}`
| `Like`
| `findByNameLike`
| `{"bool" : {"must" : {"field" : {"name" : {"query" :
"?*","analyze_wildcard" : true}}}}}`
| `StartingWith`
| `findByNameStartingWith`
| `{"bool" : {"must" : {"field" : {"name" : {"query" :
"?*","analyze_wildcard" : true}}}}}`
| `EndingWith`
| `findByNameEndingWith`
| `{"bool" : {"must" : {"field" : {"name" : {"query" :
"*?","analyze_wildcard" : true}}}}}`
| `Contains/Containing`
| `findByNameContaining`
| `{"bool" : {"must" : {"field" : {"name" : {"query" :
"*?*","analyze_wildcard" : true}}}}}`
| `In`
| `findByNameIn(Collection<String>names)`
| `{"bool" : {"must" : {"bool" : {"should" : [ {"field" :
{"name" : "?"}}, {"field" : {"name" : "?"}} ]}}}}`
| `NotIn`
| `findByNameNotIn(Collection<String>names)`
| `{"bool" : {"must_not" : {"bool" : {"should" : {"field" :
{"name" : "?"}}}}}}`
| `Near`
| `findByStoreNear`
| `Not Supported Yet !`
| `True`
| `findByAvailableTrue`
| `{"bool" : {"must" : {"field" : {"available" : true}}}}`
| `False`
| `findByAvailableFalse`
| `{"bool" : {"must" : {"field" : {"available" : false}}}}`
| `OrderBy`
| `findByAvailableTrueOrderByNameDesc`
| `{"sort" : [{ "name" : {"order" : "desc"} }],"bool" :
{"must" : {"field" : {"available" : true}}}}`
|===
[[elasticsearch.query-methods.at-query]]
=== Using @Query Annotation
.Declare query at the method using the `@Query` annotation.
====
[source,java]
----
public interface BookRepository extends ElasticsearchRepository<Book, String> {
@Query("{"bool" : {"must" : {"field" : {"name" : "?0"}}}}")
Page<Book> findByName(String name,Pageable pageable);
}
----
====

View File

@ -1,72 +0,0 @@
[[elasticsearch.misc]]
= Miscellaneous Elasticsearch Operation Support
This chapter covers additional support for Elasticsearch operations that cannot be directly accessed via the repository interface. It is recommended to add those operations as custom implementation as described in <<repositories.custom-implementations>> .
[[elasticsearch.misc.filter]]
== Filter Builder
Filter Builder improves query speed.
====
[source,java]
----
private ElasticsearchTemplate elasticsearchTemplate;
SearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(matchAllQuery())
.withFilter(boolFilter().must(termFilter("id", documentId)))
.build();
Page<SampleEntity> sampleEntities =
elasticsearchTemplate.queryForPage(searchQuery,SampleEntity.class);
----
====
[[elasticsearch.scan.and.scroll]]
== Using Scan And Scroll For Big Result Set
Elasticsearch has scan and scroll feature for getting big result set in chunks. `ElasticsearchTemplate` has scan and scroll methods that can be used as below.
.Using Scan and Scroll
====
[source,java]
----
SearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(matchAllQuery())
.withIndices("test-index")
.withTypes("test-type")
.withPageable(new PageRequest(0,1))
.build();
String scrollId = elasticsearchTemplate.scan(searchQuery,1000,false);
List<SampleEntity> sampleEntities = new ArrayList<SampleEntity>();
boolean hasRecords = true;
while (hasRecords){
Page<SampleEntity> page = elasticsearchTemplate.scroll(scrollId, 5000L , new ResultsMapper<SampleEntity>()
{
@Override
public Page<SampleEntity> mapResults(SearchResponse response) {
List<SampleEntity> chunk = new ArrayList<SampleEntity>();
for(SearchHit searchHit : response.getHits()){
if(response.getHits().getHits().length <= 0) {
return null;
}
SampleEntity user = new SampleEntity();
user.setId(searchHit.getId());
user.setMessage((String)searchHit.getSource().get("message"));
chunk.add(user);
}
return new PageImpl<SampleEntity>(chunk);
}
});
if(page != null) {
sampleEntities.addAll(page.getContent());
hasRecords = page.hasNextPage();
}
else{
hasRecords = false;
}
}
}
----
====

View File

@ -0,0 +1,47 @@
/*
* Copyright 2020-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch;
import org.springframework.dao.DataRetrievalFailureException;
import java.util.Map;
/**
* @author Peter-Josef Meisch
* @author Illia Ulianov
* @since 4.1
*/
public class BulkFailureException extends DataRetrievalFailureException {
private final Map<String, FailureDetails> failedDocuments;
public BulkFailureException(String msg, Map<String, FailureDetails> failedDocuments) {
super(msg);
this.failedDocuments = failedDocuments;
}
public Map<String, FailureDetails> getFailedDocuments() {
return failedDocuments;
}
/**
* Details about a document saving failure.
*
* @author Illia Ulianov
* @since 5.2
*/
public record FailureDetails(Integer status, String errorMessage) {
}
}

View File

@ -0,0 +1,78 @@
/*
* Copyright 2022-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch;
import java.util.List;
import org.jspecify.annotations.Nullable;
/**
* Object describing an Elasticsearch error
*
* @author Peter-Josef Meisch
* @since 4.4
*/
public class ElasticsearchErrorCause {
@Nullable private final String type;
private final String reason;
@Nullable private final String stackTrace;
@Nullable private final ElasticsearchErrorCause causedBy;
private final List<ElasticsearchErrorCause> rootCause;
private final List<ElasticsearchErrorCause> suppressed;
public ElasticsearchErrorCause(@Nullable String type, String reason, @Nullable String stackTrace,
@Nullable ElasticsearchErrorCause causedBy, List<ElasticsearchErrorCause> rootCause,
List<ElasticsearchErrorCause> suppressed) {
this.type = type;
this.reason = reason;
this.stackTrace = stackTrace;
this.causedBy = causedBy;
this.rootCause = rootCause;
this.suppressed = suppressed;
}
@Nullable
public String getType() {
return type;
}
public String getReason() {
return reason;
}
@Nullable
public String getStackTrace() {
return stackTrace;
}
@Nullable
public ElasticsearchErrorCause getCausedBy() {
return causedBy;
}
public List<ElasticsearchErrorCause> getRootCause() {
return rootCause;
}
public List<ElasticsearchErrorCause> getSuppressed() {
return suppressed;
}
}

View File

@ -1,51 +0,0 @@
/*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch;
import java.util.Map;
/**
* ElasticsearchException
*
* @author Rizwan Idrees
* @author Mohsin Husen
*/
public class ElasticsearchException extends RuntimeException {
private Map<String, String> failedDocuments;
public ElasticsearchException(String message) {
super(message);
}
public ElasticsearchException(String message, Throwable cause) {
super(message, cause);
}
public ElasticsearchException(String message, Throwable cause, Map<String, String> failedDocuments) {
super(message, cause);
this.failedDocuments = failedDocuments;
}
public ElasticsearchException(String message, Map<String, String> failedDocuments) {
super(message);
this.failedDocuments = failedDocuments;
}
public Map<String, String> getFailedDocuments() {
return failedDocuments;
}
}

View File

@ -0,0 +1,44 @@
/*
* Copyright 2019-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch;
import org.springframework.dao.NonTransientDataAccessResourceException;
/**
* @author Christoph Strobl
* @since 3.2
*/
public class NoSuchIndexException extends NonTransientDataAccessResourceException {
private final String index;
/**
* @since 4.4
*/
public NoSuchIndexException(String index) {
super(String.format("Index %s not found.", index));
this.index = index;
}
public NoSuchIndexException(String index, Throwable cause) {
super(String.format("Index %s not found.", index), cause);
this.index = index;
}
public String getIndex() {
return index;
}
}

View File

@ -0,0 +1,31 @@
/*
* Copyright 2021-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch;
import org.springframework.core.NestedRuntimeException;
/**
* @author Peter-Josef Meisch
*/
public class ResourceFailureException extends NestedRuntimeException {
public ResourceFailureException(String msg) {
super(msg);
}
public ResourceFailureException(String msg, Throwable cause) {
super(msg, cause);
}
}

View File

@ -0,0 +1,29 @@
/*
* Copyright 2022-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch;
import org.springframework.dao.NonTransientDataAccessResourceException;
/**
* @author Peter-Josef Meisch
* @since 5.1
*/
public class ResourceNotFoundException extends NonTransientDataAccessResourceException {
public ResourceNotFoundException(String msg) {
super(msg);
}
}

View File

@ -0,0 +1,49 @@
/*
* Copyright 2021-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch;
import org.springframework.dao.DataAccessException;
/**
* Exception class for REST status exceptions independent from the used client/backend.
*
* @author Peter-Josef Meisch
* @since 4.3
*/
public class RestStatusException extends DataAccessException {
// we do not use a dedicated status class from Elasticsearch, OpenSearch, Spring web or webflux here
private final int status;
public RestStatusException(int status, String msg) {
super(msg);
this.status = status;
}
public RestStatusException(int status, String msg, Throwable cause) {
super(msg, cause);
this.status = status;
}
public int getStatus() {
return status;
}
@Override
public String toString() {
return "RestStatusException{" + "status=" + status + "} " + super.toString();
}
}

View File

@ -0,0 +1,71 @@
/*
* Copyright 2020-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch;
import org.jspecify.annotations.Nullable;
import org.springframework.dao.UncategorizedDataAccessException;
/**
* @author Peter-Josef Meisch
* @since 4.0
*/
public class UncategorizedElasticsearchException extends UncategorizedDataAccessException {
/**
* the response status code from Elasticsearch if available
*
* @since 4.4
*/
@Nullable private final Integer statusCode;
/**
* The response body from Elasticsearch if available
*
* @since 4.4
*/
@Nullable final String responseBody;
public UncategorizedElasticsearchException(String msg) {
this(msg, null);
}
public UncategorizedElasticsearchException(String msg, @Nullable Throwable cause) {
this(msg, null, null, cause);
}
public UncategorizedElasticsearchException(String msg, @Nullable Integer statusCode, @Nullable String responseBody,
@Nullable Throwable cause) {
super(msg, cause);
this.statusCode = statusCode;
this.responseBody = responseBody;
}
/**
* @since 4.4
*/
@Nullable
public Integer getStatusCode() {
return statusCode;
}
/**
* @since 4.4
*/
@Nullable
public String getResponseBody() {
return responseBody;
}
}

View File

@ -0,0 +1,34 @@
/*
* Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch;
import org.springframework.dao.DataIntegrityViolationException;
/**
* Exception that is thrown when a version conflict from the server is detected.
*
* @author Peter-Josef Meisch
* @since 5.2
*/
public class VersionConflictException extends DataIntegrityViolationException {
public VersionConflictException(String msg) {
super(msg);
}
public VersionConflictException(String msg, Throwable cause) {
super(msg, cause);
}
}

View File

@ -0,0 +1,79 @@
/*
* Copyright 2024-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
/**
* Identifies an alias for the index.
*
* @author Youssef Aouichaoui
* @since 5.4
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE })
@Repeatable(Aliases.class)
public @interface Alias {
/**
* @return Index alias name. Alias for {@link #alias}.
*/
@AliasFor("alias")
String value() default "";
/**
* @return Index alias name. Alias for {@link #value}.
*/
@AliasFor("value")
String alias() default "";
/**
* @return Query used to limit documents the alias can access.
*/
Filter filter() default @Filter;
/**
* @return Used to route indexing operations to a specific shard.
*/
String indexRouting() default "";
/**
* @return Used to route indexing and search operations to a specific shard.
*/
String routing() default "";
/**
* @return Used to route search operations to a specific shard.
*/
String searchRouting() default "";
/**
* @return Is the alias hidden?
*/
boolean isHidden() default false;
/**
* @return Is it the 'write index' for the alias?
*/
boolean isWriteIndex() default false;
}

View File

@ -0,0 +1,36 @@
/*
* Copyright 2024-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Container annotation that aggregates several {@link Alias} annotations.
*
* @author Youssef Aouichaoui
* @see Alias
* @since 5.4
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE })
public @interface Aliases {
Alias[] value();
}

View File

@ -0,0 +1,61 @@
/*
* Copyright 2019-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Based on reference doc - https://www.elastic.co/guide/en/elasticsearch/reference/current/suggester-context.html
*
* @author Robert Gruendler
* @author Peter-Josef Meisch
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Documented
@Inherited
public @interface CompletionContext {
String name();
ContextMappingType type();
String precision() default "";
String path() default "";
/**
* @since 4.3
*/
enum ContextMappingType {
CATEGORY("category"), GEO("geo");
private final String mappedName;
ContextMappingType(String mappedName) {
this.mappedName = mappedName;
}
public String getMappedName() {
return mappedName;
}
}
}

View File

@ -0,0 +1,12 @@
package org.springframework.data.elasticsearch.annotations;
/**
* Based on reference doc - https://www.elastic.co/guide/en/elasticsearch/reference/current/suggester-context.html
*
* @author Robert Gruendler
*/
public enum CompletionContextType {
CATEGORY, GEO
}

View File

@ -1,11 +1,11 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -15,15 +15,23 @@
*/
package org.springframework.data.elasticsearch.annotations;
import java.lang.annotation.*;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Based on the reference doc - http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html
* Based on the reference doc -
* https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-completion.html
*
* @author Mewes Kochheim
* @author Robert Gruendler
* @author Peter-Josef Meisch
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.ANNOTATION_TYPE })
@Documented
@Inherited
public @interface CompletionField {
@ -37,4 +45,6 @@ public @interface CompletionField {
boolean preservePositionIncrements() default true;
int maxInputLength() default 50;
CompletionContext[] contexts() default {};
}

View File

@ -0,0 +1,39 @@
/*
* Copyright 2021-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
/**
* Alias for a @Query annotation with the count parameter set to true.
*
* @author Peter-Josef Meisch
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
@Documented
@Query(count = true)
public @interface CountQuery {
@AliasFor(annotation = Query.class)
String value() default "";
}

View File

@ -1,11 +1,11 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -16,16 +16,207 @@
package org.springframework.data.elasticsearch.annotations;
/**
* Values based on <a href="https://www.elastic.co/guide/reference/mapping/date-format/">Elasticsearch reference
* documentation</a>. The patterns are taken from this documentation and slightly adapted so that a Java
* {@link java.time.format.DateTimeFormatter} produces the same values as the Elasticsearch formatter. Use
* <code>format = {}</code> to disable built-in date formats in the {@link Field} annotation. If you want to use only a
* custom date format pattern, you must set the <code>format</code> property to empty <code>{}</code>.
*
* @author Jakub Vavrik
* Values based on reference doc - http://www.elasticsearch.org/guide/reference/mapping/date-format/
* @author Tim te Beek
* @author Peter-Josef Meisch
* @author Sascha Woo
*/
public enum DateFormat {
none, custom, basic_date, basic_date_time, basic_date_time_no_millis, basic_ordinal_date, basic_ordinal_date_time,
basic_ordinal_date_time_no_millis, basic_time, basic_time_no_millis, basic_t_time, basic_t_time_no_millis,
basic_week_date, basic_week_date_time, basic_week_date_time_no_millis, date, date_hour, date_hour_minute,
date_hour_minute_second, date_hour_minute_second_fraction, date_hour_minute_second_millis, date_optional_time,
date_time, date_time_no_millis, hour, hour_minute, hour_minute_second, hour_minute_second_fraction,
hour_minute_second_millis, ordinal_date, ordinal_date_time, ordinal_date_time_no_millis, time, time_no_millis,
t_time, t_time_no_millis, week_date, week_date_time, weekDateTimeNoMillis, week_year, weekyearWeek,
weekyearWeekDay, year, year_month, year_month_day
basic_date("uuuuMMdd"), //
basic_date_time("uuuuMMdd'T'HHmmss.SSSXXX"), //
basic_date_time_no_millis("uuuuMMdd'T'HHmmssXXX"), //
basic_ordinal_date("uuuuDDD"), //
basic_ordinal_date_time("yyyyDDD'T'HHmmss.SSSXXX"), //
basic_ordinal_date_time_no_millis("yyyyDDD'T'HHmmssXXX"), //
basic_time("HHmmss.SSSXXX"), //
basic_time_no_millis("HHmmssXXX"), //
basic_t_time("'T'HHmmss.SSSXXX"), //
basic_t_time_no_millis("'T'HHmmssXXX"), //
basic_week_date("YYYY'W'wwe"), // week-based-year!
/**
* @since 5.3
*/
strict_basic_week_date("YYYY'W'wwe"), // week-based-year!
basic_week_date_time("YYYY'W'wwe'T'HHmmss.SSSX"), // here Elasticsearch uses a different zone format
/**
* @since 5.3
*/
strict_basic_week_date_time("YYYY'W'wwe'T'HHmmss.SSSX"), // here Elasticsearch uses a different zone format
basic_week_date_time_no_millis("YYYY'W'wwe'T'HHmmssX"), //
/**
* @since 5.3
*/
strict_basic_week_date_time_no_millis("YYYY'W'wwe'T'HHmmssX"), //
date("uuuu-MM-dd"), //
/**
* @since 5.3
*/
strict_date("uuuu-MM-dd"), //
date_hour("uuuu-MM-dd'T'HH"), //
/**
* @since 5.3
*/
strict_date_hour("uuuu-MM-dd'T'HH"), //
date_hour_minute("uuuu-MM-dd'T'HH:mm"), //
/**
* @since 5.3
*/
strict_date_hour_minute("uuuu-MM-dd'T'HH:mm"), //
date_hour_minute_second("uuuu-MM-dd'T'HH:mm:ss"), //
/**
* @since 5.3
*/
strict_date_hour_minute_second("uuuu-MM-dd'T'HH:mm:ss"), //
date_hour_minute_second_fraction("uuuu-MM-dd'T'HH:mm:ss.SSS"), //
/**
* @since 5.3
*/
strict_date_hour_minute_second_fraction("uuuu-MM-dd'T'HH:mm:ss.SSS"), //
date_hour_minute_second_millis("uuuu-MM-dd'T'HH:mm:ss.SSS"), //
/**
* @since 5.3
*/
strict_date_hour_minute_second_millis("uuuu-MM-dd'T'HH:mm:ss.SSS"), //
date_optional_time("uuuu-MM-dd['T'HH:mm:ss.SSSXXX]"), //
/**
* @since 5.3
*/
strict_date_optional_time("uuuu-MM-dd['T'HH:mm:ss.SSSXXX]"), //
strict_date_optional_time_nanos("uuuu-MM-dd['T'HH:mm:ss.SSSSSSXXX]"), //
date_time("uuuu-MM-dd'T'HH:mm:ss.SSSXXX"), //
/**
* @since 5.3
*/
strict_date_time("uuuu-MM-dd'T'HH:mm:ss.SSSXXX"), //
date_time_no_millis("uuuu-MM-dd'T'HH:mm:ssVV"), // here Elasticsearch uses the zone-id in its implementation
/**
* @since 5.3
*/
strict_date_time_no_millis("uuuu-MM-dd'T'HH:mm:ssVV"), // here Elasticsearch uses the zone-id in its implementation
epoch_millis("epoch_millis"), //
epoch_second("epoch_second"), //
hour("HH"), //
/**
* @since 5.3
*/
strict_hour("HH"), //
hour_minute("HH:mm"), //
/**
* @since 5.3
*/
strict_hour_minute("HH:mm"), //
hour_minute_second("HH:mm:ss"), //
/**
* @since 5.3
*/
strict_hour_minute_second("HH:mm:ss"), //
hour_minute_second_fraction("HH:mm:ss.SSS"), //
/**
* @since 5.3
*/
strict_hour_minute_second_fraction("HH:mm:ss.SSS"), //
hour_minute_second_millis("HH:mm:ss.SSS"), //
/**
* @since 5.3
*/
strict_hour_minute_second_millis("HH:mm:ss.SSS"), //
ordinal_date("uuuu-DDD"), //
/**
* @since 5.3
*/
strict_ordinal_date("uuuu-DDD"), //
ordinal_date_time("uuuu-DDD'T'HH:mm:ss.SSSXXX"), //
/**
* @since 5.3
*/
strict_ordinal_date_time("uuuu-DDD'T'HH:mm:ss.SSSXXX"), //
ordinal_date_time_no_millis("uuuu-DDD'T'HH:mm:ssXXX"), //
/**
* @since 5.3
*/
strict_ordinal_date_time_no_millis("uuuu-DDD'T'HH:mm:ssXXX"), //
time("HH:mm:ss.SSSXXX"), //
/**
* @since 5.3
*/
strict_time("HH:mm:ss.SSSXXX"), //
time_no_millis("HH:mm:ssXXX"), //
/**
* @since 5.3
*/
strict_time_no_millis("HH:mm:ssXXX"), //
t_time("'T'HH:mm:ss.SSSXXX"), //
/**
* @since 5.3
*/
strict_t_time("'T'HH:mm:ss.SSSXXX"), //
t_time_no_millis("'T'HH:mm:ssXXX"), //
/**
* @since 5.3
*/
strict_t_time_no_millis("'T'HH:mm:ssXXX"), //
week_date("YYYY-'W'ww-e"), //
/**
* @since 5.3
*/
strict_week_date("YYYY-'W'ww-e"), //
week_date_time("YYYY-'W'ww-e'T'HH:mm:ss.SSSXXX"), //
/**
* @since 5.3
*/
strict_week_date_time("YYYY-'W'ww-e'T'HH:mm:ss.SSSXXX"), //
week_date_time_no_millis("YYYY-'W'ww-e'T'HH:mm:ssXXX"), //
/**
* @since 5.3
*/
strict_week_date_time_no_millis("YYYY-'W'ww-e'T'HH:mm:ssXXX"), //
weekyear(""), // no TemporalAccessor available for these 3
/**
* @since 5.3
*/
strict_weekyear(""), // no TemporalAccessor available for these 3
weekyear_week(""), //
/**
* @since 5.3
*/
strict_weekyear_week(""), //
weekyear_week_day(""), //
/**
* @since 5.3
*/
strict_strict_weekyear_week_day(""), //
year("uuuu"), //
/**
* @since 5.3
*/
strict_year("uuuu"), //
year_month("uuuu-MM"), //
/**
* @since 5.3
*/
strict_year_month("uuuu-MM"), //
year_month_day("uuuu-MM-dd"), //
/**
* @since 5.3
*/
strict_year_month_day("uuuu-MM-dd"); //
private final String pattern;
DateFormat(String pattern) {
this.pattern = pattern;
}
/**
* @since 4.2
*/
public String getPattern() {
return pattern;
}
}

View File

@ -1,11 +1,11 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -15,37 +15,118 @@
*/
package org.springframework.data.elasticsearch.annotations;
import java.lang.annotation.*;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.data.annotation.Persistent;
/**
* Document
* Identifies a domain object to be persisted to Elasticsearch.
*
* @author Rizwan Idrees
* @author Mohsin Husen
* @author Mason Chan
* @author Ivan Greene
* @author Mark Paluch
* @author Peter-Josef Meisch
* @author Sascha Woo
*/
@Persistent
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@Target({ ElementType.TYPE })
public @interface Document {
/**
* Name of the Elasticsearch index.
* <ul>
* <li>Lowercase only</li>
* <li>Cannot include \, /, *, ?, ", &gt;, &lt;, |, ` ` (space character), ,, #</li>
* <li>Cannot start with -, _, +</li>
* <li>Cannot be . or ..</li>
* <li>Cannot be longer than 255 bytes (note it is bytes, so multi-byte characters will count towards the 255 limit
* faster)</li>
* </ul>
*/
String indexName();
String type() default "";
boolean useServerConfiguration() default false;
short shards() default 5;
short replicas() default 1;
String refreshInterval() default "1s";
String indexStoreType() default "fs";
/**
* Configuration whether to create an index on repository bootstrapping.
*/
boolean createIndex() default true;
/**
* If true, the index mapping will be written on repository bootstrapping even when the index already exists. This
* allows for automatically updating the mapping with new properties. Changes on existing properties will lead to an
* error from the Elasticsearch server.
*/
boolean alwaysWriteMapping() default false;
/**
* Configuration of version management.
*/
VersionType versionType() default VersionType.EXTERNAL;
/**
* Defines if type hints should be written. {@see WriteTypeHint}.
*
* @since 4.3
*/
WriteTypeHint writeTypeHint() default WriteTypeHint.DEFAULT;
/**
* Controls how Elasticsearch dynamically adds fields to the document.
*
* @since 4.3
*/
Dynamic dynamic() default Dynamic.INHERIT;
/**
* Specifies if the id property should also be stored in the Elasticsearch document source. Default value is
* {@literal true}
*
* @since 5.1
*/
boolean storeIdInSource() default true;
/**
* Specifies if the version property should also be stored in the Elasticsearch document source. Default value is
* true.
*
* @since 5.1
*/
boolean storeVersionInSource() default true;
/**
* Aliases for the index.
*
* @since 5.4
*/
Alias[] aliases() default {};
/**
* @since 4.3
*/
enum VersionType {
INTERNAL("internal"), //
EXTERNAL("external"), //
EXTERNAL_GTE("external_gte"), //
/**
* @since 4.4
*/
FORCE("force");
private final String esName;
VersionType(String esName) {
this.esName = esName;
}
public String getEsName() {
return esName;
}
}
}

View File

@ -0,0 +1,60 @@
/*
* Copyright 2021-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch.annotations;
/**
* Values for the {@code dynamic} mapping parameter.
*
* @author Sascha Woo
* @since 4.3
*/
public enum Dynamic {
/**
* New fields are added to the mapping.
*/
TRUE("true"),
/**
* New fields are added to the mapping as
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime.html">runtime fields</a>. These
* fields are not indexed, and are loaded from {@code _source} at query time.
*/
RUNTIME("runtime"),
/**
* New fields are ignored. These fields will not be indexed or searchable, but will still appear in the
* {@code _source} field of returned hits. These fields will not be added to the mapping, and new fields must be added
* explicitly.
*/
FALSE("false"),
/**
* If new fields are detected, an exception is thrown and the document is rejected. New fields must be explicitly
* added to the mapping.
*/
STRICT("strict"),
/**
* Inherit the dynamic setting from their parent object or from the mapping type.
*/
INHERIT("inherit");
private final String mappedName;
Dynamic(String mappedName) {
this.mappedName = mappedName;
}
public String getMappedName() {
return mappedName;
}
}

View File

@ -0,0 +1,25 @@
package org.springframework.data.elasticsearch.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.data.annotation.Persistent;
/**
* Elasticsearch dynamic templates mapping. This annotation is handy if you prefer apply dynamic templates on fields
* with annotation e.g. {@link Field} with type = FieldType.Object etc. instead of static mapping on Document via
* {@link Mapping} annotation. DynamicTemplates annotation is omitted if {@link Mapping} annotation is used.
*
* @author Petr Kukral
*/
@Persistent
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE })
public @interface DynamicTemplates {
String mappingPath() default "";
}

View File

@ -1,11 +1,11 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -22,6 +22,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
/**
* @author Rizwan Idrees
* @author Mohsin Husen
@ -29,20 +31,45 @@ import java.lang.annotation.Target;
* @author Jonathan Yan
* @author Jakub Vavrik
* @author Kevin Leturc
* @author Peter-Josef Meisch
* @author Xiao Yu
* @author Aleksei Arsenev
* @author Brian Kimmig
* @author Morgan Lutz
* @author Sascha Woo
* @author Haibo Liu
* @author Andriy Redko
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.METHOD })
@Documented
@Inherited
public @interface Field {
/**
* Alias for {@link #name}.
*
* @since 3.2
*/
@AliasFor("name")
String value() default "";
/**
* The <em>name</em> to be used to store the field inside the document. If not set, the name of the annotated property
* is used.
*
* @since 3.2
*/
@AliasFor("value")
String name() default "";
FieldType type() default FieldType.Auto;
boolean index() default true;
DateFormat format() default DateFormat.none;
DateFormat[] format() default { DateFormat.date_optional_time, DateFormat.epoch_millis };
String pattern() default "";
String[] pattern() default {};
boolean store() default false;
@ -52,7 +79,177 @@ public @interface Field {
String analyzer() default "";
String normalizer() default "";
String[] ignoreFields() default {};
boolean includeInParent() default false;
String[] copyTo() default {};
/**
* @since 4.0
*/
int ignoreAbove() default -1;
/**
* @since 4.0
*/
boolean coerce() default true;
/**
* @since 4.0
*/
boolean docValues() default true;
/**
* @since 4.0
*/
boolean ignoreMalformed() default false;
/**
* @since 4.0
*/
IndexOptions indexOptions() default IndexOptions.none;
/**
* @since 4.0
*/
boolean indexPhrases() default false;
/**
* implemented as array to enable the empty default value
*
* @since 4.0
*/
IndexPrefixes[] indexPrefixes() default {};
/**
* @since 4.0
*/
boolean norms() default true;
/**
* NOte that null_value setting are not supported in Elasticsearch for all types. For example setting a null_value on
* a field with type text will throw an exception in the server when the mapping is written to Elasticsearch. Alas,
* the Elasticsearch documentation does not specify on which types it is allowed on which it is not.
*
* @since 4.0
*/
String nullValue() default "";
/**
* @since 4.0
*/
int positionIncrementGap() default -1;
/**
* @since 4.0
*/
String similarity() default Similarity.Default;
/**
* @since 4.0
*/
TermVector termVector() default TermVector.none;
/**
* @since 4.0
*/
double scalingFactor() default 1;
/**
* @since 4.0
*/
int maxShingleSize() default -1;
/**
* if true, the field will be stored in Elasticsearch even if it has a null value
*
* @since 4.1
*/
boolean storeNullValue() default false;
/**
* to be used in combination with {@link FieldType#Rank_Feature}
*
* @since 4.1
*/
boolean positiveScoreImpact() default true;
/**
* to be used in combination with {@link FieldType#Object}
*
* @since 4.1
*/
boolean enabled() default true;
/**
* @since 4.1
*/
boolean eagerGlobalOrdinals() default false;
/**
* @since 4.1
*/
NullValueType nullValueType() default NullValueType.String;
/**
* to be used in combination with {@link FieldType#Dense_Vector}
*
* @since 4.2
*/
int dims() default -1;
/**
* to be used in combination with {@link FieldType#Dense_Vector}
*
* @since 5.4
*/
String elementType() default FieldElementType.DEFAULT;
/**
* to be used in combination with {@link FieldType#Dense_Vector}
*
* @since 5.4
*/
KnnSimilarity knnSimilarity() default KnnSimilarity.DEFAULT;
/**
* to be used in combination with {@link FieldType#Dense_Vector}
*
* @since 5.4
*/
KnnIndexOptions[] knnIndexOptions() default {};
/**
* Controls how Elasticsearch dynamically adds fields to the inner object within the document.<br>
* To be used in combination with {@link FieldType#Object} or {@link FieldType#Nested}
*
* @since 4.3
*/
Dynamic dynamic() default Dynamic.INHERIT;
/**
* marks this field to be excluded from the _source in Elasticsearch
* (https://www.elastic.co/guide/en/elasticsearch/reference/7.15/mapping-source-field.html#include-exclude)
*
* @since 4.3
*/
boolean excludeFromSource() default false;
/**
* when this field is a {{@link String}}, a {{@link java.util.Collection}} or a {{@link java.util.Map}} that is empty
* this property controlls whether the empty value is sent to Elasticsearch.
*
* @since 5.1
*/
boolean storeEmptyValue() default true;
/**
* overrides the field type in the mapping which otherwise will be taken from corresponding {@link FieldType}
*
* @since 5.4
*/
String mappedTypeName() default "";
}

View File

@ -0,0 +1,26 @@
/*
* Copyright 2024-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch.annotations;
/**
* @author Haibo Liu
* @since 5.4
*/
public final class FieldElementType {
public final static String DEFAULT = "";
public final static String FLOAT = "float";
public final static String BYTE = "byte";
}

View File

@ -1,11 +1,11 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -19,7 +19,82 @@ package org.springframework.data.elasticsearch.annotations;
* @author Rizwan Idrees
* @author Mohsin Husen
* @author Artur Konczak
* @author Zeng Zetang
* @author Peter-Josef Meisch
* @author Aleksei Arsenev
* @author Brian Kimmig
* @author Morgan Lutz
*/
public enum FieldType {
text, Integer, Long, Date, Float, Double, Boolean, Object, Auto, Nested, Ip, Attachment, keyword
Auto("auto"), //
Text("text"), //
Keyword("keyword"), //
Long("long"), //
Integer("integer"), //
Short("short"), //
Byte("byte"), //
Double("double"), //
Float("float"), //
Half_Float("half_float"), //
Scaled_Float("scaled_float"), //
Date("date"), //
Date_Nanos("date_nanos"), //
Boolean("boolean"), //
Binary("binary"), //
Integer_Range("integer_range"), //
Float_Range("float_range"), //
Long_Range("long_range"), //
Double_Range("double_range"), //
Date_Range("date_range"), //
Ip_Range("ip_range"), //
Object("object"), //
Nested("nested"), //
Ip("ip"), //
TokenCount("token_count"), //
Percolator("percolator"), //
Flattened("flattened"), //
Search_As_You_Type("search_as_you_type"), //
/** @since 4.1 */
Rank_Feature("rank_feature"), //
/** @since 4.1 */
Rank_Features("rank_features"), //
/** since 4.2 */
Wildcard("wildcard"), //
/** @since 4.2 */
Dense_Vector("dense_vector"), //
/**
* @since 5.2
*/
Constant_Keyword("constant_keyword"), //
/**
* @since 5.2
*/
Alias("alias"), //
/**
* @since 5.2
*/
Version("version"), //
/**
* @since 5.2
*/
Murmur3("murmur3"), //
/**
* @since 5.2
*/
Match_Only_Text("match_only_text"), //
/**
* @since 5.2
*/
Annotated_Text("annotated_text") //
;
private final String mappedName;
FieldType(String mappedName) {
this.mappedName = mappedName;
}
public String getMappedName() {
return mappedName;
}
}

View File

@ -0,0 +1,38 @@
/*
* Copyright 2024-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.elasticsearch.annotations;
import org.springframework.core.annotation.AliasFor;
/**
* Query used to limit documents.
*
* @author Youssef Aouichaoui
* @since 5.4
*/
public @interface Filter {
/**
* @return Query used to limit documents. Alias for {@link #query}.
*/
@AliasFor("query")
String value() default "";
/**
* @return Query used to limit documents. Alias for {@link #value}.
*/
@AliasFor("value")
String query() default "";
}

View File

@ -1,11 +1,11 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,

Some files were not shown because too many files have changed in this diff Show More