Collection<IndexSchemaField> fields = this.schema.getFields();
GDataIndexDocument document = new GDataIndexDocument(this.action,
this.entry.getId(),this.entry.getFeedId(), this.commitAfter,this.optimizeAfter);
if(this.action != IndexAction.DELETE){
int addedFields = 0;
for (IndexSchemaField field : fields) {
/*
* get the strategy to process the field
*/
ContentStrategy strategy = ContentStrategy.getFieldStrategy(field);
if (LOG.isInfoEnabled())
LOG.info("Process indexable for " + field);
try {
/*
* get the indexable via the factory method to enable new /
* different implementation of the interface (this could be a
* faster dom impl e.g. dom4j)
*/
strategy.processIndexable(Indexable.getIndexable(this.entry));
addedFields++;
} catch (NotIndexableException e) {
LOG.warn("Can not create field for " + field+" field will be skipped -- reason: ", e);
continue;
}
document.addField(strategy);
}
if(addedFields == 0)
throw new GdataIndexerException("No field added to document for Schema: "+this.schema);
}
return (T)document;