Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid results (missing vertices) with multi-field index #126

Open
christinedraper opened this issue Mar 21, 2017 · 1 comment
Open

Invalid results (missing vertices) with multi-field index #126

christinedraper opened this issue Mar 21, 2017 · 1 comment
Assignees

Comments

@christinedraper
Copy link

christinedraper commented Mar 21, 2017

I am creating a class and index as follows:

create class V_Entity extends V;
create property V_Entity.entityId STRING;
create property V_Entity.entityType STRING;
create index entity_index ON V_Entity (entityId, entityType) UNIQUE;

Then using the 3.2.3 driver via Gremlin console (connecting to 2.2.17 OrientDB server), I do:

t.addV("Entity").property("entityId", "entity1").property("entityType", "blah")

Doing any of:

t.V().hasLabel("Entity").has("entityId", "entity1")
t.V().has("entityType", "blah")
.V().hasLabel("Entity").has("entityId", "entity1").has("entityType", "blah")

returns the vertex, however:

t.V().hasLabel("Entity").has("entityType", "blah")
t.V().hasLabel("Entity").has("entityType", "blah").has("entityId", "entity1")

does not.

Worse, when running in Java I am getting duplicate record problems, which I think is because the code is not finding the existing vertex due to the above, and is then trying to create rather than update it.

I have discovered that adding an additional index:

create index type_index ON V_Entity (entityType) NOTUNIQUE;

appears to work around the problem, although I'd feel better if I understood why.

@wolf4ood
Copy link
Member

Hi @calebbriggs

thanks for this issue.
Let me try to reproduce it

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants