@@ -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,23 @@ 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+
460465{-| 'IndexDocumentSettings' are special settings supplied when indexing
461466a document. For the best backwards compatiblity when new fields are
462467added, you should probably prefer to start with 'defaultIndexDocumentSettings'
463468-}
464−data IndexDocumentSettings = IndexDocumentSettings {
465− idsVersionControl :: VersionControl
466− }
469+data IndexDocumentSettings =
470+ IndexDocumentSettings { idsVersionControl :: VersionControl
471+ , idsParent :: Maybe DocumentParent
472+ }
467473
468−{-| Reasonable default settings. Chooses no version control.
474+{-| Reasonable default settings. Chooses no version control and no parent.
469475-}
470476defaultIndexDocumentSettings :: IndexDocumentSettings
471−defaultIndexDocumentSettings = IndexDocumentSettings NoVersionControl
477+defaultIndexDocumentSettings = IndexDocumentSettings NoVersionControl Nothing
472478
473479{-| 'Sort' is a synonym for a list of 'SortSpec's. Sort behavior is order
474480 dependent with later sorts acting as tie-breakers for earlier sorts.