use of org.neo4j.values.storable.BooleanValue in project neo4j by neo4j.
the class FulltextConfigExtractor method indexConfigFromFulltextDirectory.
static IndexConfig indexConfigFromFulltextDirectory(FileSystemAbstraction fs, Path fulltextIndexDirectory) {
Path settingsFile = fulltextIndexDirectory.resolve(INDEX_CONFIG_FILE);
Properties settings = new Properties();
if (fs.fileExists(settingsFile)) {
try (Reader reader = fs.openAsReader(settingsFile, UTF_8)) {
settings.load(reader);
} catch (IOException e) {
throw new UncheckedIOException("Failed to read persisted fulltext index properties: " + settingsFile, e);
}
}
Map<String, Value> indexConfig = new HashMap<>();
TextValue analyser = extractSetting(settings, INDEX_CONFIG_ANALYZER);
BooleanValue eventuallyConsistent = extractBooleanSetting(settings, INDEX_CONFIG_EVENTUALLY_CONSISTENT);
if (analyser != null) {
indexConfig.put(FulltextIndexSettingsKeys.ANALYZER, analyser);
}
if (eventuallyConsistent != null) {
indexConfig.put(FulltextIndexSettingsKeys.EVENTUALLY_CONSISTENT, eventuallyConsistent);
}
return IndexConfig.with(indexConfig);
}
use of org.neo4j.values.storable.BooleanValue in project neo4j by neo4j.
the class IndexSettingUtilTest method assertBoolean.
private static void assertBoolean(IndexSetting setting, Object object, boolean expectedResult) {
Value result = IndexSettingUtil.asIndexSettingValue(setting, object);
assertTrue(result instanceof BooleanValue);
assertEquals(expectedResult, ((BooleanValue) result).booleanValue());
}
Aggregations