The problem in the end was that you had a space in the "fulltext " index configuration which caused Neo4j not being able to locate the correct type of index.
Please use the constants defined in LuceneIndexImplementation for refering to the index.
Also operations on the index results must happen after tx.finish(), aka after the batch-rest-operation returned.
See below.
public static void main( String[] args ) throws java.io.IOException, URISyntaxException
{
setup();
Transaction tx = graphDb.beginTx();
Node geneNode = null;
// there was a SPACE in the index-type, dammit
// RestIndex<Node> index = graphDb.index().forNodes( "genefull", MapUtil.stringMap( IndexManager.PROVIDER, "lucene", "type", "fulltext_ _" ) );
// use the constants
RestIndex<Node> index = graphDb.index().forNodes("genefull", LuceneIndexImplementation.FULLTEXT_CONFIG);
try
{
geneNode = graphDb.createNode();
index.add( geneNode, "geneid", "gene" );
tx.success();
}
catch ( Exception e )
{
System.out.println( "exception caught" + e.toString() );
e.printStackTrace();
}
finally
{
System.out.println( "finally" );
tx.finish();
System.out.println( "came out of finally" );
}
IndexHits<Node> hits = index.get("geneid", "gene");
int num = hits.size();
System.out.println( "num = " + num );
assert num == 1;
assert geneNode.equals( hits.getSingle() );
}