static String searchIndexForDownloadUrl(String searchQuery, IndexJson index) {
    Set<String> searchTokens = tokenize(searchQuery);
    List<PropertiesJson> approxName = new ArrayList<>();
    List<PropertiesJson> id = new ArrayList<>();
    List<PropertiesJson> exactName = new ArrayList<>();
    for (var feature : index.features) {
      PropertiesJson properties = feature.properties;
      if (properties.urls.containsKey("pbf")) {
        if (properties.ids().stream().map(Geofabrik::tokenize).anyMatch(searchTokens::equals)) {
          id.add(properties);
        } else if (tokenize(properties.name).equals(searchTokens)) {
          exactName.add(properties);
        } else if (tokenize(properties.name).containsAll(searchTokens)) {
          approxName.add(properties);
        }
      }
    }
    String result = getIfOnly(searchQuery, "exact ID matches", id);
    if (result == null) {
      result = getIfOnly(searchQuery, "exact name matches", exactName);
    }
    if (result == null) {
      result = getIfOnly(searchQuery, "approximate name matches", approxName);
    }
    if (result == null) {
      throw new IllegalArgumentException("No matches for '" + searchQuery + "'");
    }
    return result;
  }
Fetches the Geofabrik index and searches for a {@code .osm.pbf} resource to download where ID or name field
contains all the tokens in {@code searchQuery}.
<p>
If an exact match is found, returns that. Otherwise, looks for a resource that contains {@code searchQuery} as a
substring.
<p>
The index is only fetched once and cached after that.

@param searchQuery the tokens to search for
@param config      planetiler config with user-agent and timeout to use when downloading files
@return the URL of a {@code .osm.pbf} file with name or ID matching {@code searchQuery}
@throws IllegalArgumentException if no matches, or more than one match is found.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/Geofabrik.java