itting custom code anyway, my suggestion would be that
: >> perhaps you could make your custom ResponseWriter delegate to the javabin
: >> responsewriter if/when you see that this is an "isShard=true" request?
: >>
: >>
: >>
: >> : Date: Thu, 19 Apr 20
iter if/when you see that this is an "isShard=true" request?
>>
>>
>>
>> : Date: Thu, 19 Apr 2018 18:42:58 +0100
>> : From: Lee Carroll
>> : Reply-To: solr-user@lucene.apache.org
>> : To: solr-user@lucene.apache.org
>> : Subject: Re: custom respons
0100
> : From: Lee Carroll
> : Reply-To: solr-user@lucene.apache.org
> : To: solr-user@lucene.apache.org
> : Subject: Re: custom response writer which extends RawResponseWriter
> fails when
> : shards > 1
> :
> : Hi,
> :
> : I rewrote all of my tests to use Sol
> RemoteSolrException:
: > > > > >> > > > > > Error
: > > > > >> > > > > > from server at http://10.224.30.207:8983/
: > > > > >> > > solr/images_shard2_replica_n4
: > > > > >&g
t;> > > > > >200 OK
> > > > > > > >> > > > > >
> > > > > > > >> > > > > > logs are clean
> > > > > > > >> > > > > >
> > > &g
gt; > > >> > > > > > x:images_shard2_replica_n4]
> > > org.apache.solr.core.SolrCore;
> > > > > > >> > > > > > [images_shard2_replica_n4] webapp=/solr path=/image
> > > > > > >> > > > > > params={df=text&distrib=false&
> > qt
gt; > > > > &rows=10&version=2&q=id:1&NOW=
> > > > 1523971232039&isShard=true&wt=
> > > > > >> > javabin}
> > > > > >> > > > > > hits=0 status=0 QTime=0
> > > > &
; org.apache.solr.common.SolrExc
> > > > >> eption;
> > > > >> > > > > > org.apache.solr.client.solrj.impl.HttpSolrClient$
> > > > >> > > RemoteSolrException:
> > > > >> > > > > >
but got
> > > >> > application/json.
> > > >> > > > > > at
> > > >> > > > > > org.apache.solr.client.solrj.impl.HttpSolrClient.
> > > >> > > > > > executeMethod(HttpSolr
.HttpSolrClient.request(
> > >> > > > > > HttpSolrClient.java:255)
> > >> > > > > > at
> > >> > > > > > org.apache.solr.client.solrj.impl.HttpSolrClient.request(
> > >> > > > > > HttpSolrClient.java:244)
> > >> > >
; > > > > org.apache.solr.handler.component.HttpShardHandlerFactory.
> >> > > > > > makeLoadBalancedRequest(HttpShardHandlerFactory.java:273)
> >> > > > > > at
> >> > > > > > org.apache.solr.handler.component.HttpShard
175)
>> > > > > > at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> > > > > > at java.util.concurrent.Executors$RunnableAdapter.
>> > > > > call(Executors.java:511)
>> > > > > > at java.util.concurrent.Fut
t; > > > > lambda$execute$0(ExecutorUtil.java:188)
> > > > > > at
> > > > > > java.util.concurrent.ThreadPoolExecutor.runWorker(
> > > > > > ThreadPoolExecutor.java:1142)
> > > > > > at
> > > > > > ja
> > > > [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.sol
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&
_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
;wt=javabin}
> > hits=1 status=0 QTime=2
> >
> >
> > I've implemented getcontenttype simply as
> >
> > @Override
> > public String getContentType(SolrQueryRequest request,
> > SolrQueryResponse response) {
> >
> > return &qu
n "application/json;charset=utf-8";
> }
>
>
>
>
>
> On 16 April 2018 at 17:37, Mikhail Khludnev wrote:
>
> > Lee,
> > It's worth to send a stacktrace for such kind of inquiries.
> > I guess it goes from QueryComponent.mergeIds() or so. Shard
d response should
> contains 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 a
esult-documents.html#TransformingResultDocuments-CoresandCollectionsinSolrCloud
On Mon, Apr 16, 2018 at 6:56 PM, Lee Carroll
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
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 mi
the additional tag for employee name
>or
>item name. These names / additional info are read from our own read
>through
>cache which are loaded in a static block.
>
>Is there a better way/option than customizing the xmlwriter ?
>
>Regards,
>
>
>
>--
>View this mes
r-user@lucene.apache.org
> Subject: Custom Response writer
>
> Hi,
>
> We have requirement like in the response we would like to add description of
> an item with item id(this field comes from solr response by default) or
> employee name along with employee id ( this is
info are read from our own read through
cache which are loaded in a static block.
Is there a better way/option than customizing the xmlwriter ?
Regards,
--
View this message in context:
http://lucene.472066.n3.nabble.com/Custom-Response-writer-tp4340908.html
Sent from the Solr - User mailing
; "duration": "176",
> }
> ]
> }
> ]
> }
> }
>
> For indexing this object, I am creating a parent JSON Object that contains
> all the top level attributes and am creating child objects for all nested
> JSON objects and linking the two of the. The problem arises that when I
> query for a top level attribute, I get only 1 document that shows only the
> top level attributes but does not contain any of the nested json objects.
> How can I ensure that I get JSON objects similar to the way they are
> originally indexed into Solr? Is there any custom response writer in Solr
> that can achieve this functionality?
>
> Regards,
> Vineeth
>
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
]
}
]
}
}
For indexing this object, I am creating a parent JSON Object that contains
all the top level attributes and am creating child objects for all nested
JSON objects and linking the two of the. The problem arises that when I
query for a top level attribute, I get only 1 document that shows only the
top level attributes but does not contain any of the nested json objects.
How can I ensure that I get JSON objects similar to the way they are
originally indexed into Solr? Is there any custom response writer in Solr
that can achieve this functionality?
Regards,
Vineeth
26 matches
Mail list logo