Reputation: 47911
Can I use the power tool console in the neo4j admin to create a compound index after the objects have been created? I currently add a node than add it's "name" property to an "Apps" index. Now I also want to create a "platform" and "storeId" compound index as well. BTW, should I add that to the same Apps index or create a new index.
Upvotes: 1
Views: 595
Reputation: 41706
Of course you can create new indexes and also add existing nodes through the console.
Most sensibly by executing a script fragment, see the console online manual and issue help index
the console.
So either use something like this:
index -q Apps "name:*" -c cd -a $i && index -i Apps storeId
Otherwise use eval to evaluate a javascript fragment:
eval
index=db.index().forNodes("Apps")
nodes=index.query("name:*")
while ( nodes.hasNext() ) {
node=nodes.next()
index.add(node,"storeId",node.getProperty("storeId"))
}
Upvotes: 1