You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by "WU, Zhiqing" <zw...@ennov.com> on 2022/03/23 11:04:49 UTC

Can I insert query result into another collection of the same Solr?

Hello,
I did a query based on one collection and want to insert its result into
another collection of the same Solr. The query result has the same fields
as that of another collection. Is there a simple way to do the job?
If the query result has to be moved outside Solr before being added to
another collection of the same Solr, it would not be very efficient when
the query result is very large.
Relevant information would be welcome.
Kind regards,
Zhiqing

Re: Can I insert query result into another collection of the same Solr?

Posted by Susmit Shukla <sh...@gmail.com>.
Hi Zhiqing,

You can use the 'Stream' menu option on solr console to run the streaming
query. Paste the streaming expression and execute -
Solrj can also execute the expression , here is a page that explains it-
https://lucidworks.com/post/streaming-expressions-in-solrj/

  search(collection1,
         q="*:*",
         qt="/export",
         fl="id,a_s,a_i,a_f",
         sort="a_f asc, a_i asc")


On Wed, Mar 23, 2022 at 4:08 PM WU, Zhiqing <zw...@ennov.com> wrote:

> Hi Susmit,
> Thanks for your reply.
> Since I do not have much experience with the streaming api of solr, I only
> can understand a part of the page and do not know how to implement related
> parts with SolrJ.
> Is it possible you could recommend some books or webpages which contain
> examples for streaming api?
> Looking forward to your reply.
> Kind regards,
> Zhiqing
>
> On Wed, 23 Mar 2022 at 14:34, Susmit <sh...@gmail.com> wrote:
>
> > Hi,
> > you can look at the updatestream from streaming api of solr, it can take
> a
> > search expression and emitted tuples can be added to a new collection.
> >
> > https://solr.apache.org/guide/8_4/stream-decorator-reference.html
> >
> > Sent from my iPhone
> >
> > > On Mar 23, 2022, at 4:06 AM, WU, Zhiqing <zw...@ennov.com> wrote:
> > >
> > > Hello,
> > > I did a query based on one collection and want to insert its result
> into
> > > another collection of the same Solr. The query result has the same
> fields
> > > as that of another collection. Is there a simple way to do the job?
> > > If the query result has to be moved outside Solr before being added to
> > > another collection of the same Solr, it would not be very efficient
> when
> > > the query result is very large.
> > > Relevant information would be welcome.
> > > Kind regards,
> > > Zhiqing
> >
>

Re: Can I insert query result into another collection of the same Solr?

Posted by "WU, Zhiqing" <zw...@ennov.com>.
Hi Susmit,
Thanks for your reply.
Since I do not have much experience with the streaming api of solr, I only
can understand a part of the page and do not know how to implement related
parts with SolrJ.
Is it possible you could recommend some books or webpages which contain
examples for streaming api?
Looking forward to your reply.
Kind regards,
Zhiqing

On Wed, 23 Mar 2022 at 14:34, Susmit <sh...@gmail.com> wrote:

> Hi,
> you can look at the updatestream from streaming api of solr, it can take a
> search expression and emitted tuples can be added to a new collection.
>
> https://solr.apache.org/guide/8_4/stream-decorator-reference.html
>
> Sent from my iPhone
>
> > On Mar 23, 2022, at 4:06 AM, WU, Zhiqing <zw...@ennov.com> wrote:
> >
> > Hello,
> > I did a query based on one collection and want to insert its result into
> > another collection of the same Solr. The query result has the same fields
> > as that of another collection. Is there a simple way to do the job?
> > If the query result has to be moved outside Solr before being added to
> > another collection of the same Solr, it would not be very efficient when
> > the query result is very large.
> > Relevant information would be welcome.
> > Kind regards,
> > Zhiqing
>

Re: Can I insert query result into another collection of the same Solr?

Posted by Susmit <sh...@gmail.com>.
Hi, 
you can look at the updatestream from streaming api of solr, it can take a search expression and emitted tuples can be added to a new collection.

https://solr.apache.org/guide/8_4/stream-decorator-reference.html

Sent from my iPhone

> On Mar 23, 2022, at 4:06 AM, WU, Zhiqing <zw...@ennov.com> wrote:
> 
> Hello,
> I did a query based on one collection and want to insert its result into
> another collection of the same Solr. The query result has the same fields
> as that of another collection. Is there a simple way to do the job?
> If the query result has to be moved outside Solr before being added to
> another collection of the same Solr, it would not be very efficient when
> the query result is very large.
> Relevant information would be welcome.
> Kind regards,
> Zhiqing