(converter) Use the prefix ip: instead of geopip: for country codes

This is the same as the prefix for the IP address, but I don't think that substantially matters, the as two have such different namespaces there can be no confusion.
This commit is contained in:
Viktor Lofgren 2023-12-11 13:59:23 +01:00
parent f655ec5a5c
commit 30bc3f9281

View File

@ -49,12 +49,11 @@ public class DomainProcessor {
this.anchorTagsSource = anchorTagsSourceFactory.create(); this.anchorTagsSource = anchorTagsSourceFactory.create();
this.geoIpDictionary = geoIpDictionary; this.geoIpDictionary = geoIpDictionary;
geoIpDictionary.waitReady();
} }
@SneakyThrows @SneakyThrows
public ProcessedDomain process(SerializableCrawlDataStream dataStream) { public ProcessedDomain process(SerializableCrawlDataStream dataStream) {
geoIpDictionary.waitReady();
var ret = new ProcessedDomain(); var ret = new ProcessedDomain();
List<ProcessedDocument> docs = new ArrayList<>(); List<ProcessedDocument> docs = new ArrayList<>();
@ -116,9 +115,9 @@ public class DomainProcessor {
terms.add("ip:"+ip); terms.add("ip:"+ip);
String geoIp = geoIpDictionary.getCountry(ip); String ipCountryCode = geoIpDictionary.getCountry(ip).toLowerCase();
if (!geoIp.isBlank()) { if (!ipCountryCode.isBlank()) {
terms.add("geoip:"+geoIp.toLowerCase()); terms.add("ip:"+ipCountryCode);
} }
if (cookies) { if (cookies) {