summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/search/geo/GeoFilterIT.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/java/org/elasticsearch/search/geo/GeoFilterIT.java')
-rw-r--r--core/src/test/java/org/elasticsearch/search/geo/GeoFilterIT.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/src/test/java/org/elasticsearch/search/geo/GeoFilterIT.java b/core/src/test/java/org/elasticsearch/search/geo/GeoFilterIT.java
index 2707e3c0b2..568c723f8d 100644
--- a/core/src/test/java/org/elasticsearch/search/geo/GeoFilterIT.java
+++ b/core/src/test/java/org/elasticsearch/search/geo/GeoFilterIT.java
@@ -47,6 +47,7 @@ import org.elasticsearch.common.logging.ESLoggerFactory;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
+import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.search.SearchHit;
@@ -230,7 +231,7 @@ public class GeoFilterIT extends ESIntegTestCase {
new CoordinatesBuilder().coordinate(-4, -4).coordinate(-4, 4).coordinate(4, 4).coordinate(4, -4).close()));
BytesReference data = jsonBuilder().startObject().field("area", polygon).endObject().bytes();
- client().prepareIndex("shapes", "polygon", "1").setSource(data).execute().actionGet();
+ client().prepareIndex("shapes", "polygon", "1").setSource(data, XContentType.JSON).execute().actionGet();
client().admin().indices().prepareRefresh().execute().actionGet();
// Point in polygon
@@ -292,7 +293,7 @@ public class GeoFilterIT extends ESIntegTestCase {
new CoordinatesBuilder().coordinate(-4, -4).coordinate(-4, 4).coordinate(4, 4).coordinate(4, -4).close()));
data = jsonBuilder().startObject().field("area", inverse).endObject().bytes();
- client().prepareIndex("shapes", "polygon", "2").setSource(data).execute().actionGet();
+ client().prepareIndex("shapes", "polygon", "2").setSource(data, XContentType.JSON).execute().actionGet();
client().admin().indices().prepareRefresh().execute().actionGet();
// re-check point on polygon hole
@@ -326,7 +327,7 @@ public class GeoFilterIT extends ESIntegTestCase {
.coordinate(170, -10).coordinate(190, -10).coordinate(190, 10).coordinate(170, 10).close());
data = jsonBuilder().startObject().field("area", builder).endObject().bytes();
- client().prepareIndex("shapes", "polygon", "1").setSource(data).execute().actionGet();
+ client().prepareIndex("shapes", "polygon", "1").setSource(data, XContentType.JSON).execute().actionGet();
client().admin().indices().prepareRefresh().execute().actionGet();
// Create a polygon crossing longitude 180 with hole.
@@ -335,7 +336,7 @@ public class GeoFilterIT extends ESIntegTestCase {
.hole(new LineStringBuilder(new CoordinatesBuilder().coordinate(175, -5).coordinate(185, -5).coordinate(185, 5).coordinate(175, 5).close()));
data = jsonBuilder().startObject().field("area", builder).endObject().bytes();
- client().prepareIndex("shapes", "polygon", "1").setSource(data).execute().actionGet();
+ client().prepareIndex("shapes", "polygon", "1").setSource(data, XContentType.JSON).execute().actionGet();
client().admin().indices().prepareRefresh().execute().actionGet();
result = client().prepareSearch()
@@ -384,7 +385,7 @@ public class GeoFilterIT extends ESIntegTestCase {
client().admin().indices().prepareCreate("countries").setSettings(settings)
.addMapping("country", xContentBuilder.string()).execute().actionGet();
- BulkResponse bulk = client().prepareBulk().add(bulkAction, 0, bulkAction.length, null, null).execute().actionGet();
+ BulkResponse bulk = client().prepareBulk().add(bulkAction, 0, bulkAction.length, null, null, xContentBuilder.contentType()).get();
for (BulkItemResponse item : bulk.getItems()) {
assertFalse("unable to index data", item.isFailed());