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 Ranjeet <ra...@ebusinessware.com> on 2008/07/30 14:20:26 UTC

Query regarding saving of Document and indexing in java

Hi,

In our case Application and Solr are running in different server in different system. I am trying to prepare the Document from Application to save xml document in solr context and indexing the same document from our Application. Any one has idea, how to save in different IP and how to index the same document in defferent system. Our Application is Java/j2ee( in Spring framework) based. It would be great if you send the code/idea to resolve this.

Thanks & Regards,
Ranjeet

Re: Query regarding saving of Document and indexing in java

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Hi Ranjeet,

If you are using Solr 1.2 then you must use the step given in the wiki link
else you can also upgrade to Solr 1.3 nightly build.

On Thu, Jul 31, 2008 at 11:12 AM, Ranjeet <ra...@ebusinessware.com>wrote:

> Hi,
>
> I have refer the same section, I mean "
> http://wiki.apache.org/solr/Solrj#head-12c26b2d7806432c88b26cf66e236e9bd6e91849
> " and wrote a client to index the document, I am getting follwoing
> exception. I am new to Solr, Please help me, If I will switch to Solr1.3
> from Solr1.2, can I resolve this issue. Exceptoions are:
>
> java.lang.ClassCastException: java.lang.Long
>
> at
> org.apache.solr.common.util.NamedListCodec.unmarshal(NamedListCodec.java:86)
>
> at
> org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse(BinaryResponseParser.java:39)
>
> at
> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:353)
>
> at
> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:155)
>
> at
> org.apache.solr.client.solrj.request.UpdateRequest.process(UpdateRequest.java:226)
>
> at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:64)
>
> at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:72)
>
> at
> com.xonos.ecommerce.search.web.action.DocumentSolrJ.indexDocument(DocumentSolrJ.java:113)
>
> at
> com.xonos.ecommerce.search.web.action.DocumentSolrJ.main(DocumentSolrJ.java:30)
>
> ----- Original Message ----- From: "Noble Paul ??????? ??????" <
> noble.paul@gmail.com>
> To: <so...@lucene.apache.org>
> Sent: Thursday, July 31, 2008 9:49 AM
>
> Subject: Re: Query regarding saving of Document and indexing in java
>
>
>  If you are using SolrJ with Solr1.2 , refer the section
>>
>>
>> http://wiki.apache.org/solr/Solrj#head-12c26b2d7806432c88b26cf66e236e9bd6e91849
>>
>>
>>
>> On Thu, Jul 31, 2008 at 8:45 AM, Ranjeet <ra...@ebusinessware.com>
>> wrote:
>>
>>> Hi,
>>>
>>> At present its Solr1.2.. Is there any defference in indexing of document
>>> in
>>> Solr1.2 or Solr1.3, If we plan to migrate from solr1.2 to Solr1.3 then
>>> what
>>> are the changing required?
>>>
>>> regards,
>>> Ranjeet
>>>
>>> ----- Original Message ----- From: "Noble Paul ??????? ??????"
>>> <no...@gmail.com>
>>> To: <so...@lucene.apache.org>
>>> Sent: Wednesday, July 30, 2008 10:16 PM
>>> Subject: Re: Query regarding saving of Document and indexing in java
>>>
>>>
>>>  is the server Solr1.2 or Solr1.3?
>>>>
>>>> On Wed, Jul 30, 2008 at 9:57 PM, Ranjeet <ranjeet.jha@ebusinessware.com
>>>> >
>>>> wrote:
>>>>
>>>>>
>>>>> Hi Shalin,
>>>>>
>>>>> I have written Client to index the document, but unfortunatly getting
>>>>> an
>>>>> exception. I have attached source code of client and exception, please
>>>>> guide
>>>>> me where I am doing mistake. getting "java.lang.ClassCastException:
>>>>> java.lang.Long"
>>>>>
>>>>> Thanks & Regards,
>>>>> Ranjeet
>>>>>
>>>>>
>>>>> ----- Original Message ----- From: "Shalin Shekhar Mangar"
>>>>> <sh...@gmail.com>
>>>>> To: <so...@lucene.apache.org>
>>>>> Sent: Wednesday, July 30, 2008 6:24 PM
>>>>> Subject: Re: Query regarding saving of Document and indexing in java
>>>>>
>>>>>
>>>>>  Hi Ranjeet,
>>>>>>
>>>>>> You can use Solrj which is a java client for Solr.
>>>>>>
>>>>>> See http://wiki.apache.org/solr/Solrj for more details.
>>>>>>
>>>>>> On Wed, Jul 30, 2008 at 5:50 PM, Ranjeet
>>>>>> <ra...@ebusinessware.com>wrote:
>>>>>>
>>>>>>  Hi,
>>>>>>>
>>>>>>> In our case Application and Solr are running in different server in
>>>>>>> different system. I am trying to prepare the Document from
>>>>>>> Application
>>>>>>> to
>>>>>>> save xml document in solr context and indexing the same document from
>>>>>>> our
>>>>>>> Application. Any one has idea, how to save in different IP and how to
>>>>>>> index
>>>>>>> the same document in defferent system. Our Application is Java/j2ee(
>>>>>>> in
>>>>>>> Spring framework) based. It would be great if you send the code/idea
>>>>>>> to
>>>>>>> resolve this.
>>>>>>>
>>>>>>> Thanks & Regards,
>>>>>>> Ranjeet
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> Shalin Shekhar Mangar.
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> --Noble Paul
>>>>
>>>
>>>
>>>
>>
>>
>> --
>> --Noble Paul
>>
>
>


