Traverse not giving expected results

22 views
Skip to first unread message

dboden...@problemsolutions.net

unread,
Sep 29, 2017, 5:11:07 PM9/29/17
to OrientDB
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? 

Luigi Dell'Aquila

unread,
Oct 2, 2017, 3:49:52 AM10/2/17
to orient-...@googlegroups.com
Hi,

Your understanding is correct, so I guess there is a problem in your DB.
Could you please share a sample db to demonstrate the problem?

Thanks

Luigi


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages