How to delete the property index from mixed index. #2676
Unanswered
LoverAndrew
asked this question in
Q&A
Replies: 1 comment 2 replies
-
When property deleted from schema it is deleted from index too
gremlin> graph = JanusGraphFactory.build().
......1> set("storage.backend","berkeleyje").
......2> set("storage.directory","/tmp/graph").
......3> set("index.search.backend","lucene").
......4> set("index.search.directory","/tmp/graph").
......5> open()
==>standardjanusgraph[berkeleyje:/tmp/graph]
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@12e3f4ae
gremlin> p1 = mgmt.makePropertyKey('p1').cardinality(Cardinality.SINGLE).dataType(String.class).make()
==>p1
gremlin> p2 = mgmt.makePropertyKey('p2').cardinality(Cardinality.SINGLE).dataType(String.class).make()
==>p2
gremlin> mgmt.buildIndex("idx", Vertex.class).addKey(p1, Mapping.STRING.asParameter()).addKey(p2, Mapping.STRING.asParameter()).buildMixedIndex("search")
==>idx
gremlin> mgmt.printIndexes()
==>------------------------------------------------------------------------------------------------
Graph Index (Vertex) | Type | Unique | Backing | Key: Status |
---------------------------------------------------------------------------------------------------
idx | Mixed | false | search | p1: ENABLED |
| | | | p2: ENABLED |
---------------------------------------------------------------------------------------------------
Graph Index (Edge) | Type | Unique | Backing | Key: Status |
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
Relation Index (VCI) | Type | Direction | Sort Key | Order | Status |
---------------------------------------------------------------------------------------------------
gremlin> mgmt.printPropertyKeys()
==>------------------------------------------------------------------------------------------------
Property Key Name | Cardinality | Data Type |
---------------------------------------------------------------------------------------------------
p1 | SINGLE | class java.lang.String |
p2 | SINGLE | class java.lang.String |
---------------------------------------------------------------------------------------------------
gremlin> mgmt.commit();
==>null
gremlin>
gremlin> // But mixed index should be dropped manually and any vertices with this property
==>true
gremlin>
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@60861e5d
gremlin> p1 = mgmt.getOrCreatePropertyKey('p1')
==>p1
gremlin> p1.remove()
==>null
gremlin> mgmt.commit();
==>null
gremlin>
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@7131d668
gremlin> mgmt.printPropertyKeys()
==>------------------------------------------------------------------------------------------------
Property Key Name | Cardinality | Data Type |
---------------------------------------------------------------------------------------------------
p2 | SINGLE | class java.lang.String |
---------------------------------------------------------------------------------------------------
gremlin> mgmt.printIndexes()
==>------------------------------------------------------------------------------------------------
Graph Index (Vertex) | Type | Unique | Backing | Key: Status |
---------------------------------------------------------------------------------------------------
idx | Mixed | false | search | p2: ENABLED |
---------------------------------------------------------------------------------------------------
Graph Index (Edge) | Type | Unique | Backing | Key: Status |
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
Relation Index (VCI) | Type | Direction | Sort Key | Order | Status |
---------------------------------------------------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example, how to delete "del_full_text_20210610" from vertex_idx manually.
Beta Was this translation helpful? Give feedback.
All reactions