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 Pushkar Raste <pu...@gmail.com> on 2019/01/24 00:05:47 UTC

API to convert a SolrInputDocument to JSON

Hi,
We are setting up cluster with new version Solr and going to reindex data.
However, until all the data is indexed I need keep indexing data in the old
cluster as well. We are currently using the Solrj client and constructing
SolrInputDocument objects to index data.

 To avoid conflicts with the old and new jars, I am planning to use
HttpClient and json payload . Is there a convenient API to convert a
SolrInputDocument to json

Re: API to convert a SolrInputDocument to JSON

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/24/2019 5:06 PM, Pushkar Raste wrote:
> May be my questions wasn’t clear. By issues I meant will Solrj client for
> 7.x work to index documents in Solr 4.10 or vice versa.

With HttpSolrClient, I would generally expect very good compatibility 
from 7.x to 4.x.  I have done it with no problems.

It would be a bad idea to try such a wide version gap with CloudSolrClient.

For all clients, when the versions are different, it is better to use a 
newer client.

Thanks,
Shawn

Re: API to convert a SolrInputDocument to JSON

Posted by Pushkar Raste <pu...@gmail.com>.
May be my questions wasn’t clear. By issues I meant will Solrj client for
7.x work to index documents in Solr 4.10 or vice versa.

I am OK to use HttpSolrClient

On Wed, Jan 23, 2019 at 9:33 PM Erick Erickson <er...@gmail.com>
wrote:

> Walter:
>
> Don't know if it helps, but have you looked at:
> https://issues.apache.org/jira/browse/SOLR-445
>
> I have _not_ worked with this personally in prod SolrCloud systems, so
> I can't say much more
> than it exists. It's only available in Solr 6.1+....
>
> Best,
> Erick
>
> On Wed, Jan 23, 2019 at 5:55 PM Pushkar Raste <pu...@gmail.com>
> wrote:
> >
> > You mean I can use SolrJ 7.x for both indexing documents to both Solr 4
> and
> > Solr 7 as well as the SolrInputDocument class from Solrj 7.x
> >
> > Wouldn’t there be issues if there are any backwards incompatible changes.
> >
> > On Wed, Jan 23, 2019 at 8:09 PM Shawn Heisey <ap...@elyograg.org>
> wrote:
> >
> > > On 1/23/2019 5:49 PM, Pushkar Raste wrote:
> > > > Thanks for the quick response Shawn. It is migrating ion from Solr
> 4.10
> > > > master/slave to Solr Cloud 7.x
> > >
> > > In that case, use SolrJ 7.x, with CloudSolrClient to talk to the new
> > > version and HttpSolrClient to talk to the old version. Use the same
> > > SolrInputDocument objects for both.
> > >
> > > Thanks,
> > > Shawn
> > >
> > >
>

Re: API to convert a SolrInputDocument to JSON

Posted by Erick Erickson <er...@gmail.com>.
Walter:

Don't know if it helps, but have you looked at:
https://issues.apache.org/jira/browse/SOLR-445

I have _not_ worked with this personally in prod SolrCloud systems, so
I can't say much more
than it exists. It's only available in Solr 6.1+....

Best,
Erick

On Wed, Jan 23, 2019 at 5:55 PM Pushkar Raste <pu...@gmail.com> wrote:
>
> You mean I can use SolrJ 7.x for both indexing documents to both Solr 4 and
> Solr 7 as well as the SolrInputDocument class from Solrj 7.x
>
> Wouldn’t there be issues if there are any backwards incompatible changes.
>
> On Wed, Jan 23, 2019 at 8:09 PM Shawn Heisey <ap...@elyograg.org> wrote:
>
> > On 1/23/2019 5:49 PM, Pushkar Raste wrote:
> > > Thanks for the quick response Shawn. It is migrating ion from Solr 4.10
> > > master/slave to Solr Cloud 7.x
> >
> > In that case, use SolrJ 7.x, with CloudSolrClient to talk to the new
> > version and HttpSolrClient to talk to the old version. Use the same
> > SolrInputDocument objects for both.
> >
> > Thanks,
> > Shawn
> >
> >

