Package com.attivio.platform.util
Class AbstractDocumentAssociation
- java.lang.Object
-
- com.attivio.platform.util.AbstractDocumentAssociation
-
- Direct Known Subclasses:
ParentChildDocumentAssociation
public abstract class AbstractDocumentAssociation extends java.lang.Object
Methods for maintaining associations between documents. Specific implementations choose the fields where the links are stored.
-
-
Constructor Summary
Constructors Constructor Description AbstractDocumentAssociation()
Constructor, default.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clearAssociation(IngestDocument doc)
Clears any association related fieldsPhraseQuery
createChildQuery(IngestDocument doc)
Creates a Query that will find all children of this document, if any.PhraseQuery
createChildQuery(java.lang.String docId)
Creates a Query that will find all children of this document, if any.protected abstract java.lang.String
getAncestorIdField()
java.util.ArrayList<java.lang.String>
getAncestry(IngestDocument doc)
int
getChildCount(IngestDocument doc)
protected abstract java.lang.String
getChildCountField()
int
getChildIndex(IngestDocument doc)
protected abstract java.lang.String
getChildIndexField()
java.lang.String
getParentId(IngestDocument doc)
protected abstract java.lang.String
getParentIdField()
protected abstract java.lang.String
getProgenatorIdField()
java.lang.String
getUltimateParentId(IngestDocument doc)
void
noteChild(IngestDocument parent, IngestDocument child)
Annotates parent and child documents such that the parent child relationship is maintained.
-
-
-
Method Detail
-
getAncestorIdField
protected abstract java.lang.String getAncestorIdField()
-
getChildCountField
protected abstract java.lang.String getChildCountField()
-
getChildIndexField
protected abstract java.lang.String getChildIndexField()
-
getParentIdField
protected abstract java.lang.String getParentIdField()
-
getProgenatorIdField
protected abstract java.lang.String getProgenatorIdField()
-
noteChild
public void noteChild(IngestDocument parent, IngestDocument child)
Annotates parent and child documents such that the parent child relationship is maintained. Intended to be used by components that are splitting document lists or creating child documents that will be later processed by a aggregation components.- Parameters:
child
-
-
clearAssociation
public void clearAssociation(IngestDocument doc)
Clears any association related fields
-
getChildIndex
public int getChildIndex(IngestDocument doc)
- Returns:
- which part this child document is in a compound document or -1 if it is not part of a compound document
-
getUltimateParentId
public java.lang.String getUltimateParentId(IngestDocument doc)
- Returns:
- the document id of the top-level ancestor of this document or null if this document is not part of a compound document.
-
getParentId
public java.lang.String getParentId(IngestDocument doc)
- Returns:
- the document id of the parent of this document or null if this document is not part of a compound document.
-
getChildCount
public int getChildCount(IngestDocument doc)
- Returns:
- the number of children created for this compound document or 0 if this is not a compound document.
-
createChildQuery
public PhraseQuery createChildQuery(IngestDocument doc)
Creates a Query that will find all children of this document, if any. Note, this query will have no effect if the schema does not contain the parentId field.- Returns:
- a Query that will find all children of this document, if any
-
createChildQuery
public PhraseQuery createChildQuery(java.lang.String docId)
Creates a Query that will find all children of this document, if any. Note, this query will have no effect if the schema does not contain the parentId field.- Returns:
- a Query that will find all children of this document, if any
-
getAncestry
public java.util.ArrayList<java.lang.String> getAncestry(IngestDocument doc)
- Returns:
- the list of ancestor ids of this document.
-
-