private static String standardizeUri ( String uri ) { return ( uri == null ) ? null : regexIDPattern . matcher ( regexTaskIDPattern . matcher ( regexParameterPattern . matcher ( uri ) . replaceFirst ( "" ) ) . replaceAll ( "task_id:\\?" ) ) . replaceAll ( "/\\?$1" ) ; }
Using regexes derived from the Elasticsearch 5 . 6 HTTP API this method removes additional parameters in the request and replaces numerical IDs with ? to reduce granularity .