setParentField

Sets the parent document field. If this optional property is set, IndexWriter will add an internal field to every root document added to the index writer. A document is considered a parent document if it's the last document in a document block indexed via or IndexWriter.updateDocuments and its relatives. Additionally, all individual documents added via the single document methods (IndexWriter.addDocuments etc.) are also considered parent documents. This property is optional for all indices that don't use document blocks in combination with index sorting. In order to maintain the API guarantee that the document order of a block is not altered by the IndexWriter a marker for parent documents is required.