create shard count request with the actual count request

This commit is contained in:
kimchy 2010-05-13 09:13:21 +03:00
parent b0dd31e600
commit 7ba1ad2d7b
2 changed files with 6 additions and 7 deletions

View File

@ -43,13 +43,12 @@ class ShardCountRequest extends BroadcastShardOperationRequest {
}
public ShardCountRequest(String index, int shardId, byte[] querySource, float minScore,
@Nullable String queryParserName, String... types) {
public ShardCountRequest(String index, int shardId, CountRequest request) {
super(index, shardId);
this.minScore = minScore;
this.querySource = querySource;
this.queryParserName = queryParserName;
this.types = types;
this.minScore = request.minScore();
this.querySource = request.querySource();
this.queryParserName = request.queryParserName();
this.types = request.types();
}
public float minScore() {

View File

@ -67,7 +67,7 @@ public class TransportCountAction extends TransportBroadcastOperationAction<Coun
}
@Override protected ShardCountRequest newShardRequest(ShardRouting shard, CountRequest request) {
return new ShardCountRequest(shard.index(), shard.id(), request.querySource(), request.minScore(), request.queryParserName(), request.types());
return new ShardCountRequest(shard.index(), shard.id(), request);
}
@Override protected ShardCountResponse newShardResponse() {