Commit bb3022b8 by Suma S

Merge pull request #75 from shwethags/master

fixed - boolean backend index is not supported
parents 01ee72a3 2c65ac46
...@@ -31,7 +31,7 @@ hive conf directory: ...@@ -31,7 +31,7 @@ hive conf directory:
</property> </property>
</verbatim> </verbatim>
Usage: <dgi package>/bin/import-hive.sh Usage: <dgi package>/bin/import-hive.sh. The logs are in <dgi package>/logs/import-hive.log
---++ Hive Hook ---++ Hive Hook
......
...@@ -73,7 +73,7 @@ public class GraphBackedDiscoveryService implements DiscoveryService { ...@@ -73,7 +73,7 @@ public class GraphBackedDiscoveryService implements DiscoveryService {
this.graphPersistenceStrategy = new DefaultGraphPersistenceStrategy(metadataRepository); this.graphPersistenceStrategy = new DefaultGraphPersistenceStrategy(metadataRepository);
} }
//Refer http://s3.thinkaurelius.com/docs/titan/0.5.0/index-backends.html for indexed query //Refer http://s3.thinkaurelius.com/docs/titan/0.5.4/index-backends.html for indexed query
//http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query //http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query
// .html#query-string-syntax for query syntax // .html#query-string-syntax for query syntax
@Override @Override
......
...@@ -314,9 +314,16 @@ public class GraphBackedSearchIndexer implements SearchIndexer { ...@@ -314,9 +314,16 @@ public class GraphBackedSearchIndexer implements SearchIndexer {
.dataType(propertyClass) .dataType(propertyClass)
.make(); .make();
if (propertyClass == Boolean.class) {
//Use standard index as backing index only supports string, int and geo types
management.buildIndex(propertyName, Vertex.class).addKey(propertyKey).buildCompositeIndex();
management.commit();
} else {
//Use backing index
TitanGraphIndex vertexIndex = management.getGraphIndex(Constants.VERTEX_INDEX); TitanGraphIndex vertexIndex = management.getGraphIndex(Constants.VERTEX_INDEX);
management.addIndexKey(vertexIndex, propertyKey); management.addIndexKey(vertexIndex, propertyKey);
management.commit(); management.commit();
}
LOG.info("Created mixed vertex index for property {}", propertyName); LOG.info("Created mixed vertex index for property {}", propertyName);
} }
......
...@@ -410,7 +410,9 @@ public class EntityJerseyResourceIT extends BaseResourceIT { ...@@ -410,7 +410,9 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
new AttributeDefinition("serde2", new AttributeDefinition("serde2",
"serdeType", Multiplicity.REQUIRED, false, null), "serdeType", Multiplicity.REQUIRED, false, null),
new AttributeDefinition("database", new AttributeDefinition("database",
DATABASE_TYPE, Multiplicity.REQUIRED, true, null)); DATABASE_TYPE, Multiplicity.REQUIRED, true, null),
new AttributeDefinition("compressed",
DataTypes.BOOLEAN_TYPE.getName(), Multiplicity.OPTIONAL, true, null));
HierarchicalTypeDefinition<TraitType> classificationTraitDefinition = HierarchicalTypeDefinition<TraitType> classificationTraitDefinition =
TypesUtil.createTraitTypeDef("classification", TypesUtil.createTraitTypeDef("classification",
...@@ -451,6 +453,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT { ...@@ -451,6 +453,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
tableInstance.set("level", 2); tableInstance.set("level", 2);
tableInstance.set("tableType", 1); // enum tableInstance.set("tableType", 1); // enum
tableInstance.set("database", databaseInstance); tableInstance.set("database", databaseInstance);
tableInstance.set("compressed", false);
Struct traitInstance = (Struct) tableInstance.getTrait("classification"); Struct traitInstance = (Struct) tableInstance.getTrait("classification");
traitInstance.set("tag", "foundation_etl"); traitInstance.set("tag", "foundation_etl");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment