mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21:18:58 +00:00
(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:
parent
f655ec5a5c
commit
30bc3f9281
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user