-- 
Regards,
Shalin Shekhar Mangar.

Re: Query regarding saving of Document and indexing in java

Posted by Ranjeet <ra...@ebusinessware.com>.
Hi,

I have refer the same section, I mean 
"http://wiki.apache.org/solr/Solrj#head-12c26b2d7806432c88b26cf66e236e9bd6e91849
" and wrote a client to index the document, I am getting follwoing 
exception. I am new to Solr, Please help me, If I will switch to Solr1.3 
from Solr1.2, can I resolve this issue. Exceptoions are:

java.lang.ClassCastException: java.lang.Long

at 
org.apache.solr.common.util.NamedListCodec.unmarshal(NamedListCodec.java:86)

at 
org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse(BinaryResponseParser.java:39)

at 
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:353)

at 
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:155)

at 
org.apache.solr.client.solrj.request.UpdateRequest.process(UpdateRequest.java:226)

at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:64)

at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:72)

at 
com.xonos.ecommerce.search.web.action.DocumentSolrJ.indexDocument(DocumentSolrJ.java:113)

at 
com.xonos.ecommerce.search.web.action.DocumentSolrJ.main(DocumentSolrJ.java:30)

----- Original Message ----- 
From: "Noble Paul ??????? ??????" <no...@gmail.com>
To: <so...@lucene.apache.org>
Sent: Thursday, July 31, 2008 9:49 AM
Subject: Re: Query regarding saving of Document and indexing in java


