Skip to content

Commit 6dfaafa

Browse files
committed
search: don't index page id
As elasticsearch expects a long while we have an hash as string. While at it remove references to _parent and _id as they are gone.
1 parent 2477469 commit 6dfaafa

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

readthedocs/search/indexes.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,8 @@ def bulk_index(self, data, index=None, chunk_size=500, parent=None,
127127
doc = {
128128
'_index': index,
129129
'_type': self._type,
130-
'_id': source['id'],
131130
'_source': source,
132131
}
133-
if parent:
134-
doc['_parent'] = parent
135132
if routing:
136133
doc['_routing'] = routing
137134
docs.append(doc)
@@ -294,7 +291,7 @@ def get_mapping(self):
294291
def extract_document(self, data):
295292
doc = {}
296293

297-
attrs = ('id', 'project', 'title', 'headers', 'version', 'path',
294+
attrs = ('project', 'title', 'headers', 'version', 'path',
298295
'content', 'taxonomy', 'commit')
299296
for attr in attrs:
300297
doc[attr] = data.get(attr, '')

0 commit comments

Comments
 (0)