1
0
mirror of https://github.com/djohnlewis/stackdump synced 2025-12-06 07:53:28 +00:00

Fixed #7. Turns out post IDs are not unique across sites.

This change will require re-indexing of all sites unfortunately. On the upside, more questions to browse!
This commit is contained in:
Samuel Lai
2014-02-27 17:57:34 +11:00
parent cdb93e6f68
commit 01f9b10c27
2 changed files with 8 additions and 1 deletions

View File

@@ -459,6 +459,9 @@ class PostContentHandler(xml.sax.ContentHandler):
doc['answers-json'] = [ json.dumps(a, default=self.json_default_handler) for a in q['answers'] ]
# map other fields to search index doc
# this is the ID for Solr to uniquely identify this question across all
# sites
doc['documentId'] = self.site.key + '-' + str(q['id'])
doc['id'] = str(q['id'])
doc['siteKey'] = self.site.key
doc['creationDate'] = q['creationDate']