Skip to content

Commit f220075

Browse files
committed
Update README.md
1 parent 35cb4e6 commit f220075

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,56 @@ Indexing multiple Document(bulk index) using Repository
174174
repository.save(sampleEntities);
175175
```
176176

177+
### Geo indexing and request
178+
179+
You can make request using geo_distance filter. This can be done using GeoPoint object.
180+
181+
First, here is a sample of an entity with a GeoPoint field
182+
183+
```java
184+
@Document(indexName = "test-geo-index", type = "geo-class-point-type")
185+
public class AuthorMarkerEntity {
186+
187+
@Id
188+
private String id;
189+
private String name;
190+
191+
private GeoPoint location;
192+
193+
private AuthorMarkerEntity(){
194+
}
195+
196+
public AuthorMarkerEntity(String id){
197+
this.id = id;
198+
}
199+
200+
public String getId() {
201+
return id;
202+
}
203+
204+
public void setId(String id) {
205+
this.id = id;
206+
}
207+
208+
public String getName() {
209+
return name;
210+
}
211+
212+
public void setName(String name) {
213+
this.name = name;
214+
}
215+
216+
public GeoPoint getLocation() {
217+
return location;
218+
}
219+
220+
public void setLocation(GeoPoint location) {
221+
this.location = location;
222+
}
223+
}
224+
```
225+
226+
177227
### XML Namespace
178228

179229
You can set up repository scanning via xml configuration, which will happily create your repositories.

0 commit comments

Comments
 (0)