> If you are using SolrJ with Solr1.2 , refer the section
>
> http://wiki.apache.org/solr/Solrj#head-12c26b2d7806432c88b26cf66e236e9bd6e91849
>
>
>
> On Thu, Jul 31, 2008 at 8:45 AM, Ranjeet <ra...@ebusinessware.com> 
> wrote:
>> Hi,
>>
>> At present its Solr1.2.. Is there any defference in indexing of document 
>> in
>> Solr1.2 or Solr1.3, If we plan to migrate from solr1.2 to Solr1.3 then 
>> what
>> are the changing required?
>>
>> regards,
>> Ranjeet
>>
>> ----- Original Message ----- From: "Noble Paul ??????? ??????"
>> <no...@gmail.com>
>> To: <so...@lucene.apache.org>
>> Sent: Wednesday, July 30, 2008 10:16 PM
>> Subject: Re: Query regarding saving of Document and indexing in java
>>
>>
>>> is the server Solr1.2 or Solr1.3?
>>>
>>> On Wed, Jul 30, 2008 at 9:57 PM, Ranjeet <ra...@ebusinessware.com>
>>> wrote:
>>>>
>>>> Hi Shalin,
>>>>
>>>> I have written Client to index the document, but unfortunatly getting 
>>>> an
>>>> exception. I have attached source code of client and exception, please
>>>> guide
>>>> me where I am doing mistake. getting "java.lang.ClassCastException:
>>>> java.lang.Long"
>>>>
>>>> Thanks & Regards,
>>>> Ranjeet
>>>>
>>>>
>>>> ----- Original Message ----- From: "Shalin Shekhar Mangar"
>>>> <sh...@gmail.com>
>>>> To: <so...@lucene.apache.org>
>>>> Sent: Wednesday, July 30, 2008 6:24 PM
>>>> Subject: Re: Query regarding saving of Document and indexing in java
>>>>
>>>>
>>>>> Hi Ranjeet,
>>>>>
>>>>> You can use Solrj which is a java client for Solr.
>>>>>
>>>>> See http://wiki.apache.org/solr/Solrj for more details.
>>>>>
>>>>> On Wed, Jul 30, 2008 at 5:50 PM, Ranjeet
>>>>> <ra...@ebusinessware.com>wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> In our case Application and Solr are running in different server in
>>>>>> different system. I am trying to prepare the Document from 
>>>>>> Application
>>>>>> to
>>>>>> save xml document in solr context and indexing the same document from
>>>>>> our
>>>>>> Application. Any one has idea, how to save in different IP and how to
>>>>>> index
>>>>>> the same document in defferent system. Our Application is 
>>>>>> Java/j2ee( in
>>>>>> Spring framework) based. It would be great if you send the code/idea 
>>>>>> to
>>>>>> resolve this.
>>>>>>
>>>>>> Thanks & Regards,
>>>>>> Ranjeet
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Shalin Shekhar Mangar.
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> --Noble Paul
>>
>>
>
>
>
> -- 
> --Noble Paul 


Re: Query regarding saving of Document and indexing in java

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
If you are using SolrJ with Solr1.2 , refer the section

http://wiki.apache.org/solr/Solrj#head-12c26b2d7806432c88b26cf66e236e9bd6e91849



On Thu, Jul 31, 2008 at 8:45 AM, Ranjeet <ra...@ebusinessware.com> wrote:
> Hi,
>
> At present its Solr1.2.. Is there any defference in indexing of document in
> Solr1.2 or Solr1.3, If we plan to migrate from solr1.2 to Solr1.3 then what
> are the changing required?
>
> regards,
> Ranjeet
>
> ----- Original Message ----- From: "Noble Paul ??????? ??????"
> <no...@gmail.com>
> To: <so...@lucene.apache.org>
> Sent: Wednesday, July 30, 2008 10:16 PM
> Subject: Re: Query regarding saving of Document and indexing in java
>
>
>> is the server Solr1.2 or Solr1.3?
>>
>> On Wed, Jul 30, 2008 at 9:57 PM, Ranjeet <ra...@ebusinessware.com>
>> wrote:
>>>
>>> Hi Shalin,
>>>
>>> I have written Client to index the document, but unfortunatly getting an
>>> exception. I have attached source code of client and exception, please
>>> guide
>>> me where I am doing mistake. getting "java.lang.ClassCastException:
>>> java.lang.Long"
>>>
>>> Thanks & Regards,
>>> Ranjeet
>>>
>>>
>>> ----- Original Message ----- From: "Shalin Shekhar Mangar"
>>> <sh...@gmail.com>
>>> To: <so...@lucene.apache.org>
>>> Sent: Wednesday, July 30, 2008 6:24 PM
>>> Subject: Re: Query regarding saving of Document and indexing in java
>>>
>>>
>>>> Hi Ranjeet,
>>>>
>>>> You can use Solrj which is a java client for Solr.
>>>>
>>>> See http://wiki.apache.org/solr/Solrj for more details.
>>>>
>>>> On Wed, Jul 30, 2008 at 5:50 PM, Ranjeet
>>>> <ra...@ebusinessware.com>wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> In our case Application and Solr are running in different server in
>>>>> different system. I am trying to prepare the Document from Application
>>>>> to
>>>>> save xml document in solr context and indexing the same document from
>>>>> our
>>>>> Application. Any one has idea, how to save in different IP and how to
>>>>> index
>>>>> the same document in defferent system. Our Application is Java/j2ee( in
>>>>> Spring framework) based. It would be great if you send the code/idea to
>>>>> resolve this.
>>>>>
>>>>> Thanks & Regards,
>>>>> Ranjeet
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>> Shalin Shekhar Mangar.
>>>>
>>>
>>
>>
>>
>> --
>> --Noble Paul
>
>



