public class BaseCollectionTypeDocumentsGenerator<P extends Product> extends Object implements com.neurosys.spider.indexer.DocumentGenerator<P,Void,com.neurosys.spider.ds.processors.ObjectDocumentRowMapperIndexer<P,Void>>
Product#ATTRIB_COLLECTION_TYPE_NAME
can have multiple Products associated with it in Product.getRelatedGroups()
. Using this a Document
is generated
for each Product
that itself is responsible for multiple other Document
sModifier and Type | Field and Description |
---|---|
static String |
FIELDNAME_COLLECTION_NAME
Maps to
Product.getName() |
static String |
FIELDNAME_COLLECTIONTYPE_NAME
Maps to value of
Product#getAttribute(Product#ATTRIB_COLLECTION_TYPE_NAME) |
static String |
FIELDNAME_SEQUENCE_WITHIN_COLLECTION
A unique sequence # Field in a Document for a Product per Collection.
|
Constructor and Description |
---|
BaseCollectionTypeDocumentsGenerator() |
Modifier and Type | Method and Description |
---|---|
protected String |
getCollectionName(P product) |
protected String |
getCollectionTypeName(P product) |
List<org.apache.lucene.document.Document> |
getDocuments(com.neurosys.spider.ds.processors.ObjectDocumentRowMapperIndexer<P,Void> indexerRef,
P collection,
Void metaData,
org.apache.lucene.document.Document parentDoc) |
List<com.neurosys.spider.indexer.FieldGenerator<P,Void,com.neurosys.spider.ds.processors.ObjectDocumentRowMapperIndexer>> |
getFieldGenerators()
Provide additional ability to generate new/additional document fields based on each product found in the Collection obtained from
listForProductTransformer |
protected String |
getId(P product) |
org.apache.commons.collections.Transformer |
getListForProductTransformer()
Transformer that will act on the entity to generate the
List of Product s for a collectionNote: If the transformer throws a ContinueProcessingException or a BreakChainException then the result of this generator will be null. |
protected int |
getSequence(P p,
int naturalSeq) |
void |
setFieldGenerators(List<com.neurosys.spider.indexer.FieldGenerator<P,Void,com.neurosys.spider.ds.processors.ObjectDocumentRowMapperIndexer>> fieldGenerators)
Provide additional ability to generate new/additional document fields based on each product found in the Collection obtained from
listForProductTransformer |
void |
setListForProductTransformer(org.apache.commons.collections.Transformer listForProductTransformer)
Transformer that will act on the entity to generate the
List of Product s for a collectionNote: If the transformer throws a ContinueProcessingException or a BreakChainException then the result of this generator will be null. |
public static String FIELDNAME_COLLECTION_NAME
Product.getName()
Product#ATTRIB_COLLECTION_TYPE_NAME
public static String FIELDNAME_COLLECTIONTYPE_NAME
Product#getAttribute(Product#ATTRIB_COLLECTION_TYPE_NAME)
Product#ATTRIB_COLLECTION_TYPE_NAME
public static String FIELDNAME_SEQUENCE_WITHIN_COLLECTION
listForProductTransformer
. You can override
the sequencing for the Index using getSequence(Product, int)
public BaseCollectionTypeDocumentsGenerator()
protected int getSequence(P p, int naturalSeq)
public List<org.apache.lucene.document.Document> getDocuments(com.neurosys.spider.ds.processors.ObjectDocumentRowMapperIndexer<P,Void> indexerRef, P collection, Void metaData, org.apache.lucene.document.Document parentDoc) throws Exception
public org.apache.commons.collections.Transformer getListForProductTransformer()
List
of Product
s for a collectionContinueProcessingException
or a BreakChainException
then the result of this generator will be null. For any other type of exception the exception will be thrown.public void setListForProductTransformer(org.apache.commons.collections.Transformer listForProductTransformer)
List
of Product
s for a collectionContinueProcessingException
or a BreakChainException
then the result of this generator will be null. For any other type of exception the exception will be thrown.public List<com.neurosys.spider.indexer.FieldGenerator<P,Void,com.neurosys.spider.ds.processors.ObjectDocumentRowMapperIndexer>> getFieldGenerators()
listForProductTransformer
public void setFieldGenerators(List<com.neurosys.spider.indexer.FieldGenerator<P,Void,com.neurosys.spider.ds.processors.ObjectDocumentRowMapperIndexer>> fieldGenerators)
listForProductTransformer
Copyright © 2018. All rights reserved.