Search in sources :

Example 1 with ElasticDocumentMaker

use of org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticDocumentMaker in project jackrabbit-oak by apache.

the class ElasticIndexer method index.

@Override
public boolean index(NodeStateEntry entry) throws IOException, CommitFailedException {
    if (getFilterResult(entry.getPath()) != PathFilter.Result.INCLUDE) {
        return false;
    }
    IndexDefinition.IndexingRule indexingRule = definition.getApplicableIndexingRule(entry.getNodeState());
    if (indexingRule == null) {
        return false;
    }
    ElasticDocumentMaker maker = newDocumentMaker(indexingRule, entry.getPath());
    ElasticDocument doc = maker.makeDocument(entry.getNodeState());
    if (doc != null) {
        writeToIndex(doc, entry.getPath());
        progressReporter.indexUpdate(definition.getIndexPath());
        return true;
    }
    return false;
}
Also used : IndexDefinition(org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition) ElasticDocument(org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticDocument) ElasticDocumentMaker(org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticDocumentMaker)

Aggregations

ElasticDocument (org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticDocument)1 ElasticDocumentMaker (org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticDocumentMaker)1 IndexDefinition (org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition)1