title: How to query Solr shard
body: <p>I've followed <a href="https://cwiki.apache.org/confluence/display/solr/Distributed+Search+with+Index+Sharding" rel="nofollow noreferrer">this</a> to set up shard in Solr. As per this topic &quot;Testing Index Sharding on Two Local Servers&quot;, I was able to query into shard and get the result (somehose:port1/solr/select?shards=somehost:port1/solr,somehost:port2/solr&amp;indent=true&amp;q=helloworld
  ).</p>
  <p>In that page it is also mentioned that &quot;Rather than require users to include the shards parameter explicitly, it is usually preferred to configure this parameter as a default in the RequestHandler section of solrconfig.xml.&quot;
  So, I made the changes in solrconfig.xml of the solr instance which is running on port1</p>
  <pre><code>    &lt;requestHandler name=&quot;/select&quot; class=&quot;solr.SearchHandler&quot;&gt;
  
        &lt;lst name=&quot;defaults&quot;&gt;
         &lt;str name=&quot;echoParams&quot;&gt;explicit&lt;/str&gt;
         &lt;int name=&quot;rows&quot;&gt;10&lt;/int&gt;
          &lt;str name=&quot;df&quot;&gt;text&lt;/str&gt;
         &lt;/lst&gt;
      &lt;lst name=&quot;shards.info&quot;&gt;
       &lt;lst name=&quot;localhost:port2/solr&quot;&gt;
       &lt;long name=&quot;numFound&quot;&gt;1333&lt;/long&gt;
      &lt;float name=&quot;maxScore&quot;&gt;1.0&lt;/float&gt;
      &lt;str name=&quot;shardAddress&quot;&gt;http://localhost:port2/solr&lt;/str&gt;
     &lt;long name=&quot;time&quot;&gt;686&lt;/long&gt;
     &lt;/lst&gt;
    &lt;lst name=&quot;localhost:port1/solr&quot;&gt;
     &lt;long name=&quot;numFound&quot;&gt;342&lt;/long&gt;
     &lt;float name=&quot;maxScore&quot;&gt;1.0&lt;/float&gt;
     &lt;str name=&quot;shardAddress&quot;&gt;http://localhost:port1/solr&lt;/str&gt;
     &lt;long name=&quot;time&quot;&gt;602&lt;/long&gt;
    &lt;/lst&gt;
    &lt;/lst&gt;
  </code></pre>
  <p>Now, I'm trying to hit somehost:port1/solr/collection1/select?q=helloworld&amp;wt=json&amp;indent=true
  but I'm not getting the desired responce. Please let me know what I'm missing here?</p>