<p dir="auto">I came across a rather weird issue which seems to be some kind of race condition on indexing a property and I'd appreciate if you could first confirm if you can reproduce it, and then fix it and/or recommend a workaround.</p>
<ul dir="auto">
<li>Neo4j version: 3.0.1</li>
<li>Operating system: Windows 8.1</li>
<li>API/Driver: embedded GraphDatabaseService, but this happens also with in-memory instance used for tests</li>
<li>Steps to reproduce<br>
please find the following code snippet that shows the problem (at least on my machine it fails virtually every time)<br>
<a href="https://gist.github.com/lilianaziolek/81b1adcdb2c9b3f1c0812952da51cfa9">https://gist.github.com/lilianaziolek/81b1adcdb2c9b3f1c0812952da51cfa9</a><br>
The problem goes away if I either remove index (which results in a label-scan on search so obviously not a great idea) or introduce a sleep before the reading step. I tried adding the "await for indexes" as you can see, but that doesn't seem to help either.-It seems that after adding the nodes the index isn't updated on time but instead it's updated with an unknown (quite significant) delay.</li>
<li>Expected/actual behavior<br>
I would expect correct result of 3 nodes - either by using index or, in the worst case, a slower result from a scan. Instead I get back all the nodes unless I introduce a sleep.</li>
</ul>
<p dir="auto">If I missed some step that would enforce the update of the index please let me know - but I tried looking in the documentation and haven't found anything that would imply that anything special needs to be done for index to be updated within the writing transaction.</p>
<p dir="auto">Hello,</p>
<p dir="auto">I've been finding that using a regex in where clause for matching is initially matching every node.</p>
<p dir="auto">So for the a database with nodes with a <code class="notranslate">label</code> property, something like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="MATCH (n) WHERE n.label =~ '(?i)cat' RETURN n"><pre class="notranslate"><code class="notranslate">MATCH (n) WHERE n.label =~ '(?i)cat' RETURN n
</code></pre></div>
<p dir="auto">Returns every node.  It's been consistently working once a database has been up and running, but usually the first couple of runs of such a query will return all nodes.  I'm not sure what changes eventually to make the same query work.</p>
<p dir="auto">It looks like regex clauses for other properties besides <code class="notranslate">label</code> are working just fine, so maybe that's the issue?</p>
<p dir="auto"><strong>Neo4j Version:</strong> 3.0.0<br>
<strong>Operating System:</strong> Windows 10, but also found on Travis CI (Ubuntu 12.04)</p>
<h3 dir="auto">Steps to reproduce</h3>
<ol dir="auto">
<li>Start with a fresh database</li>
<li>Populate with some nodes with various <code class="notranslate">label</code> properties</li>
<li>Run regex matching query on node's <code class="notranslate">label</code> property</li>
</ol>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Only nodes that match the regex should be returned</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">All nodes are returned for the first few queries, but eventually (sometimes) the expected behavior happens</p>