Sorry I have to ask again. When I use this query:

SELECT FLATTEN($a) (
LET $a = (SELECT FROM Application WHERE symbol CONTAINSTEXT 'B60K'),
$b = (SELECT FROM Application WHERE symbol CONTAINSTEXT 'B60L')
 )WHERE $a.id=$b.id ORDER BY id

for what I need to SELECT at the very begin? I'm just able to select for 
the a or b variable. 

But if I write FLATTEN($a) I get all a result, and if I write FLATTEN($b) I 
get the b results. But I just want these where they are equal. I really 
tested every szenario I think =/



Am Donnerstag, 21. August 2014 09:12:16 UTC+2 schrieb Curtis Mosters:
>
> Hey Riccardo, thanks for your response,
>
> well now I know know why you always get an result. You always use "*OR*" 
> to combine the results. For sure that works great and gives back results.
>
> But what I need is that I want to get all IDs where the symbols are both ('
> *B62D*' AND '*B60*') matching that ID. So instead take *AND*, I think 
> *DISTINCT 
> *and *OR *is not the way to get it to work here.
>
> And yes *REGEX *might not use the index. But first of all I need it 
> running. After that I can looks for improvements =)
>
> I also tried this here
>
> SELECT $a.id LET $a = ( SELECT id FROM Application WHERE symbol 
> CONTAINSTEXT 'B62D' ), $b = ( SELECT id FROM Application WHERE symbol 
> CONTAINSTEXT 'B60' ) WHERE $a=$b
>
> but this is returning 301 entries. I think it just return "B62D" somehow.
>
> Am Donnerstag, 21. August 2014 08:32:58 UTC+2 schrieb Riccardo Tasso:
>>
>> Ok, I think there's something wrong with the regular expression syntax.
>>
>> I've tried the following query:
>> SELECT DISTINCT(pid) FROM App WHERE symbol MATCHES '(^B\\d.*)' OR symbol 
>> MATCHES '^..5.*'
>> Which gives me the expected results:
>> 2
>> 3
>>
>> In fact I can't understand why you have the [[:<:]] in your pattern, 
>> since you don't have any symbol starting with those characters, maybe you 
>> forgoto a star (*) operator? Please remember that the Orient REGEX syntax 
>> is the one defined for Java (
>> http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html) 
>> which may be different from MySql one.
>>
>> Note that, as far as I know, REGEX operations doesn't benefit form 
>> indices, hence if this is your only query I would suggest to remove them.
>>
>> Cheers,
>>    Riccardo
>>
>>
>> 2014-08-20 16:53 GMT+02:00 'Curtis Mosters' via OrientDB <
>> [email protected]>:
>>
>>> Sure id should be unique, so it's just not a good name for it. You are 
>>> right.
>>>
>>> But testing your query give me also am* empty result* =(
>>>
>>> FYI: 
>>>
>>>    - symbol is FULLTEXT_HASH_INDEX 
>>>    - id is NOTUNIQUE_HASH_INDEX 
>>>
>>> Does that matter?
>>>
>>> Because of the Indexes, please let's 
>>>
>>> SELECT appln_id FROM Application WHERE ipc_class_symbol CONTAINSTEXT 
>>> 'B62D' AND ipc_class_symbol CONTAINSTEXT 'B60'
>>>
>>> Runs much faster.
>>>
>>>  -- 
>>>
>>> --- 
>>> 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.

Reply via email to