public Map<String, List<Location>> getLocations(List<String> locations) {
        try (CloseableHttpClient httpClient = HttpClientBuilder.create().build()) {
            URIBuilder uri = new URIBuilder(url + SEARCH_API);
            for (String loc : locations) {
                uri.addParameter(SEARCH_PARAM, loc);
            }
            HttpGet httpGet = new HttpGet(uri.build());

            HttpResponse resp = httpClient.execute(httpGet);
            String respJson = IOUtils.toString(resp.getEntity().getContent(), StandardCharsets.UTF_8);

            @SuppressWarnings("serial") Type typeDef =
                    new TypeToken<Map<String, List<Location>>>() {
                    }.getType();

            return new Gson().fromJson(respJson, typeDef);

        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }

        return null;
    }
Calls API of lucene-geo-gazetteer to search location name in gazetteer.

@param locations List of locations to be searched in gazetteer
@return Map of input location strings to gazetteer locations
tika-parsers/tika-parsers-ml/tika-parser-nlp-module/src/main/java/org/apache/tika/parser/geo/topic/gazetteer/GeoGazetteerClient.java