Sure

with 1 shard 1 replica this request works fine

   1. Request URL:
   http://localhost:8983/solr/images/image?q=id:1
   2. Request Method:
   GET
   3. Status Code:
   200 OK

logs are clean

with 2 shards 2 replicas the same request fails and in the logs


INFO  - 2018-04-17 13:20:32.052; [c:images s:shard2 r:core_node7
x:images_shard2_replica_n4] org.apache.solr.core.SolrCore;
[images_shard2_replica_n4]  webapp=/solr path=/image
params={df=text&distrib=false&qt=/image&fl=id&fl=score&shards.purpose=4&start=0&fsv=true&shard.url=
http://10.224.30.207:8983/solr/images_shard2_replica_n4/|http://10.224.30.207:7574/solr/images_shard2_replica_n6/&rows=10&version=2&q=id:1&NOW=1523971232039&isShard=true&wt=javabin}
hits=0 status=0 QTime=0
ERROR - 2018-04-17 13:20:32.055; [c:images s:shard1 r:core_node3
x:images_shard1_replica_n1] org.apache.solr.common.SolrException;
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error
from server at http://10.224.30.207:8983/solr/images_shard2_replica_n4:
Expected mime type application/octet-stream but got application/json.
at
org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:607)
at
org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:255)
at
org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:244)
at
org.apache.solr.client.solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:483)
at
org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:413)
at
org.apache.solr.handler.component.HttpShardHandlerFactory.makeLoadBalancedRequest(HttpShardHandlerFactory.java:273)
at
org.apache.solr.handler.component.HttpShardHandler.lambda$submit$0(HttpShardHandler.java:175)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
at
org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:188)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

INFO  - 2018-04-17 13:20:32.056; [c:images s:shard1 r:core_node3
x:images_shard1_replica_n1] org.apache.solr.core.SolrCore;
[images_shard1_replica_n1]  webapp=/solr path=/image params={q=id:1}
status=200 QTime=17
INFO  - 2018-04-17 13:20:32.055; [c:images s:shard1 r:core_node3
x:images_shard1_replica_n1] org.apache.solr.core.SolrCore;
[images_shard1_replica_n1]  webapp=/solr path=/image
params={df=text&distrib=false&qt=/image&fl=id&fl=score&shards.purpose=4&start=0&fsv=true&shard.url=
http://10.224.30.207:8983/solr/images_shard1_replica_n1/|http://10.224.30.207:7574/solr/images_shard1_replica_n2/&rows=10&version=2&q=id:1&NOW=1523971232039&isShard=true&wt=javabin}
hits=1 status=0 QTime=2


I've implemented getcontenttype simply as

@Override
public String getContentType(SolrQueryRequest request,
SolrQueryResponse response) {

    return "application/json;charset=utf-8";
}





On 16 April 2018 at 17:37, Mikhail Khludnev <m...@apache.org> wrote:

> Lee,
> It's worth to send a stacktrace for such kind of inquiries.
> I guess it goes from QueryComponent.mergeIds() or so. Shard response should
> contains <uniqueKey> from schema.xml field.
> I encounter something like this while troubleshooting
> https://lucene.apache.org/solr/guide/6_6/transforming-
> result-documents.html#TransformingResultDocuments-
> CoresandCollectionsinSolrCloud
>
>
> On Mon, Apr 16, 2018 at 6:56 PM, Lee Carroll <lee.a.carr...@googlemail.com
> >
> wrote:
>
> > I've created a custom response writer which extends RawResponseWriter.
> The
> > basic operation is to output a single field value from the top matching
> doc
> > as the entire response. This works when shards = 1 but fails when shards
> > are greater than 1.
> >
> > I throw an error if the field in question is missing from the top doc.
> This
> > happens when individual shards are being searched and only id and score
> are
> > returned. I'm sure I've committed a basic error.
> >
> > Lee C
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>

Reply via email to