@@ -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,24 @@ 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
466{-| 'IndexDocumentSettings' are special settings supplied when indexing
461a document. For the best backwards compatiblity when new fields are
467a document. For the best backwards compatiblity when new fields are
462added, you should probably prefer to start with 'defaultIndexDocumentSettings'
468added, you should probably prefer to start with 'defaultIndexDocumentSettings'
464−data IndexDocumentSettings = IndexDocumentSettings {
470+data IndexDocumentSettings =
465− idsVersionControl :: VersionControl
471+ IndexDocumentSettings { idsVersionControl :: VersionControl
466− }
472+ , idsParent :: Maybe DocumentParent
473+ } deriving (Eq, Show)
468−{-| Reasonable default settings. Chooses no version control.
475+{-| Reasonable default settings. Chooses no version control and no parent.
470defaultIndexDocumentSettings :: IndexDocumentSettings
477defaultIndexDocumentSettings :: IndexDocumentSettings
471−defaultIndexDocumentSettings = IndexDocumentSettings NoVersionControl
478+defaultIndexDocumentSettings = IndexDocumentSettings NoVersionControl Nothing
473{-| 'Sort' is a synonym for a list of 'SortSpec's. Sort behavior is order
480{-| '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.
481 dependent with later sorts acting as tie-breakers for earlier sorts.