lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn Heisey (JIRA)" <>
Subject [jira] [Commented] (SOLR-6777) Create convenience methods in CloudSolrServer to specify the collection to act on, on a per request basis.
Date Sat, 22 Nov 2014 21:29:12 GMT


Shawn Heisey commented on SOLR-6777:

Is ping actually useful in a CloudSolrServer context?  The patch does include a collection-aware
ping method, but if ping itself is not useful, then that wouldn't be either.

What I would hope for with ping is that it would request a query from all shards and fail
if any of them are down or return a no-good response, similar to what I have done on my non-cloud
sharded setup.  It may not actually be useful, because of SolrCloud's ability to deal with
down servers when replicationFactor is at least 2.

This is the config I'm using for ping on my non-cloud setup:

<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
  <lst name="invariants">
    <str name="qt">/lbcheck</str>
    <str name="q">*:*</str>
    <str name="df">catchall</str>
  <lst name="defaults">
     <str name="echoParams">all</str>
  <str name="healthcheckFile">server-enabled.txt</str>

<requestHandler name="/lbcheck" class="solr.SearchHandler" default="false">
  <lst name="defaults">
    <str name="echoParams">all</str>
    <int name="rows">1</int>
    <str name="df">catchall</str>
    <str name="shards.qt">/lbcheck</str>
    <str name="">true</str>
    <xi:include href="shards.xml" xmlns:xi=""/>

The shards.xml file for the broker core looks like this:

<str name="shards">,,,,,,</str>

> Create convenience methods in CloudSolrServer to specify the collection to act on, on
a per request basis.
> ----------------------------------------------------------------------------------------------------------
>                 Key: SOLR-6777
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>          Components: clients - java
>            Reporter: Joey Dale
>            Assignee: Shawn Heisey
>            Priority: Minor
>              Labels: newbie
>         Attachments: SOLR-6777.patch, SOLR-6777.patch
> As a user of solrcloud as a NoSQL datastore, with components of my complex data model
stored in many collections, I would like to easily pass in the collection name for each query/add/delete
statement via an overloaded method that accepts a String equal to the name of the collection.
> Currently there exists methods to set the default collection for a CloudSolrServer instance.
This losses its luster in a multithreaded environment. The work arounds to date are passing
in a SolrParam on the Update handlers, but on the Query handles you are forced to basically
maintain a CloudSolrServer instance for each collection you want to interact with, and never
call setDefaultCollect after creation.
> Here are some examples:
> CloudSolrServer solr = new CloudSolr(zkHost);
> solr.addBeans(beans, collection);
> solr.addBeans(beans, collection, commitWithin);
> solr.commit(collection, commitWithin);
> solr.optimize(collection);
> SolrQuery query = new SolrQuery();
> query.setQuery("*:*");
> QueryResponse rsp = solr.query(query, collection);

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message