title: using an array index from the embedded api in neo4j
body: <p>Is there a way of using an array index from the embedded api  ? I can't find anything beyond what is listed in the <a href="http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-new-index.html" rel="nofollow">embedded index tutorial</a>. I can use the index from cypher fine.</p>
  
  <p>For reference, this does not work.</p>
  
  <pre><code>  val res = db.findNodesByLabelAndProperty(LNode,"etag","NP").iterator()
  </code></pre>
  
  <p><strong>edit</strong> </p>
  
  <p>Ok direct 1:1 array comparisons work. But i'm after "value in Array" semantics.</p>
  
  <p><strong>edit 2: Can't seem to search index via legacy API. Am I doing something wrong ? (see comment below)</strong></p>
  
  <pre><code>    val db_loc = "/usr/local/Cellar/neo4j/2.0.0/libexec/data/graph.db"
      val inserter = BatchInserters.inserter(db_loc)
  
          try {
  
              val LNode = DynamicLabel.label("LNode")
              val ELNode = DynamicLabel.label("ENode")
              val SNode = DynamicLabel.label("sNode")
              val ESNode = DynamicLabel.label("ESNode")
              val SentenceL = DynamicLabel.label("Sentence")
  
  
              val nodeToNode = DynamicRelationshipType.withName("nodeToNode")
              val leafToNode = DynamicRelationshipType.withName("leafToNode")
  
              // Lots of code to populate gigantic database 
  
              inserter.createDeferredSchemaIndex(LNode).on("etok").create()
              inserter.createDeferredSchemaIndex(LNode).on("etag").create()
              inserter.createDeferredSchemaIndex(ESNode).on("etok").create()
              inserter.createDeferredSchemaIndex(ESNode).on("etag").create()
              }
              finally
                  inserter.shutdown()
  </code></pre>
  
  <p><strong>edit3</strong></p>
  
  <p>I give up with neo4j, not being able to index arrays is a deal breaker. Onto orientdb. After a bit of reading it seems much better designed and <strong>MUCH BETTER DOCUMENTED</strong>.</p>
  
  <p><strong>edit4</strong></p>
  
  <p>Ok Back to neo4j, OrientDB is very immature. The documentation and wiki are well written and fleshed out. But the API has weird undocumented semantics with lots of corner cases. This is generally ok , but the exceptions are hard to make sense of, and no sensible logs come out of logging system to aid in the process.</p>
  
  <p>Neo4j has a simpler architecture and API that just worked without any corner cases, it's also simpler to use in embedded mode. I'll just dig deeper and find a way to fit my modelling needs.</p>