You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Ryan McKinley (Updated) (JIRA)" <ji...@apache.org> on 2012/02/15 04:51:59 UTC

[jira] [Updated] (SOLR-3134) Include shard Information in response

     [ https://issues.apache.org/jira/browse/SOLR-3134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan McKinley updated SOLR-3134:
--------------------------------

    Attachment: SOLR-3134-shard-info.patch

This patch addes two parameters:

{code:java}
  /** Request detailed match info for each shard (true/false) */
  public static final String SHARDS_INFO = "shards.info";

  /** Should things fail if there is an error? (true/false) */
  public static final String SHARDS_TOLERANT = "shards.tolerant";
{code}

When 'shards.info=true', it adds adds a node to the response:
{code:xml}
<lst name="shards.info">
  <lst name="localhost:7777/solr">
    <long name="numFound">1333</long>
    <float name="maxScore">1.0</float>
    <long name="time">686</long>
  </lst>
  <lst name="localhost:8888/solr">
    <long name="numFound">342</long>
    <float name="maxScore">1.0</float>
    <long name="time">602</long>
  </lst>
</lst>
{code}

When 'shards.tolerant=true' it does not abort when a request has an error.  If 'shards.info=true', it will add error info to the response for that shard, like:

{code:xml}
<lst name="shards.info">
  <lst name="badurl:3456/solr">
    <str name="error">java.net.UnknownHostException: badurl</str>
    <str name="trace">java.net.UnknownHostException: badurl
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:176)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
	at java.net.Socket.connect(Socket.java:579)
	at java.net.Socket.connect(Socket.java:528)
	at java.net.Socket.<init>(Socket.java:425)
	at java.net.Socket.<init>(Socket.java:280)
	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
	at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:425)
	at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:251)
	at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:153)
	at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:1)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)</str>
    <long name="time">2622</long>
  </lst>
  <lst name="localhost:8888/solr">
    <long name="numFound">342</long>
    <float name="maxScore">1.0</float>
    <long name="time">602</long>
  </lst>
</lst>
{code}


                
> Include shard Information in response
> -------------------------------------
>
>                 Key: SOLR-3134
>                 URL: https://issues.apache.org/jira/browse/SOLR-3134
>             Project: Solr
>          Issue Type: Improvement
>          Components: SearchComponents - other
>            Reporter: Ryan McKinley
>            Assignee: Ryan McKinley
>             Fix For: 4.0
>
>         Attachments: SOLR-3134-shard-info.patch
>
>
> For distributed search where each shard represents a logically different index (or physical location), it would be great to know the hit count for each shard.
> In addition, it would be nice to get error info for each shard rather then aborting the whole request when something fails.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org