Skip to content

Commit db4ff54

Browse files
author
Clément Tourrière
committed
Migrate plugin to elasticsearch 7.0.0
1 parent 6d1a094 commit db4ff54

File tree

4 files changed

+16
-24
lines changed

4 files changed

+16
-24
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Plugin versions are available for (at least) all minor versions of Elasticsearch
7070
The first 3 digits of plugin version is Elasticsearch versioning. The last digit is used for plugin versioning under an elasticsearch version.
7171

7272
To install it, launch this command in Elasticsearch directory replacing the url by the correct link for your Elasticsearch version (see table)
73-
`./bin/elasticsearch-plugin install https://github.com/opendatasoft/elasticsearch-aggregation-geoclustering/releases/download/v6.7.0.0/geopoint-clustering-aggregation-6.7.0.0.zip`
73+
`./bin/elasticsearch-plugin install https://github.com/opendatasoft/elasticsearch-aggregation-geoclustering/releases/download/v7.0.0.0/geopoint-clustering-aggregation-7.0.0.0.zip`
7474

7575
| elasticsearch version | plugin version | plugin url |
7676
| --------------------- | -------------- | ---------- |
@@ -82,5 +82,6 @@ To install it, launch this command in Elasticsearch directory replacing the url
8282
| 6.5.4 | 6.5.4.0 | https://github.com/opendatasoft/elasticsearch-aggregation-geoclustering/releases/download/v6.5.4.0/geopoint-clustering-aggregation-6.5.4.0.zip|
8383
| 6.6.2 | 6.6.2.0 | https://github.com/opendatasoft/elasticsearch-aggregation-geoclustering/releases/download/v6.6.2.0/geopoint-clustering-aggregation-6.6.2.0.zip|
8484
| 6.7.0 | 6.7.0.0 | https://github.com/opendatasoft/elasticsearch-aggregation-geoclustering/releases/download/v6.7.0.0/geopoint-clustering-aggregation-6.7.0.0.zip|
85+
| 7.0.0 | 7.0.0.0 | https://github.com/opendatasoft/elasticsearch-aggregation-geoclustering/releases/download/v7.0.0.0/geopoint-clustering-aggregation-7.0.0.0.zip|
8586

8687

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
es_version = 6.7.0
2-
plugin_version = 6.7.0.0
1+
es_version = 7.0.0
2+
plugin_version = 7.0.0.0

src/main/java/com/opendatasoft/elasticsearch/search/aggregations/bucket/geopointclustering/GeoPointClusteringAggregator.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.opendatasoft.elasticsearch.search.aggregations.bucket.geopointclustering;
22

33
import org.apache.lucene.index.LeafReaderContext;
4+
import org.apache.lucene.search.ScoreMode;
45
import org.elasticsearch.common.geo.GeoHashUtils;
56
import org.elasticsearch.common.geo.GeoPoint;
67
import org.elasticsearch.common.lease.Releasables;
@@ -51,8 +52,11 @@ public class GeoPointClusteringAggregator extends BucketsAggregator {
5152
}
5253

5354
@Override
54-
public boolean needsScores() {
55-
return (valuesSource != null && valuesSource.needsScores()) || super.needsScores();
55+
public ScoreMode scoreMode() {
56+
if (valuesSource != null && valuesSource.needsScores()) {
57+
return ScoreMode.COMPLETE;
58+
}
59+
return super.scoreMode();
5660
}
5761

5862
@Override

src/test/resources/rest-api-spec/test/GeoPointClusteringAggregation/20_geo_clustering.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,113 +8,97 @@ setup:
88
settings:
99
number_of_shards: 3
1010
mappings:
11-
test:
12-
"properties":
13-
"point":
14-
"type": "geo_point"
11+
"properties":
12+
"point":
13+
"type": "geo_point"
1514

1615
- do:
1716
index:
1817
index: test
19-
type: test
2018
id: 1
2119
body: { "point": [2.454929, 48.821578]}
2220

2321
- do:
2422
index:
2523
index: test
26-
type: test
2724
id: 2
2825
body: { "point": [2.245858, 48.86914]}
2926

3027
- do:
3128
index:
3229
index: test
33-
type: test
3430
id: 3
3531
body: { "point": [2.240358, 48.863481]}
3632

3733
- do:
3834
index:
3935
index: test
40-
type: test
4136
id: 4
4237
body: { "point": [2.25292, 48.847176]}
4338

4439
- do:
4540
index:
4641
index: test
47-
type: test
4842
id: 5
4943
body: { "point": [2.279111, 48.872383]}
5044

5145
- do:
5246
index:
5347
index: test
54-
type: test
5548
id: 6
5649
body: { "point": [2.336267, 48.822021]}
5750

5851
- do:
5952
index:
6053
index: test
61-
type: test
6254
id: 7
6355
body: { "point": [2.338677, 48.822672]}
6456

6557
- do:
6658
index:
6759
index: test
68-
type: test
6960
id: 8
7061
body: { "point": [2.336643, 48.822493]}
7162

7263
- do:
7364
index:
7465
index: test
75-
type: test
7666
id: 9
7767
body: { "point": [2.438465, 48.84204]}
7868

7969
- do:
8070
index:
8171
index: test
82-
type: test
8372
id: 10
8473
body: { "point": [2.381554, 48.835382]}
8574

8675
- do:
8776
index:
8877
index: test
89-
type: test
9078
id: 11
9179
body: { "point": [2.407744, 48.83733]}
9280

9381
- do:
9482
index:
9583
index: test
96-
type: test
9784
id: 12
9885
body: { "point": [2.34521, 48.849358]}
9986

10087
- do:
10188
index:
10289
index: test
103-
type: test
10490
id: 13
10591
body: { "point": [2.252938, 48.846041]}
10692

10793
- do:
10894
index:
10995
index: test
110-
type: test
11196
id: 14
11297
body: { "point": [2.279715, 48.871775]}
11398

11499
- do:
115100
index:
116101
index: test
117-
type: test
118102
id: 15
119103
body: { "point": [2.380629, 48.879757]}
120104

@@ -132,6 +116,7 @@ setup:
132116

133117
- do:
134118
search:
119+
rest_total_hits_as_int: true
135120
index: test
136121
body: {"aggs": { "gc" : { "geo_point_clustering": {"field": "point", "zoom": 1} } } }
137122

@@ -149,6 +134,7 @@ setup:
149134

150135
- do:
151136
search:
137+
rest_total_hits_as_int: true
152138
index: test
153139
body: {"aggs": { "gc" : { "geo_point_clustering": {"field": "point", "zoom": 9} } } }
154140

@@ -169,6 +155,7 @@ setup:
169155

170156
- do:
171157
search:
158+
rest_total_hits_as_int: true
172159
index: test
173160
body: {"aggs": { "gc" : { "geo_point_clustering": {"field": "point", "zoom": 15} } } }
174161

0 commit comments

Comments
 (0)