Is it possible to filter on multiple indexed properties in one query

759 views
Skip to first unread message

fbrb...@carqualifier.com

unread,
Apr 4, 2015, 8:10:34 AM4/4/15
to orient-...@googlegroups.com
Is it possible to filter in a single query on multiple independent indexes ?
If I have 
select  from dealer
WHERE city = 'wellington'
AND name = 'james'


where each city and name are separate indexes,  is it possible to query on it and orientdb use both of the indexes ?   Currently when running explain I see only one index being used, is it possible for orient to use both ?

I know that I can use compound indexes but in my real case scenario I am trying to query both the lucene spatial and nounique index and I can't compound those. 

Thanks

Luigi Dell'Aquila

unread,
Apr 7, 2015, 2:17:56 AM4/7/15
to orient-...@googlegroups.com
Hi,

current query executor cannot handle multiple indexes for multiple AND clauses. 
To do this you have to use a simple trick: execute two subqueries with LET assignment and then use intersect() function.
eg.

select intersect($a, $b)
let
$a = (<subquery1>),
$b = (<subquery2>)


--

---
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-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Deepika Mewara

unread,
Jun 28, 2019, 10:23:09 AM6/28/19
to OrientDB
Hi Luigi, 
I wanted to know if orientDB 3.0 and greater support multiple indexes now? 
To unsubscribe from this group and stop receiving emails from it, send an email to orient-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages