JoniJnm
JoniJnm

Reputation: 722

Solr, select where in select

I'm trying to do a query with a select in another.

I would like to do something like:

select?q=*:* AND id_user=5&fl=id_other    
select?q=test AND -id(the result of the other select)&fl=id

So:

select?q=test AND -id(select?q=* AND id_user=5&fl=id_other)&fl=id

Is it possible? Or I have to do two separates selects?

$ids = select?q=*:* AND id_user=5&fl=id_other
$result = select?q=test AND -id(implode(' AND ', $ids))&fl=id

Thanks!

Upvotes: 2

Views: 910

Answers (1)

Parvin Gasimzade
Parvin Gasimzade

Reputation: 26012

There is a nested query support in Solr. You can _query_ parameter to embed query into another. Check this tutorial for more information.

Upvotes: 1

Related Questions