title: Solr Intersection based on single field
body: <p>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.</p>
  
  <p>Solr Fields:</p>
  
  <pre><code>&lt;fields&gt;
      &lt;field name="key" type="uuid" indexed="true" required="true"/&gt;
      &lt;field name="tagname" type="string" indexed="true"  required="false"/&gt;
      &lt;field name="tagvalue" type="string" indexed="true" required="false"/&gt;
  &lt;/fields&gt;
  </code></pre>
  
  <p>Now what i want to do is</p>
  
  <p><code>(tagname:xyz and tagvalue:123)&amp;fl=key</code></p>
  
  <p>this would return a list of key</p>
  
  <p><code>(tagname:abc and tagvalue:456)&amp;fl=key</code></p>
  
  <p>this would also return a list of key</p>
  
  <p>now get the intersection of/unique keys from above two lists.</p>
  
  <p>Can this all process be done in one step by running some kind of solr intersection query?</p>
  
  <p>Or is there any other solr schema design i need to take? i am open for that.</p>