@@ -266,8 +266,6 @@ def get_mapping(self):
266
266
self ._type : {
267
267
# Disable _all field to reduce index size.
268
268
'_all' : {'enabled' : False },
269
- # Associate a page with a project.
270
- # '_parent': {'type': self._parent},
271
269
'properties' : {
272
270
'id' : {'type' : 'keyword' },
273
271
'sha' : {'type' : 'keyword' },
@@ -282,6 +280,13 @@ def get_mapping(self):
282
280
'content' : {'type' : 'text' , 'analyzer' : 'default_icu' },
283
281
# Add a weight field to enhance relevancy scoring.
284
282
'weight' : {'type' : 'float' },
283
+ # Associate a page with a project.
284
+ self ._parent : {
285
+ 'type' : 'join' ,
286
+ 'relations' : {
287
+ self ._parent : self ._type
288
+ }
289
+ },
285
290
}
286
291
}
287
292
}
@@ -314,8 +319,6 @@ def get_mapping(self):
314
319
self ._type : {
315
320
# Disable _all field to reduce index size.
316
321
'_all' : {'enabled' : False },
317
- # Associate a section with a page.
318
- # '_parent': {'type': self._parent},
319
322
# Commenting this out until we need it.
320
323
# 'suggest': {
321
324
# "type": "completion",
@@ -340,6 +343,13 @@ def get_mapping(self):
340
343
},
341
344
# Add a weight field to enhance relevancy scoring.
342
345
'weight' : {'type' : 'float' },
346
+ # Associate a section with a page.
347
+ self ._parent : {
348
+ 'type' : 'join' ,
349
+ 'relations' : {
350
+ self ._parent : self ._type
351
+ }
352
+ },
343
353
}
344
354
}
345
355
}
0 commit comments