Skip to content

Commit d202457

Browse files
committed
fixing REST action bug
1 parent dc47913 commit d202457

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

README.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Here is a list of languages code recognized:
8989
[frame="all"]
9090
|===
9191
| Plugin version | Elasticsearch version | Release date
92+
| 5.3.0.1 | 5.3.0 | Apr 1, 2017
9293
| 5.3.0.0 | 5.3.0 | Mar 30, 2017
9394
| 5.2.2.0 | 5.2.2 | Mar 2, 2017
9495
| 5.2.1.0 | 5.2.1 | Mar 2, 2017
@@ -120,7 +121,7 @@ Here is a list of languages code recognized:
120121

121122
[source]
122123
----
123-
./bin/elasticsearch-plugin install http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-langdetect/5.3.0.0/elasticsearch-langdetect-5.3.0.0-plugin.zip
124+
./bin/elasticsearch-plugin install http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-langdetect/5.3.0.1/elasticsearch-langdetect-5.3.0.1-plugin.zip
124125
----
125126

126127
### Elasticsearch 2.x

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
group = org.xbib.elasticsearch.plugin
22
name = elasticsearch-langdetect
3-
version = 5.3.0.0
3+
version = 5.3.0.1
44

55
elasticsearch.version = 5.3.0
66
log4j.version = 2.8

src/main/java/org/xbib/elasticsearch/action/langdetect/LangdetectResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public LangdetectResponse setLanguages(List<Language> languages) {
4343

4444
@Override
4545
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
46+
builder.startObject();
4647
if (!Strings.isNullOrEmpty(profile)) {
4748
builder.field("profile", profile);
4849
}
@@ -52,6 +53,7 @@ public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params par
5253
.field("probability", lang.getProbability()).endObject();
5354
}
5455
builder.endArray();
56+
builder.endObject();
5557
return builder;
5658
}
5759

src/main/java/org/xbib/elasticsearch/rest/action/langdetect/RestLangdetectAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import java.io.IOException;
1414

15+
import static org.elasticsearch.rest.RestRequest.Method.GET;
1516
import static org.elasticsearch.rest.RestRequest.Method.POST;
1617

1718
/**
@@ -22,6 +23,7 @@ public class RestLangdetectAction extends BaseRestHandler {
2223
@Inject
2324
public RestLangdetectAction(Settings settings, RestController controller) {
2425
super(settings);
26+
controller.registerHandler(GET, "/_langdetect", this);
2527
controller.registerHandler(POST, "/_langdetect", this);
2628
}
2729

0 commit comments

Comments
 (0)