Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.opensearch.geospatial.action.upload.geojson.UploadGeoJSONRequestContent;
import org.opensearch.geospatial.index.mapper.xyshape.XYShapeFieldMapper;
import org.opensearch.geospatial.index.query.xyshape.XYShapeQueryBuilder;
import org.opensearch.geospatial.processor.FeatureProcessor;
import org.opensearch.geospatial.rest.action.upload.geojson.RestUploadGeoJSONAction;
import org.opensearch.ingest.Pipeline;
import org.opensearch.rest.RestStatus;
Expand Down Expand Up @@ -75,7 +74,7 @@ private static String buildPipelinePath(String name) {
return String.join(URL_DELIMITER, "_ingest", "pipeline", name);
}

protected static void createPipeline(String name, Optional<String> description, List<Map<String, Object>> processorConfigs)
protected static Response createPipeline(String name, Optional<String> description, List<Map<String, Object>> processorConfigs)
throws IOException {
XContentBuilder builder = XContentFactory.jsonBuilder().startObject();
if (description.isPresent()) {
Expand All @@ -88,7 +87,7 @@ protected static void createPipeline(String name, Optional<String> description,

Request request = new Request("PUT", buildPipelinePath(name));
request.setJsonEntity(Strings.toString(builder));
client().performRequest(request);
return client().performRequest(request);
}

protected static void deletePipeline(String name) throws IOException {
Expand Down Expand Up @@ -137,9 +136,9 @@ public static String indexDocument(String indexName, String docID, String body,
return docID;
}

protected Map<String, Object> buildGeoJSONFeatureProcessorConfig(Map<String, String> properties) {
protected Map<String, Object> buildProcessorConfig(final String processorType, final Map<String, String> properties) {
Map<String, Object> featureProcessor = new HashMap<>();
featureProcessor.put(FeatureProcessor.TYPE, properties);
featureProcessor.put(processorType, properties);
return featureProcessor;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testIndexGeoJSONSuccess() throws Exception {

Map<String, String> processorProperties = new HashMap<>();
processorProperties.put(FeatureProcessor.FIELD_KEY, geoShapeField);
Map<String, Object> geoJSONProcessorConfig = buildGeoJSONFeatureProcessorConfig(processorProperties);
Map<String, Object> geoJSONProcessorConfig = buildProcessorConfig(FeatureProcessor.TYPE, processorProperties);
List<Map<String, Object>> configs = new ArrayList<>();
configs.add(geoJSONProcessorConfig);

Expand Down