public String replaceStringStatusSearchQuery(String query) {
        final Matcher matcher = searchQueryStatusRegex.matcher(query);
        final StringBuffer stringBuffer = new StringBuffer();
        while(matcher.find()) {
            final String status = matcher.group(1);
            matcher.appendReplacement(stringBuffer, "status:" + Sidecar.Status.fromString(status).getStatusCode());
        }
        matcher.appendTail(stringBuffer);
        return stringBuffer.toString();
    }
public String replaceStringStatusSearchQuery ( String query ) { final Matcher matcher = searchQueryStatusRegex . matcher ( query ) ; final StringBuffer stringBuffer = new StringBuffer ( ) ; while ( matcher . find ( ) ) { final String status = matcher . group ( 1 ) ; matcher . appendReplacement ( stringBuffer , "status:" + Sidecar . Status . fromString ( status ) . getStatusCode ( ) ) ; } matcher . appendTail ( stringBuffer ) ; return stringBuffer . toString ( ) ; }
Replaces status strings in search query with their number representations,
e.g. <code>status:running</code> will be transformed into <code>status:0</code>.

@param query Search query that may contain one or more status strings
@return Search query with all status strings replaced with status codes