You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Timothy Potter <th...@gmail.com> on 2016/07/26 19:58:40 UTC

Example of posting to /stream in SolrJ?

Does anyone have an example of just POST'ing a streaming expression to
the /stream handler from SolrJ client code? i.e. I don't want to parse
and execute the streaming expression on the client side, rather, I
want to post the expression to the server side.

Currently, my client code is a big copy and paste of the /stream
request handler, but I'd rather not do that. Specifically, I wasn't
able to figure out how to parse the tuple
stream coming back using SolrJ code if I just post the expression to /stream.

Thanks.

Re: Example of posting to /stream in SolrJ?

Posted by Timothy Potter <th...@gmail.com>.
Sorry I was the one that initiated the cross-post ;-) Thanks for the
pointer, works great!



On Tue, Jul 26, 2016 at 3:32 PM, Joel Bernstein <jo...@gmail.com> wrote:
> I posted this also to another thread, but I'll cross post to this ticket:
>
> Take a look at org.apache.solr.client.solrj.io.sql.
> StatementImpl.constructStream()
>
> This uses a SolrStream to connect to the /sql handler. You can use the same
> approach to send a request to the /stream handler just by changing the
> parameters. Then you can open and read the SolrStream.
>
>
>
>
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
> On Tue, Jul 26, 2016 at 3:58 PM, Timothy Potter <th...@gmail.com>
> wrote:
>
>> Does anyone have an example of just POST'ing a streaming expression to
>> the /stream handler from SolrJ client code? i.e. I don't want to parse
>> and execute the streaming expression on the client side, rather, I
>> want to post the expression to the server side.
>>
>> Currently, my client code is a big copy and paste of the /stream
>> request handler, but I'd rather not do that. Specifically, I wasn't
>> able to figure out how to parse the tuple
>> stream coming back using SolrJ code if I just post the expression to
>> /stream.
>>
>> Thanks.
>>

Re: Example of posting to /stream in SolrJ?

Posted by Joel Bernstein <jo...@gmail.com>.
I posted this also to another thread, but I'll cross post to this ticket:

Take a look at org.apache.solr.client.solrj.io.sql.
StatementImpl.constructStream()

This uses a SolrStream to connect to the /sql handler. You can use the same
approach to send a request to the /stream handler just by changing the
parameters. Then you can open and read the SolrStream.





Joel Bernstein
http://joelsolr.blogspot.com/

On Tue, Jul 26, 2016 at 3:58 PM, Timothy Potter <th...@gmail.com>
wrote:

> Does anyone have an example of just POST'ing a streaming expression to
> the /stream handler from SolrJ client code? i.e. I don't want to parse
> and execute the streaming expression on the client side, rather, I
> want to post the expression to the server side.
>
> Currently, my client code is a big copy and paste of the /stream
> request handler, but I'd rather not do that. Specifically, I wasn't
> able to figure out how to parse the tuple
> stream coming back using SolrJ code if I just post the expression to
> /stream.
>
> Thanks.
>