Yeah,
select expand(in("Edge1").id) from Class2 where text = 'foo' basically
fails, with the server output that the query "fetched more than 50000
records: to speed up the execution, create an index or change the query to
use an existent index [OProfiler]"
Switching to:
select expand(in("Edge1").id) from index:Class1.idxText where key='foo'
returns nothing.
select from index:Class1.idxText where key='foo'
returns all matching results.
It seems like the index lookup is not compatible (or doesn't cast the
results appropriately) with the select clause. Is there something I can do
to create the index differently, or cast the results?
Also, since I know this will come up, I haven't found an example of how to
encode multiple keys to a super-key index (where more than one key is used
to identify an entry/s). How is this done?
On Monday, February 9, 2015 at 8:38:23 AM UTC-8, Julian Klappenbach wrote:
>
> There's a catch: we have millions of nodes, so we need to use an indexed
> search. Will "where text = 'foo'" leverage an indexed search? I had been
> trying to use "from index:[indexname] where key = '[key_term]'", but it
> didn't seem to work with other clauses. I'll try your query, substituting
> the index clause.
>
> -jjk
>
> On Sunday, February 8, 2015 at 10:33:37 PM UTC-8, Luigi Dell'Aquila wrote:
>>
>> Hi Julian,
>>
>> I suppose the relationship is directed like this:
>>
>> Class1 --Edge1-> Class2
>>
>> The first one is very simple (if I got it right)
>>
>> SELECT expand(in("Edge1").id) from Class2 where text='foo'
>>
>> the second one could be something like
>>
>> select expand(inV()) from (
>> select expand(outE("Edge1")) from Class1 where id = 1
>> ) where preferred = true and text = 'foo'
>>
>>
>> Luigi
>>
>>
>> 2015-02-07 20:19 GMT+01:00 Julian Klappenbach <[email protected]>:
>>
>>>
>>> We have a graph with two classes:
>>>
>>> Class1 and Class2 with an edge Edge1.
>>>
>>> Class1 has the property "id", Class2 has a text property that is
>>> indexed. The Edge1 class has a boolean property "preferred" and integer
>>> "colorId".
>>>
>>> 1. We need a query that filters for elements of Class2 by the index on
>>> Class2, searching by a text string, and then finds edges off of that
>>> resulting set according to the class Edge1. The query should just return
>>> id from Class1.
>>>
>>> 2. We need a query that filters by "id" on Class1, then selects only
>>> edges of Edge1 from Class1 that are preferred and of the proper colorId.
>>> The result of the query should output the text of the Class2 node that
>>> matches this criteria.
>>>
>>> It's not clear how to do this with select, embedding queries, etc.
>>>
>>> --
>>>
>>> ---
>>> 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.
>>>
>>
>>
--
---
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.