Skip to content

Revert "Add support for a new output format : GeoJSON (#62)" #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2021
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
24 changes: 3 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Elasticsearch Data Format Plugin
## Overview

Elasticsearch Data Format Plugin provides a feature to allow you to download a response of a search result as several formats other than JSON.
The supported formats are CSV, Excel, JSON(Bulk), JSON(Object List) and GeoJSON.
The supported formats are CSV, Excel, JSON(Bulk) and JSON(Object List).

## Version

Expand All @@ -31,7 +31,7 @@ If not, it's as scan query(all data are stored.).
| Request Parameter | Type | Description |
|:------------------|:-------:|:------------|
| append.header | boolean | Append column headers if true |
| fields_name | string | choose the fields to dump (comma separate format) |
| fields_name | string | choose the fields to dump |
| source | string | [Query DSL](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html) |
| csv.separator | string | Separate character in CSV |
| csv.quote | string | Quote character in CSV|
Expand All @@ -46,7 +46,7 @@ If not, it's as scan query(all data are stored.).
| Request Parameter | Type | Description |
|:------------------|:-------:|:------------|
| append.header | boolean | Append column headers if true |
| fields_name | string | choose the fields to dump (comma separate format) |
| fields_name | string | choose the fields to dump |
| source | string | [Query DSL](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html) |

### Excel 2007
Expand All @@ -55,8 +55,6 @@ If not, it's as scan query(all data are stored.).

| Request Parameter | Type | Description |
|:------------------|:-------:|:------------|
| append.header | boolean | Append column headers if true |
| fields_name | string | choose the fields to dump (comma separate format) |
| source | string | [Query DSL](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html) |

### JSON (Elasticsearch Bulk format)
Expand All @@ -77,19 +75,3 @@ If not, it's as scan query(all data are stored.).
| :---------------- | :----: | :----------------------------------------------------------- |
| source | string | [Query DSL](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html) |

### GeoJSON (Open GIS standard)

$ curl -o /tmp/data.json -XGET "localhost:9200/{index}/{type}/_data?format=geojson&source=..."

| Request Parameter | Type | Description |
| :----------------------- | :----: | :----------------------------------------------------------- |
| source | string | [Query DSL](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html) |
| geometry.lon_field | string | Longitude field for coordinates (Support Geometry type "Point") |
| geometry.lat_field | string | Latitude field for coordinates (Support Geometry type "Point") |
| geometry.alt_field | string | Altitude field for coordinates (Support Geometry type "Point") |
| geometry.coord_field | string | Coordinates field. Support all Geometry types (see [GeoJSON Example](https://en.wikipedia.org/wiki/GeoJSON)).<br/>If set, overwrite `geometry.lon_field`, `geometry.lat_field` and `geometry.alt_field` |
| geometry.type_field | string | Geometry type field (see [GeoJSON Example](https://en.wikipedia.org/wiki/GeoJSON))<br/>Only used if `geometry.coord_field` param is set |
| keep_geometry_info | boolean | Keep or not the original geometry fields in final GeoJSON properties (default: false) |
| exclude_fields | string | Exclude fields in final geojson properties (comma separate format) |

**NB**: Field name can use basic style like `a` or JSONpath style like `a.b.c[2].d`
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@
<artifactId>poi-ooxml-schemas</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>org.codelibs</groupId>
<artifactId>elasticsearch-cluster-runner</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.codelibs.elasticsearch.df.content;

import org.codelibs.elasticsearch.df.content.csv.CsvContent;
import org.codelibs.elasticsearch.df.content.geojson.GeoJsonContent;
import org.codelibs.elasticsearch.df.content.json.JsonContent;
import org.codelibs.elasticsearch.df.content.json.JsonListContent;
import org.codelibs.elasticsearch.df.content.xls.XlsContent;
Expand Down Expand Up @@ -118,27 +117,6 @@ public String fileName(final RestRequest request) {
}
return index + ".json";
}
},
GEOJSON(60) {
@Override
public String contentType() {
return "application/geo+json";
}

@Override
public DataContent dataContent(final Client client,
final RestRequest request) {
return new GeoJsonContent(client, request, this);
}

@Override
public String fileName(final RestRequest request) {
final String index = request.param("index");
if (index == null) {
return "_all.geojson";
}
return index + ".geojson";
}
};

private int index;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ private ContentType getContentType(final RestRequest request) {
} else if ("application/list+json".equals(contentType)
|| "jsonlist".equals(contentType)) {
return ContentType.JSONLIST;
} else if ("application/geo+json".equals(contentType)
|| "application/geojson".equals(contentType)
|| "geojson".equals(contentType)) {
return ContentType.GEOJSON;
}

return null;
Expand Down
Loading