From ad9f060dc7e08adedd3ac37adc79b5530b4962f2 Mon Sep 17 00:00:00 2001 From: Isabel Drost-Fromm Date: Wed, 27 Jul 2016 15:49:37 +0200 Subject: [PATCH] Use type information in request Adds parsing of type and actually using it in TransportRankEvalAction. Missing: A good idea how to actually test this in isolation... --- .../org/elasticsearch/index/rankeval/RestRankEvalAction.java | 3 +++ .../elasticsearch/index/rankeval/TransportRankEvalAction.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java index 5034e8350a2..7639baadc5a 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java @@ -225,10 +225,13 @@ public class RestRankEvalAction extends BaseRestHandler { public static void parseRankEvalRequest(RankEvalRequest rankEvalRequest, RestRequest request, RankEvalContext context) throws IOException { List indices = Arrays.asList(Strings.splitStringByCommaToArray(request.param("index"))); + List types = Arrays.asList(Strings.splitStringByCommaToArray(request.param("type"))); RankEvalSpec spec = PARSER.parse(context.parser(), context); for (QuerySpec specification : spec.getSpecifications()) { specification.setIndices(indices); + specification.setTypes(types); }; + rankEvalRequest.setRankEvalSpec(spec); } } diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/TransportRankEvalAction.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/TransportRankEvalAction.java index 2dbc44d7141..ee01eb6f76c 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/TransportRankEvalAction.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/TransportRankEvalAction.java @@ -92,6 +92,9 @@ public class TransportRankEvalAction extends HandledTransportAction