瀏覽代碼

bug fix

solr_update
Simon Bowie 2 年之前
父節點
當前提交
f176721e8d
共有 1 個文件被更改,包括 7 次插入6 次删除
  1. +7
    -6
      web/app/solr.py

+ 7
- 6
web/app/solr.py 查看文件

@@ -156,15 +156,16 @@ def parse_result(id, input):

# search for the country in the content element and display it
country_code = re.search('FT=D[^\s]*\s(\w{2})', input)
country = pycountry.countries.get(alpha_2=country_code.group(1))
if country is not None:
output['country'] = country
else:
country = pycountry.historic_countries.get(alpha_2=country_code.group(1))
if country_code is not None:
country = pycountry.countries.get(alpha_2=country_code.group(1))
if country is not None:
output['country'] = country
else:
output['country'] = country_code.group(1)
country = pycountry.historic_countries.get(alpha_2=country_code.group(1))
if country is not None:
output['country'] = country
else:
output['country'] = country_code.group(1)

output['raw'] = input


Loading…
取消
儲存