Search in sources :

Example 81 with PropertyKey

use of com.thinkaurelius.titan.core.PropertyKey in project incubator-atlas by apache.

the class Titan1GraphManagement method createExactMatchVertexIndex.

public void createExactMatchVertexIndex(String propertyName, boolean enforceUniqueness, List<AtlasPropertyKey> propertyKeys) {
    TitanManagement.IndexBuilder indexBuilder = management.buildIndex(propertyName, Vertex.class);
    for (AtlasPropertyKey key : propertyKeys) {
        PropertyKey titanKey = TitanObjectFactory.createPropertyKey(key);
        indexBuilder.addKey(titanKey);
    }
    if (enforceUniqueness) {
        indexBuilder.unique();
    }
    indexBuilder.buildCompositeIndex();
}
Also used : AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) TitanManagement(com.thinkaurelius.titan.core.schema.TitanManagement) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(com.thinkaurelius.titan.core.PropertyKey)

Example 82 with PropertyKey

use of com.thinkaurelius.titan.core.PropertyKey in project incubator-atlas by apache.

the class Titan1GraphManagement method createFullTextIndex.

@Override
public void createFullTextIndex(String indexName, AtlasPropertyKey propertyKey, String backingIndex) {
    PropertyKey fullText = TitanObjectFactory.createPropertyKey(propertyKey);
    management.buildIndex(indexName, Vertex.class).addKey(fullText, com.thinkaurelius.titan.core.schema.Parameter.of("mapping", Mapping.TEXT)).buildMixedIndex(backingIndex);
}
Also used : AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(com.thinkaurelius.titan.core.PropertyKey)

Aggregations

PropertyKey (com.thinkaurelius.titan.core.PropertyKey)82 TitanVertex (com.thinkaurelius.titan.core.TitanVertex)44 Test (org.junit.Test)44 TitanGraphIndex (com.thinkaurelius.titan.core.schema.TitanGraphIndex)22 AtlasPropertyKey (org.apache.atlas.repository.graphdb.AtlasPropertyKey)20 EdgeLabel (com.thinkaurelius.titan.core.EdgeLabel)19 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)17 TitanManagement (com.thinkaurelius.titan.core.schema.TitanManagement)14 TitanEdge (com.thinkaurelius.titan.core.TitanEdge)11 TitanTransaction (com.thinkaurelius.titan.core.TitanTransaction)11 VertexLabel (com.thinkaurelius.titan.core.VertexLabel)11 Edge (org.apache.tinkerpop.gremlin.structure.Edge)11 TitanVertexProperty (com.thinkaurelius.titan.core.TitanVertexProperty)9 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)9 BaseVertexLabel (com.thinkaurelius.titan.graphdb.types.system.BaseVertexLabel)8 RelationTypeIndex (com.thinkaurelius.titan.core.schema.RelationTypeIndex)7 HashSet (java.util.HashSet)7 TitanException (com.thinkaurelius.titan.core.TitanException)6 Cardinality (com.thinkaurelius.titan.core.Cardinality)5 Instant (java.time.Instant)5