Well I now want to get all Persons of an Appln's RID.

So as example the #11:9

select name,@rid,@class from (select expand(in(WROTE)) from #11:9 LIMIT 20

That is giving me 2 Persons. Well the Application has 2 Persons, so that's 
fine. But the Problem is that I now want a DISTINCT result.

[{"@type":"d","@rid":"#-2:1","@version":0,"name":"Marioff Corporation Oy",
"rid":"#13:45","class":"Person"},{"@type":"d","@rid":"#-2:2","@version":0,
"name":"Marioff Corporation Oy","rid":"#13:45","class":"Person"}]

Already tried some DISTINCT stuffs, but somehow it's just possible to do it 
on a single vairable. 

So the qquestion is, how can I change the query, so that I get back:

[{"@type":"d","@rid":"#-2:1","@version":0,"name":"Marioff Corporation Oy",
"rid":"#13:45","class":"Person"}]

And if possible without the "@type":"d","@rid":"#-2:1","@version":0, at the 
begin.

Thanks

Am Dienstag, 9. September 2014 09:28:35 UTC+2 schrieb Curtis Mosters:
>
> 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