I am using orientdb version 2.2.0. I am trying to run some traverse queries and I don't believe I am seeing the results that I expect.
My scenario: I have a User vertex which is linked to a Term vertex via an edge called "searched". What I am expecting to see is that if I traverse starting from a Term that I should be able to see the Users who searched for that Term, as well as other Terms that those users searched for. However for some of my queries I am only seeing the edges which are connected to that original term.
Query1: "TRAVERSE * FROM (select from Term where q.toLowerCase() = "human resources") STRATEGY BREADTH_FIRST"
Query2: "TRAVERSE out('searched') FROM (select from Term where q.toLowerCase() LIKE '%aluminum%') STRATEGY BREADTH_FIRST"
I know that the User who searched for "human resources" also searched for other terms, so I would expect to see those in my result set along with the actual user.
My long term goal is to get a query working like the following. I want to be able to see the depth and how many other people searched for a term, and use that to order my results.
"SELECT $depth, q, in().size() AS count FROM (TRAVERSE * FROM (select from Term where q.toLowerCase() LIKE '%aluminum}%') STRATEGY BREADTH_FIRST) WHERE @class = 'Term' AND $depth <> 0 ORDER BY $depth ASC, count DESC"
Is my understanding of Traverse incorrect?