Permalink
Browse files

Country of the user is added to loan stats in solr.

  • Loading branch information...
Anand Chitipothu
Anand Chitipothu committed Jan 17, 2014
1 parent 497d7a9 commit c5c450f0bb6c3d082100bc9596b67e64737358eb
Showing with 3 additions and 1 deletion.
  1. +3 −1 openlibrary/solr/process_stats.py
@@ -17,7 +17,6 @@
import simplejson
import logging
import os
-import time
from infogami import config
from openlibrary.solr.solrwriter import SolrWriter
@@ -184,6 +183,9 @@ def add_subjects(type):
if year:
solrdoc['publish_year'] = year
+ if "geoip_country" in doc:
+ solrdoc['country_s'] = doc['geoip_country']
+
# Remove None values
solrdoc = dict((k, v) for k, v in solrdoc.items() if v is not None)
return solrdoc

0 comments on commit c5c450f

Please sign in to comment.