use of org.neo4j.internal.schema.IndexConfig in project neo4j by neo4j.
the class SchemaStatementProcedure method fulltextConfigAsString.
private static String fulltextConfigAsString(IndexDescriptor indexDescriptor) {
final IndexConfig indexConfig = indexDescriptor.getIndexConfig();
StringJoiner configString = configStringJoiner();
for (Pair<String, Value> entry : indexConfig.entries()) {
String key = entry.getOne();
String singleConfig = format(SINGLE_CONFIG, key, fulltextConfigValueAsString(entry.getTwo()));
configString.add(singleConfig);
}
return configString.toString();
}
use of org.neo4j.internal.schema.IndexConfig in project neo4j by neo4j.
the class SchemaStatementProcedure method btreeConfigAsString.
private static String btreeConfigAsString(IndexDescriptor indexDescriptor) {
final IndexConfig indexConfig = indexDescriptor.getIndexConfig();
StringJoiner configString = configStringJoiner();
for (Pair<String, Value> entry : indexConfig.entries()) {
String singleConfig = format(SINGLE_CONFIG, entry.getOne(), btreeConfigValueAsString(entry.getTwo()));
configString.add(singleConfig);
}
return configString.toString();
}
use of org.neo4j.internal.schema.IndexConfig in project neo4j by neo4j.
the class IndexProcedures method createIndex.
private Stream<BuiltInProcedures.SchemaIndexInfo> createIndex(String name, List<String> labels, List<String> properties, IndexProviderDescriptor indexProviderDescriptor, Map<String, Object> configMap, String statusMessage, IndexCreator indexCreator) throws ProcedureException {
IndexConfig indexConfig = IndexSettingUtil.toIndexConfigFromStringObjectMap(configMap);
assertSingleLabel(labels);
assertValidIndexProvider(indexProviderDescriptor);
int labelId = getOrCreateLabelId(labels.get(0));
int[] propertyKeyIds = getOrCreatePropertyIds(properties);
try {
SchemaWrite schemaWrite = ktx.schemaWrite();
LabelSchemaDescriptor labelSchemaDescriptor = SchemaDescriptor.forLabel(labelId, propertyKeyIds);
indexCreator.create(schemaWrite, name, labelSchemaDescriptor, indexProviderDescriptor, indexConfig);
return Stream.of(new BuiltInProcedures.SchemaIndexInfo(name, labels, properties, indexProviderDescriptor.name(), statusMessage));
} catch (KernelException e) {
throw new ProcedureException(e.status(), e, e.getMessage());
}
}
use of org.neo4j.internal.schema.IndexConfig in project neo4j by neo4j.
the class FulltextIndexProvider method completeConfiguration.
@Override
public IndexDescriptor completeConfiguration(IndexDescriptor index) {
IndexConfig indexConfig = index.getIndexConfig();
indexConfig = addMissingDefaultIndexConfig(indexConfig);
index = index.withIndexConfig(indexConfig);
if (index.getCapability().equals(IndexCapability.NO_CAPABILITY)) {
index = index.withIndexCapability(getCapability(index));
}
return index;
}
use of org.neo4j.internal.schema.IndexConfig in project neo4j by neo4j.
the class GenericNativeIndexProvider method layout.
@Override
GenericLayout layout(IndexDescriptor descriptor, Path storeFile) {
int numberOfSlots = descriptor.schema().getPropertyIds().length;
IndexConfig indexConfig = descriptor.getIndexConfig();
Map<CoordinateReferenceSystem, SpaceFillingCurveSettings> settings = SpatialIndexConfig.extractSpatialConfig(indexConfig);
return new GenericLayout(numberOfSlots, new IndexSpecificSpaceFillingCurveSettings(settings));
}
Aggregations