[Developers] OR operator in query

Christian Hirsch hirsch.christian at gmail.com
Fri Jun 20 03:03:48 UTC 2008


Hi,

I'm starting with a topic id (e.g. /en/the_departed) and like to query
all of its properties (e.g. all actors starring in the movie, awards
won, etc.).

At the moment I'm using separate queries for each type which is
associated with the topic to get all these information, e.g.:

{
  "*" : [],
  "id" : "/en/the_departed",
  "type" : "/film/film"
}

------------

{
  "*" : [],
  "id" : "/en/the_departed",
  "type" : "/award/award_winning_work"
}

------------

etc.

This works well but is not very efficient.
First of all a query is needed to get the types of the topic:
{
  "id" : "/en/the_departed",
  "type" : []
}

...and then a query is needed for each type as described above.


What would be the best way to reduce the number of queries?

I just tried to use an OR operator, e.g.:

{
    "*" : [],
    "id" : "/en/the_departed",
    "type" : [],
    "type|=" : [
      "/film/film",
      "/award/award_winning_work"
    ]
}

but it doesn't give the desired results. Is there some syntax error,
or does the OR not work in this case?

Cheers,
Christian


More information about the Developers mailing list