@@ -63,6 +63,7 @@ module Database.Bloodhound.Types
6363 , DocVersion
6464 , ExternalDocVersion(..)
6565 , VersionControl(..)
66+ , DocumentParent(..)
6667 , IndexDocumentSettings(..)
6768 , Query(..)
6869 , Search(..)
@@ -457,18 +458,24 @@ data VersionControl = NoVersionControl
457458 -- care, as this could result in data loss.
458459 deriving (Show, Eq, Ord)
459460
461+{-| 'DocumentParent' is used to specify a parent document.
462+-}
463+newtype DocumentParent = DocumentParent DocId
464+ deriving (Eq, Show)
465+
460466{-| 'IndexDocumentSettings' are special settings supplied when indexing
461467a document. For the best backwards compatiblity when new fields are
462468added, you should probably prefer to start with 'defaultIndexDocumentSettings'
463469-}
464−data IndexDocumentSettings = IndexDocumentSettings {
465− idsVersionControl :: VersionControl
466− }
470+data IndexDocumentSettings =
471+ IndexDocumentSettings { idsVersionControl :: VersionControl
472+ , idsParent :: Maybe DocumentParent
473+ } deriving (Eq, Show)
467474
468−{-| Reasonable default settings. Chooses no version control.
475+{-| Reasonable default settings. Chooses no version control and no parent.
469476-}
470477defaultIndexDocumentSettings :: IndexDocumentSettings
471−defaultIndexDocumentSettings = IndexDocumentSettings NoVersionControl
478+defaultIndexDocumentSettings = IndexDocumentSettings NoVersionControl Nothing
472479
473480{-| 'Sort' is a synonym for a list of 'SortSpec's. Sort behavior is order
474481 dependent with later sorts acting as tie-breakers for earlier sorts.