-- 
--Noble Paul

Re: Query regarding saving of Document and indexing in java

Posted by Ranjeet <ra...@ebusinessware.com>.
Hi,

At present its Solr1.2.. Is there any defference in indexing of document in 
Solr1.2 or Solr1.3, If we plan to migrate from solr1.2 to Solr1.3 then what 
are the changing required?

regards,
Ranjeet

----- Original Message ----- 
From: "Noble Paul ??????? ??????" <no...@gmail.com>
To: <so...@lucene.apache.org>
Sent: Wednesday, July 30, 2008 10:16 PM
Subject: Re: Query regarding saving of Document and indexing in java


> is the server Solr1.2 or Solr1.3?
>
> On Wed, Jul 30, 2008 at 9:57 PM, Ranjeet <ra...@ebusinessware.com> 
> wrote:
>> Hi Shalin,
>>
>> I have written Client to index the document, but unfortunatly getting an
>> exception. I have attached source code of client and exception, please 
>> guide
>> me where I am doing mistake. getting "java.lang.ClassCastException:
>> java.lang.Long"
>>
>> Thanks & Regards,
>> Ranjeet
>>
>>
>> ----- Original Message ----- From: "Shalin Shekhar Mangar"
>> <sh...@gmail.com>
>> To: <so...@lucene.apache.org>
>> Sent: Wednesday, July 30, 2008 6:24 PM
>> Subject: Re: Query regarding saving of Document and indexing in java
>>
>>
>>> Hi Ranjeet,
>>>
>>> You can use Solrj which is a java client for Solr.
>>>
>>> See http://wiki.apache.org/solr/Solrj for more details.
>>>
>>> On Wed, Jul 30, 2008 at 5:50 PM, Ranjeet
>>> <ra...@ebusinessware.com>wrote:
>>>
>>>> Hi,
>>>>
>>>> In our case Application and Solr are running in different server in
>>>> different system. I am trying to prepare the Document from Application 
>>>> to
>>>> save xml document in solr context and indexing the same document from 
>>>> our
>>>> Application. Any one has idea, how to save in different IP and how to
>>>> index
>>>> the same document in defferent system. Our Application is Java/j2ee( in
>>>> Spring framework) based. It would be great if you send the code/idea to
>>>> resolve this.
>>>>
>>>> Thanks & Regards,
>>>> Ranjeet
>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Shalin Shekhar Mangar.
>>>
>>
>
>
>
> -- 
> --Noble Paul 


Re: Query regarding saving of Document and indexing in java

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
is the server Solr1.2 or Solr1.3?

On Wed, Jul 30, 2008 at 9:57 PM, Ranjeet <ra...@ebusinessware.com> wrote:
> Hi Shalin,
>
> I have written Client to index the document, but unfortunatly getting an
> exception. I have attached source code of client and exception, please guide
> me where I am doing mistake. getting "java.lang.ClassCastException:
> java.lang.Long"
>
> Thanks & Regards,
> Ranjeet
>
>
> ----- Original Message ----- From: "Shalin Shekhar Mangar"
> <sh...@gmail.com>
> To: <so...@lucene.apache.org>
> Sent: Wednesday, July 30, 2008 6:24 PM
> Subject: Re: Query regarding saving of Document and indexing in java
>
>
>> Hi Ranjeet,
>>
>> You can use Solrj which is a java client for Solr.
>>
>> See http://wiki.apache.org/solr/Solrj for more details.
>>
>> On Wed, Jul 30, 2008 at 5:50 PM, Ranjeet
>> <ra...@ebusinessware.com>wrote:
>>
>>> Hi,
>>>
>>> In our case Application and Solr are running in different server in
>>> different system. I am trying to prepare the Document from Application to
>>> save xml document in solr context and indexing the same document from our
>>> Application. Any one has idea, how to save in different IP and how to
>>> index
>>> the same document in defferent system. Our Application is Java/j2ee( in
>>> Spring framework) based. It would be great if you send the code/idea to
>>> resolve this.
>>>
>>> Thanks & Regards,
>>> Ranjeet
>>
>>
>>
>>
>> --
>> Regards,
>> Shalin Shekhar Mangar.
>>
>



