Get Solr base url with port if present and root from URI @param uri Full Solr URI (e.g. http://localhost:8983/solr/admin/info/system) @return Solr base url with port and root (from above example http://localhost:8983/solr)
(URI uri)
| 105 | * @return Solr base url with port and root (from above example http://localhost:8983/solr) |
| 106 | */ |
| 107 | public static String getSolrUrlFromUri(URI uri) { |
| 108 | return uri.resolve("/" + uri.getPath().split("/")[1]).toString(); |
| 109 | } |
| 110 | |
| 111 | public static ModifiableSolrParams getSolrParamsFromUri(URI uri) { |
| 112 | ModifiableSolrParams paramsMap = new ModifiableSolrParams(); |