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...
This commit is contained in:
parent
2bb5cb83a7
commit
ad9f060dc7
|
@ -225,10 +225,13 @@ public class RestRankEvalAction extends BaseRestHandler {
|
|||
public static void parseRankEvalRequest(RankEvalRequest rankEvalRequest, RestRequest request, RankEvalContext context)
|
||||
throws IOException {
|
||||
List<String> indices = Arrays.asList(Strings.splitStringByCommaToArray(request.param("index")));
|
||||
List<String> 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,9 @@ public class TransportRankEvalAction extends HandledTransportAction<RankEvalRequ
|
|||
String[] indices = new String[spec.getIndices().size()];
|
||||
spec.getIndices().toArray(indices);
|
||||
SearchRequest templatedRequest = new SearchRequest(indices, specRequest);
|
||||
String[] types = new String[spec.getTypes().size()];
|
||||
spec.getTypes().toArray(types);
|
||||
templatedRequest.types(types);
|
||||
|
||||
TransportSearchAction transportSearchAction = new TransportSearchAction(settings, threadPool, searchPhaseController,
|
||||
transportService, searchTransportService, clusterService, actionFilters, indexNameExpressionResolver);
|
||||
|
|
Loading…
Reference in New Issue