Character case behaviour different with or without indices


ni...@...
 

This is odd behaviour in janusgraph.

If we have a user with a property, say Robert, we can't find him with a search for "Rob" but we can with a search for "rob".
 
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@793cef95
i
= mgmt.getGraphIndex('userStringKey')
==>userStringKey
gremlin
> i.getProperties()
==>unique=false
==>indexedElement=interface org.janusgraph.core.JanusGraphVertex
==>class=class org.janusgraph.graphdb.database.management.JanusGraphIndexWrapper
==>fieldKeys=[Lorg.janusgraph.core.PropertyKey;@72110818
==>mixedIndex=true
==>baseIndex=userStringKey
==>backingIndex=search
==>compositeIndex=false


gremlin
> g.V().has('user', textRegex( '.*Rob.*')).properties()
gremlin
> g.V().has('user', textRegex( '.*rob.*')).properties()
==>vp[user->Robert]
==>vp[v_key->0G4WNqlqyv-J1PTmYnF2]
==>vp[type->user]
gremlin
> g.V().has('user', textRegex( 'robert')).properties()
==>vp[user->Robert]
==>vp[v_key->0G4WNqlqyv-J1PTmYnF2]
==>vp[type->user]
gremlin
> g.V().has('user', textRegex( 'Robert')).properties()
gremlin
> g.V().has('user', textRegex( '.obert')).properties()
==>vp[user->Robert]
==>vp[v_key->0G4WNqlqyv-J1PTmYnF2]
==>vp[type->user]



If there is no index, the behaviour is different
 
graph = JanusGraphFactory.open('/tmp/tmp.prop')
g
= graph.traversal()
v1
= graph.addVertex('name', '1')
v2
= graph.addVertex('name', '2')
edges
= ['xxx', 'xxx.yyy', 'Xxx.yyy', '111.222', 'abcdef'].collect {
    v1
.addEdge('relates', v2, 'p', it)
}
gremlin
> g.E().has('p', textRegex( '.*X.*')).properties()
==>p[p->Xxx.yyy]
gremlin
> g.E().has('p', textRegex( '.*Xxx.*')).properties()
==>p[p->Xxx.yyy]
gremlin
> g.E().has('p', textRegex( '.*xxx.*')).properties()
==>p[p->xxx]
==>p[p->xxx.yyy]

Is this a bug, or is there some subtlety I missed?

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.