Re: No results returned with duplicate Has steps in a vertex-search traversal

Boxuan Li

Just created a simple test case but couldn’t reproduce:

public void testDuplicateMixedIndexQuery() {
final PropertyKey name = makeKey("name", String.class);
final PropertyKey prop = makeKey("prop", String.class);
mgmt.buildIndex("mixed", Vertex.class).addKey(name, Mapping.STRING.asParameter()).buildMixedIndex(INDEX);
mgmt.buildIndex("mixed2", Vertex.class).addKey(prop, Mapping.STRING.asParameter()).buildMixedIndex(INDEX);

tx.addVertex("name", "bob", "prop", "val");

clopen(option(FORCE_INDEX_USAGE), true);
assertTrue(tx.traversal().V().has("prop", "val").has("name", P.within("bob","alice")).hasNext());
assertTrue(tx.traversal().V().has("prop", "val").has("name", P.within("bob","alice")).has("name", P.within("bob","alice")).hasNext());

Would it be possible for you to narrow down the scope, e.g. removing other “has” steps in your query? It would be helpful if you could write a piece of minimal reproducible test code.

On Feb 4, 2021, at 3:43 AM, Patrick Streifel <prstreifel@...> wrote:


We have a mixed Elasticsearch index that indexes every vertex property on our graph. 
For the above example, all of the fields are indexed as a "keyword" string in Elasticsearch. 
We sometimes get inconsistent behavior. For example if instead of querying by two keyword fields (FullName and PersonSurName), I instead query by one field with a "keyword" mapping type and another with a "text" mapping type, I get the desired result back. 
Again, I can see in the logs the correct records being returned by our Elasticsearch index, regardless of the example. It's just not getting returned by JanusGraph after that.
We have no composite indices on our graph. 


Join { to automatically receive all group messages.