Re: API to convert a SolrInputDocument to JSON

Posted by Pushkar Raste <pu...@gmail.com>.
You mean I can use SolrJ 7.x for both indexing documents to both Solr 4 and
Solr 7 as well as the SolrInputDocument class from Solrj 7.x

Wouldn’t there be issues if there are any backwards incompatible changes.

On Wed, Jan 23, 2019 at 8:09 PM Shawn Heisey <ap...@elyograg.org> wrote:

> On 1/23/2019 5:49 PM, Pushkar Raste wrote:
> > Thanks for the quick response Shawn. It is migrating ion from Solr 4.10
> > master/slave to Solr Cloud 7.x
>
> In that case, use SolrJ 7.x, with CloudSolrClient to talk to the new
> version and HttpSolrClient to talk to the old version. Use the same
> SolrInputDocument objects for both.
>
> Thanks,
> Shawn
>
>

Re: API to convert a SolrInputDocument to JSON

Posted by Walter Underwood <wu...@wunderwood.org>.
Only use CloudSolrClient if you don’t care about the error return from updates. For us, that is a fatal flaw that makes CloudSolrClient unacceptable for prod use.

We use HttpSolrClient directed at the load balancer for the cluster and I haven’t noticed any speed issues. I expect that forwarding a document ot the right leader is a small overhead.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Jan 23, 2019, at 5:09 PM, Shawn Heisey <ap...@elyograg.org> wrote:
> 
> On 1/23/2019 5:49 PM, Pushkar Raste wrote:
>> Thanks for the quick response Shawn. It is migrating ion from Solr 4.10
>> master/slave to Solr Cloud 7.x
> 
> In that case, use SolrJ 7.x, with CloudSolrClient to talk to the new version and HttpSolrClient to talk to the old version. Use the same SolrInputDocument objects for both.
> 
> Thanks,
> Shawn
> 


Re: API to convert a SolrInputDocument to JSON

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/23/2019 5:49 PM, Pushkar Raste wrote:
> Thanks for the quick response Shawn. It is migrating ion from Solr 4.10
> master/slave to Solr Cloud 7.x

In that case, use SolrJ 7.x, with CloudSolrClient to talk to the new 
version and HttpSolrClient to talk to the old version. Use the same 
SolrInputDocument objects for both.

Thanks,
Shawn


Re: API to convert a SolrInputDocument to JSON

Posted by Pushkar Raste <pu...@gmail.com>.
Thanks for the quick response Shawn. It is migrating ion from Solr 4.10
master/slave to Solr Cloud 7.x

On Wed, Jan 23, 2019 at 7:41 PM Shawn Heisey <ap...@elyograg.org> wrote:

> On 1/23/2019 5:05 PM, Pushkar Raste wrote:
> > We are setting up cluster with new version Solr and going to reindex
> data.
> > However, until all the data is indexed I need keep indexing data in the
> old
> > cluster as well. We are currently using the Solrj client and constructing
> > SolrInputDocument objects to index data.
> >
> >   To avoid conflicts with the old and new jars, I am planning to use
> > HttpClient and json payload . Is there a convenient API to convert a
> > SolrInputDocument to json
>
> First question: Is this SolrCloud?  If so, are both versions running
> SolrCloud?
>
> Second question: What are the old and new Solr versions on the server side?
>
> The answers to those questions will determine where I go with further
> questions and assistance.
>
> Thanks,
> Shawn
>
>

Re: API to convert a SolrInputDocument to JSON

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/23/2019 5:05 PM, Pushkar Raste wrote:
> We are setting up cluster with new version Solr and going to reindex data.
> However, until all the data is indexed I need keep indexing data in the old
> cluster as well. We are currently using the Solrj client and constructing
> SolrInputDocument objects to index data.
>
>   To avoid conflicts with the old and new jars, I am planning to use
> HttpClient and json payload . Is there a convenient API to convert a
> SolrInputDocument to json

First question: Is this SolrCloud?  If so, are both versions running 
SolrCloud?

Second question: What are the old and new Solr versions on the server side?

The answers to those questions will determine where I go with further 
questions and assistance.

Thanks,
Shawn