docs: private List<String> getPercolationMatches(JsonMetric jsonMetric) throws IOException {
          HttpURLConnection connection = openConnection("/" + currentIndexName + "/" + jsonMetric.type() + "/_percolate", "POST");
          if (connection == null) {
              LOGGER.error("Could not connect to any configured elasticsearch instances for percolation: {}", Arrays.asList(hosts));
              return Collections.emptyList();
          }
  
          Map<String, Object> data = new HashMap<>(1);
          data.put("doc", jsonMetric);
          objectMapper.writeValue(connection.getOutputStream(), data);
          closeConnection(connection);
  
          if (connection.getResponseCode() != 200) {
              throw new RuntimeException("Error percolating " + jsonMetric);
          }
  
          Map<String, Object> input = objectMapper.readValue(connection.getInputStream(), new TypeReference<Map<String, Object>>() {});
          List<String> matches = new ArrayList<>();
          if (input.containsKey("matches") && input.get("matches") instanceof List) {
              List<Map<String, String>> foundMatches = (List<Map<String, String>>) input.get("matches");
              for (Map<String, String> entry : foundMatches) {
                  if (entry.containsKey("_id")) {
                      matches.add(entry.get("_id"));
                  }
              }
          }
  
          return matches;
      }