Skip to content

Commit 08b4a11

Browse files
refactor
1 parent b94626c commit 08b4a11

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

index/scorch/introducer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ func (s *Scorch) introduceSegment(next *segmentIntroduction) error {
167167
newss.deleted = nil
168168
}
169169

170+
// update the deleted bitmap to include any nested/sub-documents as well
171+
// if the segment supports that
172+
if ns, ok := newss.segment.(segment.NestedSegment); ok {
173+
newss.deleted = ns.AddNestedDocuments(newss.deleted)
174+
}
170175
// check for live size before copying
171176
if newss.LiveSize() > 0 {
172177
newSnapshot.segment = append(newSnapshot.segment, newss)

mapping/document.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ func (dm *DocumentMapping) walkDocument(data interface{}, path []string, indexes
451451
if val.Index(i).CanInterface() {
452452
fieldVal := val.Index(i).Interface()
453453
if nestedSubObjects {
454-
nestedDocument := document.NewDocument(fmt.Sprintf("%s_%s_%d", context.doc.ID(), encodePath(path), i))
454+
nestedDocument := document.NewDocument(fmt.Sprintf("%s_$%s_$%d", context.doc.ID(), encodePath(path), i))
455455
nestedContext := context.im.newWalkContext(nestedDocument, dm)
456456
dm.processProperty(fieldVal, path, append(indexes, uint64(i)), nestedContext)
457457
context.doc.AddNestedDocument(nestedDocument)

0 commit comments

Comments
 (0)