Skip to content

Commit

Permalink
Implements ValueCapability for GenericNativeIndexProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Sep 24, 2018
1 parent e621c06 commit 6d48b06
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
*/
public class GenericNativeIndexProvider extends NativeIndexProvider<CompositeGenericKey,NativeIndexValue,GenericLayout>
{
public static final GraphDatabaseSettings.SchemaIndex SCHEMA_INDEX = GraphDatabaseSettings.SchemaIndex.NATIVE_BTREE10;
static final GraphDatabaseSettings.SchemaIndex SCHEMA_INDEX = GraphDatabaseSettings.SchemaIndex.NATIVE_BTREE10;
public static final String KEY = SCHEMA_INDEX.providerName();
public static final IndexProviderDescriptor DESCRIPTOR = new IndexProviderDescriptor( KEY, SCHEMA_INDEX.providerVersion() );
public static final IndexCapability CAPABILITY = new GenericIndexCapability();
Expand Down Expand Up @@ -171,7 +171,6 @@ public IndexCapability getCapability()
return CAPABILITY;
}

// TODO implement valueCapability
private static class GenericIndexCapability implements IndexCapability
{
@Override
Expand All @@ -187,7 +186,18 @@ public IndexOrder[] orderCapability( ValueCategory... valueCategories )
@Override
public IndexValueCapability valueCapability( ValueCategory... valueCategories )
{
return null;
for ( ValueCategory valueCategory : valueCategories )
{
if ( valueCategory == ValueCategory.GEOMETRY || valueCategory == ValueCategory.GEOMETRY_ARRAY )
{
return IndexValueCapability.NO;
}
if ( valueCategory == ValueCategory.UNKNOWN )
{
return IndexValueCapability.PARTIAL;
}
}
return IndexValueCapability.YES;
}

private boolean supportOrdering( ValueCategory[] valueCategories )
Expand Down

0 comments on commit 6d48b06

Please sign in to comment.