Skip to content

Commit 554a6ca

Browse files
committed
update to ES 1.4
1 parent 118c3bb commit 554a6ca

File tree

6 files changed

+60
-13
lines changed

6 files changed

+60
-13
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@ indexes.
88

99
| Elasticsearch | Plugin | Release date |
1010
| -------------- | ------------ | ------------ |
11+
| 1.4.0 | 1.4.0.0 | Nov 18, 2014 |
1112
| 1.3.2 | 1.3.0.0 | Aug 21, 2014 |
1213
| 1.2.1 | 1.2.1.0 | Jul 3, 2014 |
1314

1415
## Installation
1516

16-
./bin/plugin -install index-termlist -url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-index-termlist/1.3.0.0/elasticsearch-index-termlist-1.3.0.0-plugin.zip
17+
./bin/plugin -install index-termlist -url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-index-termlist/1.4.0.0/elasticsearch-index-termlist-1.4.0.0-plugin.zip
1718

1819
Do not forget to restart the node after installing.
1920

2021
## Checksum
2122

2223
| File | SHA1 |
2324
| ------------------------------------------------- | -----------------------------------------|
25+
| elasticsearch-index-termlist-1.4.0.0-plugin.zip | 6595b09ecb8b31e4c0d7416d0cb4d3a6b3dac9ee |
2426
| elasticsearch-index-termlist-1.3.0.0-plugin.zip | 07ea40e85584c9887337c14ec5cca098a31089b5 |
2527
| elasticsearch-index-termlist-1.2.1.0-plugin.zip | c51a8d626b32a4a6cd2ac4335b5578f0e5cccaa6 |
2628

pom.xml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.xbib.elasticsearch.plugin</groupId>
88
<artifactId>elasticsearch-index-termlist</artifactId>
9-
<version>1.3.0.0</version>
9+
<version>1.4.0.0</version>
1010

1111
<packaging>jar</packaging>
1212

@@ -49,7 +49,7 @@
4949
<github.global.server>github</github.global.server>
5050
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5151
<java.compile.version>1.7</java.compile.version>
52-
<elasticsearch.version>1.3.2</elasticsearch.version>
52+
<elasticsearch.version>1.4.0</elasticsearch.version>
5353
</properties>
5454

