You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by ku3ia <de...@gmail.com> on 2012/02/11 19:34:30 UTC

Distributed search: RequestHandler

Hi!

I'm using Solr 3.5. I have two shards. Now I'm using default and my own
defined request handler to search by these shards:
  <requestHandler name="distributed" class="solr.SearchHandler"
default="false">
    <lst name="defaults">
      <str name="shards">192.168.1.1:8080/solr,192.168.1.2:8080/solr</str>
    </lst>
  </requestHandler>

So, urls I have:
http://192.168.1.1:8080/solr/select/?q=test&rows=0&qt=distributed:
{"responseHeader":{"status":0,"QTime":1},"response":{"numFound":20,"start":0,"docs":[]}}

http://192.168.1.1:8080/solr/select/?q=test&rows=0
{"responseHeader":{"status":0,"QTime":1},"response":{"numFound":13,"start":0,"docs":[]}}

http://192.168.1.2:8080/solr/select/?q=test&rows=0
{"responseHeader":{"status":0,"QTime":1},"response":{"numFound":7,"start":0,"docs":[]}}

Can I configure my solrconfig to use default search handler, for example:

  <requestHandler name="search" class="solr.SearchHandler" default="true">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
      <int name="rows">10</int>
    </lst>
    <lst name="appends">
      <str name="qt">distributed</str>
    </lst>
  </requestHandler>

  <requestHandler name="standalone" class="solr.SearchHandler"
default="false" />

  <requestHandler name="distributed" class="solr.SearchHandler"
default="false">
    <lst name="defaults">
      <str name="shards">192.168.1.1:8080/solr,192.168.1.2:8080/solr</str>
      <str name="qt">standalone</str>
    </lst>
  </requestHandler>

but this unfortunaly don't works :-(

The goal is to use only one core on each server and don't use "qt" parameter
in request:
http://192.168.1.1:8080/solr/select/?q=test&rows=0
{"responseHeader":{"status":0,"QTime":1},"response":{"numFound":20,"start":0,"docs":[]}}

P.S. No SolrCloud, only Solr 3.5.
P.P.S. Maybe it can be configured for core at solr.xml file?

Thanks.

--
View this message in context: http://lucene.472066.n3.nabble.com/Distributed-search-RequestHandler-tp3735621p3735621.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Distributed search: RequestHandler

Posted by Erick Erickson <er...@gmail.com>.
Hmmm, *how* does this not work? What are you seeing
when you try this and what to do you expect to see? Also,
what does attaching &debugQuery=on show you?

Best
Erick

On Sat, Feb 11, 2012 at 1:34 PM, ku3ia <de...@gmail.com> wrote:
> Hi!
>
> I'm using Solr 3.5. I have two shards. Now I'm using default and my own
> defined request handler to search by these shards:
>  <requestHandler name="distributed" class="solr.SearchHandler"
> default="false">
>    <lst name="defaults">
>      <str name="shards">192.168.1.1:8080/solr,192.168.1.2:8080/solr</str>
>    </lst>
>  </requestHandler>
>
> So, urls I have:
> http://192.168.1.1:8080/solr/select/?q=test&rows=0&qt=distributed:
> {"responseHeader":{"status":0,"QTime":1},"response":{"numFound":20,"start":0,"docs":[]}}
>
> http://192.168.1.1:8080/solr/select/?q=test&rows=0
> {"responseHeader":{"status":0,"QTime":1},"response":{"numFound":13,"start":0,"docs":[]}}
>
> http://192.168.1.2:8080/solr/select/?q=test&rows=0
> {"responseHeader":{"status":0,"QTime":1},"response":{"numFound":7,"start":0,"docs":[]}}
>
> Can I configure my solrconfig to use default search handler, for example:
>
>  <requestHandler name="search" class="solr.SearchHandler" default="true">
>    <lst name="defaults">
>      <str name="echoParams">explicit</str>
>      <int name="rows">10</int>
>    </lst>
>    <lst name="appends">
>      <str name="qt">distributed</str>
>    </lst>
>  </requestHandler>
>
>  <requestHandler name="standalone" class="solr.SearchHandler"
> default="false" />
>
>  <requestHandler name="distributed" class="solr.SearchHandler"
> default="false">
>    <lst name="defaults">
>      <str name="shards">192.168.1.1:8080/solr,192.168.1.2:8080/solr</str>
>      <str name="qt">standalone</str>
>    </lst>
>  </requestHandler>
>
> but this unfortunaly don't works :-(
>
> The goal is to use only one core on each server and don't use "qt" parameter
> in request:
> http://192.168.1.1:8080/solr/select/?q=test&rows=0
> {"responseHeader":{"status":0,"QTime":1},"response":{"numFound":20,"start":0,"docs":[]}}
>
> P.S. No SolrCloud, only Solr 3.5.
> P.P.S. Maybe it can be configured for core at solr.xml file?
>
> Thanks.
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Distributed-search-RequestHandler-tp3735621p3735621.html
> Sent from the Solr - User mailing list archive at Nabble.com.