Multiple indexes for the same property key with different label constraints


Peter Schwarz <kkup...@...>
 

Thank you, your suggestion provided me with the clues to a solution.  This is how I do things now:

1st tx: create any necessary property keys and build the index. Commit
2ndtx: Inspect the status of each key field.  If any key is in the INSTALLED state, call updateIndex with the REGISTER_INDEX action.  Commit.  You only need to do this for one key per index.
Wait for the index to get to the REGISTERED state
Third tx: (or 2nd, if no key was in the INSTALLED state): Call updtaeIndex with the ENABLE_INDEX action.  Commit.
Wait for the index to get to the ENABLED state.

What I find is that keys are ENABLED immediately if they have never been used in another index.  But if they have been, the registration and enable steps must be explicit, and in separate management transactions.  I don't believe a REINDEX is necessary, but to be honest I have not tested that as yet.  This whole ting would be a lot simpler if the documentation was more complete and clear.

I'm still on 0.1.1, but I should probably upgrade sometime soon.


On Friday, August 11, 2017 at 3:49:27 PM UTC-7, Robert Dale wrote:
You can do that. I create each index in separate transactions.  I push the `awaitGraphIndexStatus` to a thread pool so subsequent indexes can be created. Then after all that, I loop through and ENABLE each index in one transaction. Also, I would consider using 0.2-SNAPSHOT from master as there has been some index related work there. But there's still a lot of work to be done for index management IMO.

Robert Dale

On Fri, Aug 11, 2017 at 11:00 AM, Peter Schwarz <kk...@...> wrote:
I think the root of my problems is that I am trying to create two indexes on the same property key, but with different label constraints on the vertices.  This seemed like a very natural and useful thing to do.  Is it supported (for either composite or mixed indexes)?  I am using cassandra for storage and elasticsearch as my mixed index backend,

On Wednesday, August 9, 2017 at 5:52:55 PM UTC-7, Peter Schwarz wrote:
I'm trying to add a mixed index with one key to an existing graph.  After building the index, I do a commit on the JanusGraphManagement, and then awaitGraphIndexStatus(graph, mykey).call().  The resulting report says the index is REGISTERED, but if I look inside the report success=false and my key is in the "notConverged" collection, marked "INSTALLED".  Subsequent attempts to enable the index are not successful.  The key also shows up as INSTALLED if I look at what is returned from getGraphIndexes.  What does it mean for a key to be "notConverged", and what might I be doing wrong?  I've tried to follow the procedure in the documentation fairly carefully.

--
You received this message because you are subscribed to the Google Groups "JanusGraph users list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Robert Dale <rob...@...>
 

You can do that. I create each index in separate transactions.  I push the `awaitGraphIndexStatus` to a thread pool so subsequent indexes can be created. Then after all that, I loop through and ENABLE each index in one transaction. Also, I would consider using 0.2-SNAPSHOT from master as there has been some index related work there. But there's still a lot of work to be done for index management IMO.

Robert Dale

On Fri, Aug 11, 2017 at 11:00 AM, Peter Schwarz <kkup...@...> wrote:
I think the root of my problems is that I am trying to create two indexes on the same property key, but with different label constraints on the vertices.  This seemed like a very natural and useful thing to do.  Is it supported (for either composite or mixed indexes)?  I am using cassandra for storage and elasticsearch as my mixed index backend,

On Wednesday, August 9, 2017 at 5:52:55 PM UTC-7, Peter Schwarz wrote:
I'm trying to add a mixed index with one key to an existing graph.  After building the index, I do a commit on the JanusGraphManagement, and then awaitGraphIndexStatus(graph, mykey).call().  The resulting report says the index is REGISTERED, but if I look inside the report success=false and my key is in the "notConverged" collection, marked "INSTALLED".  Subsequent attempts to enable the index are not successful.  The key also shows up as INSTALLED if I look at what is returned from getGraphIndexes.  What does it mean for a key to be "notConverged", and what might I be doing wrong?  I've tried to follow the procedure in the documentation fairly carefully.

--
You received this message because you are subscribed to the Google Groups "JanusGraph users list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Peter Schwarz <kkup...@...>
 

I think the root of my problems is that I am trying to create two indexes on the same property key, but with different label constraints on the vertices.  This seemed like a very natural and useful thing to do.  Is it supported (for either composite or mixed indexes)?  I am using cassandra for storage and elasticsearch as my mixed index backend,


On Wednesday, August 9, 2017 at 5:52:55 PM UTC-7, Peter Schwarz wrote:
I'm trying to add a mixed index with one key to an existing graph.  After building the index, I do a commit on the JanusGraphManagement, and then awaitGraphIndexStatus(graph, mykey).call().  The resulting report says the index is REGISTERED, but if I look inside the report success=false and my key is in the "notConverged" collection, marked "INSTALLED".  Subsequent attempts to enable the index are not successful.  The key also shows up as INSTALLED if I look at what is returned from getGraphIndexes.  What does it mean for a key to be "notConverged", and what might I be doing wrong?  I've tried to follow the procedure in the documentation fairly carefully.