You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Ufuk YILMAZ <uy...@vivaldi.net.INVALID> on 2022/02/02 18:09:14 UTC
ClassCastException in StreamingBinaryResponseParser when using export handler
Solr version is 8.4
I'm trying to use the export handler through SolrJ:
CloudSolrClient cloudSolrClient = ...
SolrQuery q = new SolrQuery();
q.setParam("q", "ts:[1612368422911 TO 1612370422911]");
q.setParam("sort", "ts asc");
q.setParam("fl", "ts");
q.setRequestHandler("/export");
cloudSolrClient.queryAndStreamResponse(TWITTER_TWEETS_ALL_TIME, q, new
StreamingResponseCallback() {
...
results in exception:
Caused by: java.lang.ClassCastException: java.util.LinkedHashMap cannot
be cast to org.apache.solr.common.util.NamedList
at
org.apache.solr.client.solrj.impl.StreamingBinaryResponseParser.streamDocs(StreamingBinaryResponseParser.java:170)
~[solr-solrj-8.4.0.jar:8.4.0 bc02ab906445fcf4e297f4ef00ab4a54fdd72ca2 -
jpountz - 2019-12-19 20:19:50]
at
org.apache.solr.client.solrj.impl.StreamingBinaryResponseParser.processResponse(StreamingBinaryResponseParser.java:62)
~[solr-solrj-8.4.0.jar:8.4.0 bc02ab906445fcf4e297f4ef00ab4a54fdd72ca2 -
jpountz - 2019-12-19 20:19:50]
at
org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:636)
~[solr-solrj-8.4.0.jar:8.4.0 bc02ab906445fcf4e297f4ef00ab4a54fdd72ca2 -
jpountz - 2019-12-19 20:19:50]
am I doing something wrong or is this a bug?
Re: ClassCastException in StreamingBinaryResponseParser when using export handler
Posted by Joel Bernstein <jo...@gmail.com>.
This I would consider a bug.
Probably the easiest approach to stream data from the /export handler with
Solrj is to use a SolrStream to send a Streaming Expression that reads from
the export handler. This blog describes the approach:
https://lucidworks.com/post/streaming-expressions-in-solrj/
Joel Bernstein
http://joelsolr.blogspot.com/
On Wed, Feb 2, 2022 at 1:09 PM Ufuk YILMAZ <uy...@vivaldi.net.invalid>
wrote:
> Solr version is 8.4
>
> I'm trying to use the export handler through SolrJ:
>
> CloudSolrClient cloudSolrClient = ...
> SolrQuery q = new SolrQuery();
> q.setParam("q", "ts:[1612368422911 TO 1612370422911]");
> q.setParam("sort", "ts asc");
> q.setParam("fl", "ts");
> q.setRequestHandler("/export");
>
> cloudSolrClient.queryAndStreamResponse(TWITTER_TWEETS_ALL_TIME, q, new
> StreamingResponseCallback() {
>
> ...
>
> results in exception:
>
> Caused by: java.lang.ClassCastException: java.util.LinkedHashMap cannot
> be cast to org.apache.solr.common.util.NamedList
> at
> org.apache.solr.client.solrj.impl.StreamingBinaryResponseParser.streamDocs(StreamingBinaryResponseParser.java:170)
>
> ~[solr-solrj-8.4.0.jar:8.4.0 bc02ab906445fcf4e297f4ef00ab4a54fdd72ca2 -
> jpountz - 2019-12-19 20:19:50]
> at
> org.apache.solr.client.solrj.impl.StreamingBinaryResponseParser.processResponse(StreamingBinaryResponseParser.java:62)
>
> ~[solr-solrj-8.4.0.jar:8.4.0 bc02ab906445fcf4e297f4ef00ab4a54fdd72ca2 -
> jpountz - 2019-12-19 20:19:50]
> at
> org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:636)
>
> ~[solr-solrj-8.4.0.jar:8.4.0 bc02ab906445fcf4e297f4ef00ab4a54fdd72ca2 -
> jpountz - 2019-12-19 20:19:50]
>
> am I doing something wrong or is this a bug?
>