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:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user