Quantcast

SolrJ and Streaming

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SolrJ and Streaming

Joe Obernberger
Hi All - any examples of using solrJ and streaming expressions
available?  Like calling UpdateStream from solrJ?

Thank you!

-Joe

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SolrJ and Streaming

Joel Bernstein
Are you trying to send a streaming expression using SolrJ?

If you are you can send the expression with the SolrStream. for example:

params = new ModifiableSolrParams();
params.set("expr", expr);
params.set("qt", "/stream");
SolrStream stream = new SolrStream(url, paramsLoc);

try {

   stream.open();

   while(true) {

      Tuple tuple = stream.read();

      if(tuple.EOF) {

          break;

      }

   }

} finally {

  stream.close();

}



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

On Tue, Apr 18, 2017 at 2:33 PM, Joe Obernberger <
[hidden email]> wrote:

> Hi All - any examples of using solrJ and streaming expressions available?
> Like calling UpdateStream from solrJ?
>
> Thank you!
>
> -Joe
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SolrJ and Streaming

Joel Bernstein
paramsLoc in my last email should be params

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

On Tue, Apr 18, 2017 at 3:21 PM, Joel Bernstein <[hidden email]> wrote:

> Are you trying to send a streaming expression using SolrJ?
>
> If you are you can send the expression with the SolrStream. for example:
>
> params = new ModifiableSolrParams();
> params.set("expr", expr);
> params.set("qt", "/stream");
> SolrStream stream = new SolrStream(url, paramsLoc);
>
> try {
>
>    stream.open();
>
>    while(true) {
>
>       Tuple tuple = stream.read();
>
>       if(tuple.EOF) {
>
>           break;
>
>       }
>
>    }
>
> } finally {
>
>   stream.close();
>
> }
>
>
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
> On Tue, Apr 18, 2017 at 2:33 PM, Joe Obernberger <
> [hidden email]> wrote:
>
>> Hi All - any examples of using solrJ and streaming expressions
>> available?  Like calling UpdateStream from solrJ?
>>
>> Thank you!
>>
>> -Joe
>>
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SolrJ and Streaming

Joe Obernberger
In reply to this post by Joel Bernstein
Thank you Joel; exactly what I needed!  Just had to change it to use
CloudSolrStream instead.
Much appreciated!

-Joe


On 4/18/2017 3:21 PM, Joel Bernstein wrote:

> Are you trying to send a streaming expression using SolrJ?
>
> If you are you can send the expression with the SolrStream. for example:
>
> params = new ModifiableSolrParams();
> params.set("expr", expr);
> params.set("qt", "/stream");
> SolrStream stream = new SolrStream(url, paramsLoc);
>
> try {
>
>     stream.open();
>
>     while(true) {
>
>        Tuple tuple = stream.read();
>
>        if(tuple.EOF) {
>
>            break;
>
>        }
>
>     }
>
> } finally {
>
>    stream.close();
>
> }
>
>
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
> On Tue, Apr 18, 2017 at 2:33 PM, Joe Obernberger <
> [hidden email]> wrote:
>
>> Hi All - any examples of using solrJ and streaming expressions available?
>> Like calling UpdateStream from solrJ?
>>
>> Thank you!
>>
>> -Joe
>>
>>

Loading...