Tami Wert
Tami Wert

Reputation: 47

A valid query syntax for OrientDB returns no results (without errors)

My question in short - I want to search for vertices from a specific type with 2 conditions in the where-clause. when I search with each condition separately, I get results, but when I combine them with an "and" operator - I get no results and no errors.

More Details:

(It is not happening with all types, just STRING types [single & multiple value])

WHAT CAN IT BE?? I probably have a syntax error, but what can it be?? each condition works fine alone or with other conditions.

P.S. The index on those fields are:

Upvotes: 0

Views: 141

Answers (1)

Glabler
Glabler

Reputation: 245

ok i tried your case and work fine (but right now i can only test it with an older version), IF you are reporting exactly your queries and data then is correct that your last query result is empty, because Orient is case sensitive and you have inserted a record with "EP11" = "Second Text". "EP12" = ["First Text" , "Second Text" , "Third Text"] but then you are searching for: EP11 IN ['forth text','second text'] AND ['forth text','second text'] IN EP12 hope is only that your problem, happen more often than you think, cheers. btw my test (index created with studio)

create class EN182 extens V
create property EN182.EP1 string
create property EN182.EP12 EMBEDDEDLIST
insert into EN182 (EP11,EP12) values ("Second Text",["First Text" , "Second Text" , "Third Text"])
SELECT * FROM EN182 WHERE EP11 IN ['forth text','Second Text'] and ["First Text","Second Text"] IN EP12 //return your vertex see the right codition in the filter

Upvotes: 1

Related Questions