Well Enrico helped me and now I have:

select *,out(WROTE).size() as count from (
  select expand(in(HAS_TITLE).in(WROTE)) 
  from Title 
  where title LUCENE 'random' LIMIT 3) 
order by count desc

That works pretty well, but I don't think it's what I want to have. It 
selects results from Lucene and then just looking for the Person with the 
most WRITE edges. But I need it in the other way. Sorting Persons by the 
number of Applns and then looking where Lucene is matching. Is this 
possible and with Lucene still fast?

A Limit of 3 is fine at the end.

Thanks.

Am Montag, 8. September 2014 19:34:20 UTC+2 schrieb Curtis Mosters:
>
>
> I have this Schema
>
>
> <http://i.imgur.com/W67eXRg.png>
>
>
>
> Now I want to get Titles containing anything. And from this title I want 
> to get the Person who wrote it. Something like:
>
> select expand(in(HAS_TITLE).in(WROTE)).ID from Title where title LUCENE 
> 'random' LIMIT 2
>
> But doing this I also get the Title back. So what am I doing wrong. Or how 
> could it be done much better and faster?
>
> Thanks.
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to