-- 
--Noble Paul

Re: Query regarding saving of Document and indexing in java

Posted by Fuad Efendi <fu...@efendi.ca>.
Verify that schema.xml and your document fields are in-sync...
Your stacktrace looks strange...  
NamedListCodec.unmarshal(NamedListCodec.java:86) - where is  
java.lang.Long?



Quoting Ranjeet <ra...@ebusinessware.com>:

> Hi Shalin,
>
> I have written Client to index the document, but unfortunatly getting
> an exception. I have attached source code of client and exception,
> please guide me where I am doing mistake. getting
> "java.lang.ClassCastException: java.lang.Long"
>
> Thanks & Regards,
> Ranjeet
>
>
> ----- Original Message ----- From: "Shalin Shekhar Mangar"
> <sh...@gmail.com>
> To: <so...@lucene.apache.org>
> Sent: Wednesday, July 30, 2008 6:24 PM
> Subject: Re: Query regarding saving of Document and indexing in java
>
>
>> Hi Ranjeet,
>>
>> You can use Solrj which is a java client for Solr.
>>
>> See http://wiki.apache.org/solr/Solrj for more details.
>>
>> On Wed, Jul 30, 2008 at 5:50 PM, Ranjeet   
>> <ra...@ebusinessware.com>wrote:
>>
>>> Hi,
>>>
>>> In our case Application and Solr are running in different server in
>>> different system. I am trying to prepare the Document from Application to
>>> save xml document in solr context and indexing the same document from our
>>> Application. Any one has idea, how to save in different IP and how to index
>>> the same document in defferent system. Our Application is Java/j2ee( in
>>> Spring framework) based. It would be great if you send the code/idea to
>>> resolve this.
>>>
>>> Thanks & Regards,
>>> Ranjeet
>>
>>
>>
>>
>> -- 
>> Regards,
>> Shalin Shekhar Mangar.
>>




Re: Query regarding saving of Document and indexing in java

Posted by Ranjeet <ra...@ebusinessware.com>.
Hi Shalin,

I have written Client to index the document, but unfortunatly getting an 
exception. I have attached source code of client and exception, please guide 
me where I am doing mistake. getting "java.lang.ClassCastException: 
java.lang.Long"

Thanks & Regards,
Ranjeet


----- Original Message ----- 
From: "Shalin Shekhar Mangar" <sh...@gmail.com>
To: <so...@lucene.apache.org>
Sent: Wednesday, July 30, 2008 6:24 PM
Subject: Re: Query regarding saving of Document and indexing in java


> Hi Ranjeet,
>
> You can use Solrj which is a java client for Solr.
>
> See http://wiki.apache.org/solr/Solrj for more details.
>
> On Wed, Jul 30, 2008 at 5:50 PM, Ranjeet 
> <ra...@ebusinessware.com>wrote:
>
>> Hi,
>>
>> In our case Application and Solr are running in different server in
>> different system. I am trying to prepare the Document from Application to
>> save xml document in solr context and indexing the same document from our
>> Application. Any one has idea, how to save in different IP and how to 
>> index
>> the same document in defferent system. Our Application is Java/j2ee( in
>> Spring framework) based. It would be great if you send the code/idea to
>> resolve this.
>>
>> Thanks & Regards,
>> Ranjeet
>
>
>
>
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 

Re: Query regarding saving of Document and indexing in java

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Hi Ranjeet,

You can use Solrj which is a java client for Solr.

See http://wiki.apache.org/solr/Solrj for more details.

On Wed, Jul 30, 2008 at 5:50 PM, Ranjeet <ra...@ebusinessware.com>wrote:

> Hi,
>
> In our case Application and Solr are running in different server in
> different system. I am trying to prepare the Document from Application to
> save xml document in solr context and indexing the same document from our
> Application. Any one has idea, how to save in different IP and how to index
> the same document in defferent system. Our Application is Java/j2ee( in
> Spring framework) based. It would be great if you send the code/idea to
> resolve this.
>
> Thanks & Regards,
> Ranjeet




-- 
Regards,
Shalin Shekhar Mangar.