5555
<dependencies>
@@ -271,5 +271,30 @@
271271
</plugin>
272272
</plugins>
273273
</reporting>
274+
<profiles>
275+
276+
<profile>
277+
<id>doclint-java8-disable</id>
278+
<activation>
279+
<os>
280+
<name>mac os x</name>
281+
</os>
282+
<jdk>[1.8,</jdk>
283+
</activation>
284+
<build>
285+
<plugins>
286+
<plugin>
287+
<groupId>org.apache.maven.plugins</groupId>
288+
<artifactId>maven-javadoc-plugin</artifactId>
289+
<configuration>
290+
<javadocExecutable>/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/javadoc</javadocExecutable>
291+
<additionalparam>-Xdoclint:none</additionalparam>
292+
</configuration>
293+
</plugin>
294+
</plugins>
295+
</build>
296+
</profile>
297+
298+
</profiles>
274299

275300
</project>

src/main/java/org/xbib/elasticsearch/action/termlist/ShardTermlistRequest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
import org.elasticsearch.action.support.broadcast.BroadcastShardOperationRequest;
44
import org.elasticsearch.common.io.stream.StreamInput;
55
import org.elasticsearch.common.io.stream.StreamOutput;
6+
import org.elasticsearch.index.shard.ShardId;
67

78
import java.io.IOException;
89

910
class ShardTermlistRequest extends BroadcastShardOperationRequest {
1011

12+
private String index;
13+
1114
private String field;
1215

1316
private String term;
@@ -23,8 +26,9 @@ class ShardTermlistRequest extends BroadcastShardOperationRequest {
2326
ShardTermlistRequest() {
2427
}
2528

26-
public ShardTermlistRequest(String index, int shardId, TermlistRequest request) {
27-
super(index, shardId, request);
29+
public ShardTermlistRequest(String index, ShardId shardId, TermlistRequest request) {
30+
super(shardId, request);
31+
this.index = index;
2832
this.field = request.getField();
2933
this.term = request.getTerm();
3034
this.from = request.getFrom();
@@ -33,6 +37,10 @@ public ShardTermlistRequest(String index, int shardId, TermlistRequest request)
3337
this.withTotalFreq = request.getWithTotalFreq();
3438
}
3539

40+
public String getIndex() {
41+
return index;
42+
}
43+
3644
public void setField(String field) {
3745
this.field = field;
3846
}
@@ -84,6 +92,7 @@ public boolean getWithTotalFreq() {
8492
@Override
8593
public void readFrom(StreamInput in) throws IOException {
8694
super.readFrom(in);
95+
index = in.readString();
8796
field = in.readString();
8897
term = in.readString();
8998
from = in.readInt();
@@ -95,6 +104,7 @@ public void readFrom(StreamInput in) throws IOException {
95104
@Override
96105
public void writeTo(StreamOutput out) throws IOException {
97106
super.writeTo(out);
107+
out.writeString(index);
98108
out.writeString(field);
99109
out.writeString(term);
100110
out.writeInt(from);

src/main/java/org/xbib/elasticsearch/action/termlist/ShardTermlistResponse.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,31 @@
33
import org.elasticsearch.action.support.broadcast.BroadcastShardOperationResponse;
44
import org.elasticsearch.common.io.stream.StreamInput;
55
import org.elasticsearch.common.io.stream.StreamOutput;
6+
import org.elasticsearch.index.shard.ShardId;
67
import org.xbib.elasticsearch.common.termlist.CompactHashMap;
78

89
import java.io.IOException;
910
import java.util.Map;
1011

1112
class ShardTermlistResponse extends BroadcastShardOperationResponse {
1213

14+
private String index;
15+
1316
private Map<String, TermInfo> map;
1417

1518
ShardTermlistResponse() {
1619
}
1720

18-
public ShardTermlistResponse(String index, int shardId, Map<String, TermInfo> map) {
19-
super(index, shardId);
21+
public ShardTermlistResponse(String index, ShardId shardId, Map<String, TermInfo> map) {
22+
super(shardId);
23+
this.index = index;
2024
this.map = map;
2125
}
2226

27+
public String getIndex() {
28+
return index;
29+
}
30+
2331
public Map<String, TermInfo> getTermList() {
2432
return map;
2533
}

src/main/java/org/xbib/elasticsearch/action/termlist/TransportTermlistAction.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.apache.lucene.util.BytesRef;
1818
import org.elasticsearch.ElasticsearchException;
1919
import org.elasticsearch.action.ShardOperationFailedException;
20+
import org.elasticsearch.action.support.ActionFilters;
2021
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
2122
import org.elasticsearch.action.support.broadcast.BroadcastShardOperationFailedException;
2223
import org.elasticsearch.action.support.broadcast.TransportBroadcastOperationAction;
@@ -47,8 +48,9 @@ public class TransportTermlistAction
4748

4849
@Inject
4950
public TransportTermlistAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
50-
TransportService transportService, IndicesService indicesService) {
51-
super(settings, TermlistAction.NAME, threadPool, clusterService, transportService);
51+
TransportService transportService, IndicesService indicesService,
52+
ActionFilters actionFilters) {
53+
super(settings, TermlistAction.NAME, threadPool, clusterService, transportService, actionFilters);
5254
this.indicesService = indicesService;
5355
}
5456

@@ -100,7 +102,7 @@ protected ShardTermlistRequest newShardRequest() {
100102

101103
@Override
102104
protected ShardTermlistRequest newShardRequest(int numShards, ShardRouting shard, TermlistRequest request) {
103-
return new ShardTermlistRequest(shard.index(), shard.id(), request);
105+
return new ShardTermlistRequest(shard.getIndex(), shard.shardId(), request);
104106
}
105107

106108
@Override
@@ -128,7 +130,7 @@ protected ClusterBlockException checkRequestBlock(ClusterState state, TermlistRe
128130

129131
@Override
130132
protected ShardTermlistResponse shardOperation(ShardTermlistRequest request) throws ElasticsearchException {
131-
InternalIndexShard indexShard = (InternalIndexShard) indicesService.indexServiceSafe(request.index()).shardSafe(request.shardId());
133+
InternalIndexShard indexShard = (InternalIndexShard) indicesService.indexServiceSafe(request.getIndex()).shardSafe(request.shardId().id());
132134
Engine.Searcher searcher = indexShard.engine().acquireSearcher("termlist");
133135
try {
134136
Map<String, TermInfo> map = new CompactHashMap<String, TermInfo>();
@@ -169,7 +171,7 @@ protected ShardTermlistResponse shardOperation(ShardTermlistRequest request) thr
169171
}
170172
}
171173
}
172-
return new ShardTermlistResponse(request.index(), request.shardId(), map);
174+
return new ShardTermlistResponse(request.getIndex(), request.shardId(), map);
173175
} catch (IOException ex) {
174176
throw new ElasticsearchException(ex.getMessage(), ex);
175177
} finally {

src/main/java/org/xbib/elasticsearch/rest/action/termlist/RestTermlistAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class RestTermlistAction extends BaseRestHandler {
2727

2828
@Inject
2929
public RestTermlistAction(Settings settings, Client client, RestController controller) {
30-
super(settings, client);
30+
super(settings, controller, client);
3131
controller.registerHandler(GET, "/_termlist", this);
3232
controller.registerHandler(GET, "/{index}/_termlist", this);
3333
controller.registerHandler(GET, "/{index}/{field}/_termlist", this);

0 commit comments

Comments
 (0)