TitanManagement tm = titanGraph.getManagementSystem();
tm.buildIndex(Constants.INDEX_PREFIX + propertyName, Vertex.class).addKey(tm.makePropertyKey(propertyName).dataType(String.class).make()).buildMixedIndex("search");
Exception in thread "Thread-261" com.thinkaurelius.titan.core.SchemaViolationException: Adding this property for key [system%&%SchemaName] and value [rt%isp] violates a uniqueness constraint [SystemIndex#system%&%SchemaName]
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.addPropertyInternal(StandardTitanTx.java:740)
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.setProperty(StandardTitanTx.java:778)
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.addProperty(StandardTitanTx.java:696)
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.makeSchemaVertex(StandardTitanTx.java:815)
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.makePropertyKey(StandardTitanTx.java:835)
at com.thinkaurelius.titan.graphdb.types.StandardPropertyKeyMaker.make(StandardPropertyKeyMaker.java:78)
at com.xPatterns.spaTitan.runners.IndexCreator.run(IndexCreator.java:73)
at java.lang.Thread.run(Thread.java:745)
// Error that basically says that the key needs to be unique. Meaning that TitanManagement allready has a key created for the propertyName
tm.buildIndex(Constants.INDEX_PREFIX + propertyName, Vertex.class).addKey(tm.getPropertyKey(propertyName)).buildMixedIndex("search");
// AND
tm.buildIndex(Constants.INDEX_PREFIX + propertyName, Vertex.class).addKey(tm.getPropertyKey(propertyName),
com.thinkaurelius.titan.core.schema.Parameter.of("maping",Mapping.STRING)).buildMixedIndex("search");
Caused by: org.elasticsearch.index.mapper.MapperParsingException: No type specified for property [cwlh]
at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseProperties(ObjectMapper.java:282)
at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseObjectOrDocumentTypeProperties(ObjectMapper.java:214)
at org.elasticsearch.index.mapper.object.RootObjectMapper$TypeParser.parse(RootObjectMapper.java:136)
at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:211)
at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:192)
at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:434)
at org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:505)
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:365)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:188)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:158)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
// Basically data is stored as Object and elasticsearch has problems identifying a type. That is what I understood.
//===========================================================================================
tm.buildIndex(Constants.INDEX_PREFIX + propertyName, Vertex.class).addKey(tm.getOrCreatePropertyKey(propertyName),
Mapping.STRING.getParameter()).buildMixedIndex("search");
Exception in thread "Thread-235" java.lang.IllegalArgumentException: Specified illegal mapping [STRING] for data type [class java.lang.Object]
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:120)
at com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex.register(ElasticSearchIndex.java:362)
at com.thinkaurelius.titan.diskstorage.indexing.IndexTransaction.register(IndexTransaction.java:83)
at com.thinkaurelius.titan.graphdb.database.IndexSerializer.register(IndexSerializer.java:92)
at com.thinkaurelius.titan.graphdb.database.management.ManagementSystem.addIndexKey(ManagementSystem.java:534)
at com.thinkaurelius.titan.graphdb.database.management.ManagementSystem$IndexBuilder.buildMixedIndex(ManagementSystem.java:647)
at com.xPatterns.spaTitan.runners.IndexCreator.run(IndexCreator.java:74)
at java.lang.Thread.run(Thread.java:745)
// If I specified a type it now says that it can't basically cast current Object type to String
//============================================================================================
Am I missing something?
Is there any way to create a mixed index over data/fields in Titan 0.5.4?
If no is there a way to index existing data in Titan 1.0
Kind regards,
Cosmin U.