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 "Manepalli, Kalyan" <KA...@orbitz.com> on 2012/12/28 23:19:23 UTC
Override wt parameter
Hi all,
I am in process of upgrading SOLR from 1.4 to 3.6. The clients and the server communicate using SOLRJ. Since SOLRJ uses javabin as response format, I want to change this to xml during the upgrade procees. Since there are multiple clients, I tried modifying the SOLR server to hardcore wt as xml, by modifying the incoming request. But its still not working. Any clues on how to do this?
Any advice in this regard will be really helpful
Thanks
Kalyan
RE: Override wt parameter
Posted by "Manepalli, Kalyan" <KA...@orbitz.com>.
Anyother ideas to resolve this issue would be really helpful.
Thanks
Kalyan
Thanks,
Kalyan Manepalli
-----Original Message-----
From: Manepalli, Kalyan [mailto:KALYAN.MANEPALLI@orbitz.com]
Sent: Friday, December 28, 2012 9:30 PM
To: solr-user@lucene.apache.org
Subject: Re: Override wt parameter
I tried using invariants wt=xml, but it doesn¹t work.
Is anyone tried playing around with SolrCore.java changes?
On 12/28/12 7:17 PM, "Shawn Heisey" <so...@elyograg.org> wrote:
>On 12/28/2012 6:07 PM, Stefan Matheis wrote:
>> Kalyan
>>
>> I didn't test that .. but perhaps it may work out for you --
>>specifying "invariants" (possible per SearchHandler) like it's shown in the wiki:
>>http://wiki.apache.org/solr/SearchHandler#Configuration ?
>
>Stefan, your reply hadn't arrived before I sent my second reply. I
>suspect that if you make wt=xml an invariant option, SolrJ will still
>send wt=javabin and when it gets the response, it will be expecting
>javabin, not xml, which will result in an exception. I could be
>completely wrong; SolrJ may be smart enough, but I suspect that it's not.
>
>Thanks,
>Shawn
>
Re: Override wt parameter
Posted by "Manepalli, Kalyan" <KA...@orbitz.com>.
I tried using invariants wt=xml, but it doesn¹t work.
Is anyone tried playing around with SolrCore.java changes?
On 12/28/12 7:17 PM, "Shawn Heisey" <so...@elyograg.org> wrote:
>On 12/28/2012 6:07 PM, Stefan Matheis wrote:
>> Kalyan
>>
>> I didn't test that .. but perhaps it may work out for you -- specifying
>>"invariants" (possible per SearchHandler) like it's shown in the wiki:
>>http://wiki.apache.org/solr/SearchHandler#Configuration ?
>
>Stefan, your reply hadn't arrived before I sent my second reply. I
>suspect that if you make wt=xml an invariant option, SolrJ will still
>send wt=javabin and when it gets the response, it will be expecting
>javabin, not xml, which will result in an exception. I could be
>completely wrong; SolrJ may be smart enough, but I suspect that it's not.
>
>Thanks,
>Shawn
>
Re: Override wt parameter
Posted by Shawn Heisey <so...@elyograg.org>.
On 12/28/2012 6:07 PM, Stefan Matheis wrote:
> Kalyan
>
> I didn't test that .. but perhaps it may work out for you -- specifying "invariants" (possible per SearchHandler) like it's shown in the wiki: http://wiki.apache.org/solr/SearchHandler#Configuration ?
Stefan, your reply hadn't arrived before I sent my second reply. I
suspect that if you make wt=xml an invariant option, SolrJ will still
send wt=javabin and when it gets the response, it will be expecting
javabin, not xml, which will result in an exception. I could be
completely wrong; SolrJ may be smart enough, but I suspect that it's not.
Thanks,
Shawn
Re: Override wt parameter
Posted by Stefan Matheis <ma...@gmail.com>.
Kalyan
I didn't test that .. but perhaps it may work out for you -- specifying "invariants" (possible per SearchHandler) like it's shown in the wiki: http://wiki.apache.org/solr/SearchHandler#Configuration ?
HTH, Stefan
On Saturday, December 29, 2012 at 1:50 AM, Manepalli, Kalyan wrote:
> Shawn,
> Thanks for the answer. But changing at the server.setParser means
> changing all the clients that are invoking localhost:8983. My goal is that
> clients need not have to make any change. localhost:8983 should hardcore
> xmlParser. Any ideas?
>
> Thanks
> Kalyan
>
> On 12/28/12 5:37 PM, "Shawn Heisey" <solr@elyograg.org (mailto:solr@elyograg.org)> wrote:
>
> > On 12/28/2012 3:19 PM, Manepalli, Kalyan wrote:
> > > Hi all,
> > > I am in process of upgrading SOLR from 1.4 to 3.6. The clients and the
> > > server communicate using SOLRJ. Since SOLRJ uses javabin as response
> > > format, I want to change this to xml during the upgrade procees. Since
> > > there are multiple clients, I tried modifying the SOLR server to
> > > hardcore wt as xml, by modifying the incoming request. But its still not
> > > working. Any clues on how to do this?
> > >
> > > Any advice in this regard will be really helpful
> >
> > Kalyan,
> >
> > Just change the parser right after you create your SolrJ server object.
> > There is no need to worry about manually changing the wt parameter -
> > changing the parser will take care of that for you. This example
> > assumes you're using SolrJ 3.6 - change the object type to
> > CommonsHttpSolrServer if SolrJ is version 1.4.1.
> >
> > String url = "http://localhost:8983/solr"
> > HttpSolrServer server = new HttpSolrServer(url);
> > server.setParser(new XMLResponseParser())
> >
> > https://wiki.apache.org/solr/Solrj#Changing_other_Connection_Settings
> >
> > When you get everything all upgraded to 3.x or later, you can remove the
> > call to setParser.
> >
> > Thanks,
> > Shawn
>
Re: Override wt parameter
Posted by Shawn Heisey <so...@elyograg.org>.
On 12/28/2012 5:50 PM, Manepalli, Kalyan wrote:
> Shawn,
> Thanks for the answer. But changing at the server.setParser means
> changing all the clients that are invoking localhost:8983. My goal is that
> clients need not have to make any change. localhost:8983 should hardcore
> xmlParser. Any ideas?
If you don't set the parser, then SolrJ will send wt=javabin and it
won't work. You have to make the change at the clients.
Re: Override wt parameter
Posted by "Manepalli, Kalyan" <KA...@orbitz.com>.
Shawn,
Thanks for the answer. But changing at the server.setParser means
changing all the clients that are invoking localhost:8983. My goal is that
clients need not have to make any change. localhost:8983 should hardcore
xmlParser. Any ideas?
Thanks
Kalyan
On 12/28/12 5:37 PM, "Shawn Heisey" <so...@elyograg.org> wrote:
>On 12/28/2012 3:19 PM, Manepalli, Kalyan wrote:
>> Hi all,
>> I am in process of upgrading SOLR from 1.4 to 3.6. The clients and the
>>server communicate using SOLRJ. Since SOLRJ uses javabin as response
>>format, I want to change this to xml during the upgrade procees. Since
>>there are multiple clients, I tried modifying the SOLR server to
>>hardcore wt as xml, by modifying the incoming request. But its still not
>>working. Any clues on how to do this?
>>
>> Any advice in this regard will be really helpful
>
>Kalyan,
>
>Just change the parser right after you create your SolrJ server object.
> There is no need to worry about manually changing the wt parameter -
>changing the parser will take care of that for you. This example
>assumes you're using SolrJ 3.6 - change the object type to
>CommonsHttpSolrServer if SolrJ is version 1.4.1.
>
>String url = "http://localhost:8983/solr"
>HttpSolrServer server = new HttpSolrServer(url);
>server.setParser(new XMLResponseParser())
>
>https://wiki.apache.org/solr/Solrj#Changing_other_Connection_Settings
>
>When you get everything all upgraded to 3.x or later, you can remove the
>call to setParser.
>
>Thanks,
>Shawn
>
Re: Override wt parameter
Posted by Shawn Heisey <so...@elyograg.org>.
On 12/28/2012 3:19 PM, Manepalli, Kalyan wrote:
> Hi all,
> I am in process of upgrading SOLR from 1.4 to 3.6. The clients and the server communicate using SOLRJ. Since SOLRJ uses javabin as response format, I want to change this to xml during the upgrade procees. Since there are multiple clients, I tried modifying the SOLR server to hardcore wt as xml, by modifying the incoming request. But its still not working. Any clues on how to do this?
>
> Any advice in this regard will be really helpful
Kalyan,
Just change the parser right after you create your SolrJ server object.
There is no need to worry about manually changing the wt parameter -
changing the parser will take care of that for you. This example
assumes you're using SolrJ 3.6 - change the object type to
CommonsHttpSolrServer if SolrJ is version 1.4.1.
String url = "http://localhost:8983/solr"
HttpSolrServer server = new HttpSolrServer(url);
server.setParser(new XMLResponseParser())
https://wiki.apache.org/solr/Solrj#Changing_other_Connection_Settings
When you get everything all upgraded to 3.x or later, you can remove the
call to setParser.
Thanks,
Shawn