use of org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler in project jackrabbit-oak by apache.
the class ElasticIndexImporterSupport method createElasticEditorProvider.
private IndexEditorProvider createElasticEditorProvider() {
final ElasticConnection.Builder.BuildStep buildStep = ElasticConnection.newBuilder().withIndexPrefix(indexPrefix).withConnectionParameters(scheme, host, port);
final ElasticConnection connection;
if (apiKeyId != null && apiSecretId != null) {
connection = buildStep.withApiKeys(apiKeyId, apiSecretId).build();
} else {
connection = buildStep.build();
}
closer.register(connection);
ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
ElasticIndexEditorProvider editorProvider = new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
return editorProvider;
}
use of org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler in project jackrabbit-oak by apache.
the class ElasticOutOfBandIndexer method createElasticEditorProvider.
private IndexEditorProvider createElasticEditorProvider() {
final ElasticConnection.Builder.BuildStep buildStep = ElasticConnection.newBuilder().withIndexPrefix(indexPrefix).withConnectionParameters(scheme, host, port);
final ElasticConnection connection;
if (apiKeyId != null && apiSecretId != null) {
connection = buildStep.withApiKeys(apiKeyId, apiSecretId).build();
} else {
connection = buildStep.build();
}
closer.register(connection);
ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
return new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
}
use of org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler 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);
}
use of org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler in project jackrabbit-oak by apache.
the class ElasticFacetSearchTest method createRepository.
@Override
protected Repository[] createRepository(RepositoryFixture fixture) throws Exception {
indexName = TestHelper.getUniqueIndexName("elasticFacetTest");
Map<String, Boolean> propMap = new LinkedHashMap<>();
propMap.put(SEARCH_PROP, false);
propMap.put(FACET_PROP_1, true);
propMap.put(FACET_PROP_2, true);
if (fixture instanceof OakRepositoryFixture) {
return ((OakRepositoryFixture) fixture).setUpCluster(1, oak -> {
ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
ElasticIndexEditorProvider editorProvider = new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
ElasticIndexProvider indexProvider = new ElasticIndexProvider(indexTracker);
oak.with(editorProvider).with(indexTracker).with(indexProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).with(new FacetIndexInitializer(indexName, propMap, ElasticIndexDefinition.TYPE_ELASTICSEARCH, getFacetMode()));
return new Jcr(oak);
});
}
return super.createRepository(fixture);
}
use of org.apache.jackrabbit.oak.plugins.index.elastic.ElasticMetricHandler in project jackrabbit-oak by apache.
the class ElasticPropertyFTSeparatedIndexedContentAvailability method createRepository.
@Override
protected Repository[] createRepository(RepositoryFixture fixture) throws Exception {
elasticGlobalIndexName = TestHelper.getUniqueIndexName("elasticGlobal");
elasticTitleIndexName = TestHelper.getUniqueIndexName("elasticTitle");
if (fixture instanceof OakRepositoryFixture) {
currentFixtureName = fixture.toString();
return ((OakRepositoryFixture) fixture).setUpCluster(1, oak -> {
ElasticIndexTracker indexTracker = new ElasticIndexTracker(connection, new ElasticMetricHandler(StatisticsProvider.NOOP));
ElasticIndexEditorProvider editorProvider = new ElasticIndexEditorProvider(indexTracker, connection, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
ElasticIndexProvider indexProvider = new ElasticIndexProvider(indexTracker);
oak.with(editorProvider).with(indexProvider).with(indexProvider).with((new ElasticGlobalInitializer(elasticGlobalIndexName, storageEnabled)).async("fulltext-async")).with(new FullTextPropertyInitialiser(elasticTitleIndexName, Collections.singleton("title"), ElasticIndexDefinition.TYPE_ELASTICSEARCH).async()).withAsyncIndexing("async", 5).withAsyncIndexing("fulltext-async", 5);
return new Jcr(oak);
});
}
return super.createRepository(fixture);
}
Aggregations