You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wiki page for https://github.com/spring-projects/spring-data-elasticsearch/wiki/How-to-start-with-spring-data-elasticsearch[Getting Started]
24
+
This section is just short introduction, for more information refer to the https://spring.io/projects/spring-data-elasticsearch#learn[reference documentation].
25
+
26
+
=== Versions
27
+
28
+
The following table shows the Elasticsearch versions that are used by Spring Data Elasticsearch:
29
+
[cols="^,^"]
30
+
|===
31
+
|Spring Data Elasticsearch |Elasticsearch
32
+
33
+
|3.2.x |6.7.2
34
+
|3.1.x |6.2.2
35
+
|3.0.x |5.5.0
36
+
|2.1.x |2.4.0
37
+
|2.0.x |2.2.0
38
+
|1.3.x |1.5.2
39
+
|===
27
40
28
41
=== Maven configuration
29
42
@@ -56,35 +69,42 @@ the appropriate dependency version.
56
69
</repository>
57
70
----
58
71
59
-
[cols="^,^"]
60
-
|===
61
-
|spring data elasticsearch |elasticsearch
62
-
63
-
|3.2.x |6.5.0
64
-
|3.1.x |6.2.2
65
-
|3.0.x |5.5.0
66
-
|2.1.x |2.4.0
67
-
|2.0.x |2.2.0
68
-
|1.3.x |1.5.2
69
-
|===
70
72
71
73
=== ElasticsearchRepository
72
74
73
-
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.
74
-
75
-
The ElasticsearchCrudRepository extends PagingAndSortingRepository
75
+
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.
76
+
For a detailed information about Spring Data, repositories and the supported query methods check the https://spring.io/projects/spring-data-elasticsearch#learn[reference documentation].
76
77
77
78
[source,java]
78
79
----
79
-
public interface ElasticsearchCrudRepository<T, ID extends Serializable> extends ElasticsearchRepository<T, ID>, PagingAndSortingRepository<T, ID> {
80
+
@NoRepositoryBean
81
+
public interface ElasticsearchRepository<T, ID> extends ElasticsearchCrudRepository<T, ID> {
@@ -103,7 +123,7 @@ Extending ElasticsearchRepository for custom methods
103
123
}
104
124
----
105
125
106
-
Indexing a single document with Repository
126
+
.Indexing a single document using a `Repository`:
107
127
108
128
[source,java]
109
129
----
@@ -118,7 +138,7 @@ Indexing a single document with Repository
118
138
repository.save(sampleEntity);
119
139
----
120
140
121
-
Indexing multiple Document(bulk index) using Repository
141
+
.Indexing multiple documents (bulk index) using a `Repository`:
122
142
123
143
[source,java]
124
144
----
@@ -141,11 +161,13 @@ Indexing multiple Document(bulk index) using Repository
141
161
repository.save(sampleEntities);
142
162
----
143
163
144
-
=== ElasticsearchTemplate
164
+
=== ElasticsearchTemplate and ElasticsearchRestTemplate
165
+
166
+
`ElasticsearchTemplate` and `ElasticsearchRestTemplate` are the central support classes for Elasticsearch operations, both implement the `ElasticsearchOperations` interface that defines the methods to operate on an Elasticsearch cluster.
145
167
146
-
ElasticsearchTemplateis the central support class for elasticsearch operations.
168
+
`ElasticsearchTemplate` uses a `TransportClient`, whereas `ElasticsearchRestTemplate` uses the `RestHighLevelClient`. The `TransportClient` is deprecated in Elasticsearch 7, but until it is removed from Elasticsearch, the `ElasticsearchTemplate` will be supported as well.
147
169
148
-
Indexing a single document using Elasticsearch Template
170
+
.Indexing a single document using `ElasticsearchTemplate`:
149
171
150
172
[source,java]
151
173
----
@@ -157,7 +179,7 @@ Indexing a single document using Elasticsearch Template
157
179
elasticsearchTemplate.index(indexQuery);
158
180
----
159
181
160
-
Indexing multiple Document(bulk index) using Elasticsearch Template
182
+
.Indexing multiple documents (bulk index) using `ElasticsearchTemplate`:
* https://github.com/spring-projects/spring-data-elasticsearch/wiki/Geo-indexing-and-request[Geo distance and location search]
@@ -336,7 +359,7 @@ Here are some ways for you to get involved in the community:
336
359
* Github is for social coding: if you want to write code, we encourage contributions through pull requests from https://help.github.com/forking/[forks of this repository]. If you want to contribute code this way, please reference a JIRA ticket as well covering the specific issue you are addressing.
337
360
* Watch for upcoming articles on Spring by https://www.springsource.org/node/feed[subscribing] to springframework.org
338
361
339
-
Before we accept a non-trivial patch or pull request we will need you to https://cla.pivotal.io/sign/spring[sign the Contributor License Agreement]. Signing the contributor’s 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.
362
+
Before we accept a pull request we will need you to https://cla.pivotal.io/sign/spring[sign the Contributor License Agreement]. Signing the contributor’s 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.
340
363
341
364
Code formatting for https://github.com/spring-projects/spring-data-build/tree/master/etc/ide[Eclipse and Intellij]
0 commit comments