Search in sources :

Example 1 with FulltextBinaryTextExtractor

use of org.apache.jackrabbit.oak.plugins.index.search.spi.binary.FulltextBinaryTextExtractor in project jackrabbit-oak by apache.

the class ElasticIndexerProvider method getIndexer.

@Override
@Nullable
public NodeStateIndexer getIndexer(@NotNull String type, @NotNull String indexPath, @NotNull NodeBuilder definition, @NotNull NodeState root, IndexingProgressReporter progressReporter) {
    if (!ElasticIndexDefinition.TYPE_ELASTICSEARCH.equals(definition.getString(TYPE_PROPERTY_NAME))) {
        return null;
    }
    ElasticIndexDefinition idxDefinition = (ElasticIndexDefinition) new ElasticIndexDefinition.Builder(connection.getIndexPrefix()).root(root).indexPath(indexPath).defn(definition.getNodeState()).reindex().build();
    FulltextIndexWriter<ElasticDocument> indexWriter = indexWriterFactory.newInstance(idxDefinition, definition, CommitInfo.EMPTY, true);
    FulltextBinaryTextExtractor textExtractor = new FulltextBinaryTextExtractor(textCache, idxDefinition, true);
    ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
    ElasticIndexEditorProvider elasticIndexEditorProvider = new ElasticIndexEditorProvider(indexTracker, connection, null);
    return new ElasticIndexer(idxDefinition, textExtractor, definition, progressReporter, indexWriter, elasticIndexEditorProvider, indexHelper);
}
Also used : FulltextBinaryTextExtractor(org.apache.jackrabbit.oak.plugins.index.search.spi.binary.FulltextBinaryTextExtractor) ElasticDocument(org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticDocument) ElasticIndexTracker(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexTracker) NodeBuilder(org.apache.jackrabbit.oak.spi.state.NodeBuilder) ElasticMetricHandler(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler) ElasticIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticIndexEditorProvider) ElasticIndexDefinition(org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexDefinition) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with FulltextBinaryTextExtractor

use of org.apache.jackrabbit.oak.plugins.index.search.spi.binary.FulltextBinaryTextExtractor in project jackrabbit-oak by apache.

the class LuceneIndexerProvider method getIndexer.

@Override
public NodeStateIndexer getIndexer(@NotNull String type, @NotNull String indexPath, @NotNull NodeBuilder definition, @NotNull NodeState root, IndexingProgressReporter progressReporter) {
    if (!TYPE_LUCENE.equals(definition.getString(TYPE_PROPERTY_NAME))) {
        return null;
    }
    LuceneIndexDefinition idxDefinition = LuceneIndexDefinition.newBuilder(root, definition.getNodeState(), indexPath).reindex().build();
    LuceneIndexWriter indexWriter = indexWriterFactory.newInstance(idxDefinition, definition, null, true);
    FulltextBinaryTextExtractor textExtractor = new FulltextBinaryTextExtractor(textCache, idxDefinition, true);
    return new LuceneIndexer(idxDefinition, indexWriter, definition, textExtractor, progressReporter);
}
Also used : FulltextBinaryTextExtractor(org.apache.jackrabbit.oak.plugins.index.search.spi.binary.FulltextBinaryTextExtractor) LuceneIndexWriter(org.apache.jackrabbit.oak.plugins.index.lucene.writer.LuceneIndexWriter) LuceneIndexDefinition(org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexDefinition)

Aggregations

FulltextBinaryTextExtractor (org.apache.jackrabbit.oak.plugins.index.search.spi.binary.FulltextBinaryTextExtractor)2 ElasticIndexDefinition (org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexDefinition)1 ElasticIndexTracker (org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexTracker)1 ElasticMetricHandler (org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler)1 ElasticDocument (org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticDocument)1 ElasticIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.elastic.index.ElasticIndexEditorProvider)1 LuceneIndexDefinition (org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexDefinition)1 LuceneIndexWriter (org.apache.jackrabbit.oak.plugins.index.lucene.writer.LuceneIndexWriter)1 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)1 Nullable (org.jetbrains.annotations.Nullable)1