@@ -63,6 +63,7 @@ module Database.Bloodhound.Types
63 , DocVersion
63 , DocVersion
64 , ExternalDocVersion(..)
64 , ExternalDocVersion(..)
65 , VersionControl(..)
65 , VersionControl(..)
66 , IndexDocumentSettings(..)
67 , IndexDocumentSettings(..)
67 , Query(..)
68 , Query(..)
68 , Search(..)
69 , Search(..)
@@ -457,18 +458,23 @@ data VersionControl = NoVersionControl
457 -- care, as this could result in data loss.
458 -- care, as this could result in data loss.
458 deriving (Show, Eq, Ord)
459 deriving (Show, Eq, Ord)
461+{-| 'DocumentParent' is used to specify a parent document.
463+newtype DocumentParent = DocumentParent DocId
460{-| 'IndexDocumentSettings' are special settings supplied when indexing
465{-| 'IndexDocumentSettings' are special settings supplied when indexing
461a document. For the best backwards compatiblity when new fields are
466a document. For the best backwards compatiblity when new fields are
462added, you should probably prefer to start with 'defaultIndexDocumentSettings'
467added, you should probably prefer to start with 'defaultIndexDocumentSettings'
464−data IndexDocumentSettings = IndexDocumentSettings {
469+data IndexDocumentSettings =
465− idsVersionControl :: VersionControl
470+ IndexDocumentSettings { idsVersionControl :: VersionControl
471+ , idsParent :: Maybe DocumentParent
468−{-| Reasonable default settings. Chooses no version control.
474+{-| Reasonable default settings. Chooses no version control and no parent.
470defaultIndexDocumentSettings :: IndexDocumentSettings
476defaultIndexDocumentSettings :: IndexDocumentSettings
471−defaultIndexDocumentSettings = IndexDocumentSettings NoVersionControl
477+defaultIndexDocumentSettings = IndexDocumentSettings NoVersionControl Nothing
473{-| 'Sort' is a synonym for a list of 'SortSpec's. Sort behavior is order
479{-| 'Sort' is a synonym for a list of 'SortSpec's. Sort behavior is order
474 dependent with later sorts acting as tie-breakers for earlier sorts.
480 dependent with later sorts acting as tie-breakers for earlier sorts.