Runs a streaming expression on a Solr collection via the /stream end point and returns the results to the CLI. Requires a collection to be specified to send the expression to. Running remotely allows you to use all the standard Streaming Expression capabilities as the expression is running in a
(String expr, CommandLine cli)
| 320 | * Solr /stream. |
| 321 | */ |
| 322 | private PushBackStream doRemoteMode(String expr, CommandLine cli) throws Exception { |
| 323 | |
| 324 | String solrUrl = CLIUtils.normalizeSolrUrl(cli); |
| 325 | String collection = cli.getOptionValue(COLLECTION_OPTION); |
| 326 | |
| 327 | return new PushBackStream( |
| 328 | new SolrStream(solrUrl + "/solr/" + collection, params("qt", "/stream", "expr", expr))); |
| 329 | } |
| 330 | |
| 331 | private static ModifiableSolrParams params(String... params) { |
| 332 | if (params.length % 2 != 0) throw new RuntimeException("Params length should be even"); |
no test coverage detected