I have two queries running on same set of fields in Solr and return of unique ID (another solr field). How do i calculate intersection of two queries or only unique Id from two search query. I do know that i can run these separately on client side and find the unique ones but i want to know is there a way i can do this with single search sent to SOLR. Here is how everything looks at my side.
Solr Fields:
<fields>
<field name="key" type="uuid" indexed="true" required="true"/>
<field name="tagname" type="string" indexed="true" required="false"/>
<field name="tagvalue" type="string" indexed="true" required="false"/>
</fields>
Now what i want to do is
(tagname:xyz and tagvalue:123)&fl=key
this would return a list of key
(tagname:abc and tagvalue:456)&fl=key
this would also return a list of key
now get the intersection of/unique keys from above two lists.
Can this all process be done in one step by running some kind of solr intersection query?
Or is there any other solr schema design i need to take? i am open for that.