Thanks for the reply Noble Paul.
In my application I will be having multiple types of object and the number
of properties in each object will vary.
So I have made them as FieldType and defined in schema.xml also

How do I store  the POJO without declaring it as a FieldType?
Solr needs to recognize a type right?



Noble Paul നോബിള്‍  नोब्ळ् wrote:
> 
> why is the POJO extending FieldType?
> it does not have to.
> 
> composite types are not supported.because Solr cannot support that.
> But the field can be a List or array.
> 
> On Thu, Apr 2, 2009 at 5:00 PM, Praveen Kumar Jayaram
> <praveen198...@gmail.com> wrote:
>>
>> Could someone give suggestions for this issue?
>>
>>
>> Praveen Kumar Jayaram wrote:
>>>
>>> Hi
>>>
>>> I am trying to have a complex POJO type in Solr 1.3
>>> i.e Object inside object.
>>>
>>> Below is a sample Field created,
>>>
>>> public class TestType extends FieldType{
>>>     @Field
>>>     private String requestorID_s_i_s_nm;
>>>
>>>     @Field
>>>     private String partNumber;
>>>
>>>     @Field
>>>     private String requestorName_s_i_s_nm;
>>>
>>>     @Field
>>>     private InnerType innerType;
>>> }
>>>
>>> Where InnerType is another custom Java type.
>>>
>>> public class InnerType extends FieldType{
>>>       private String name_s_i_s_nm;
>>> }
>>>
>>>
>>> The schema configuration is as shown below,
>>>
>>> ....
>>> <fieldType name="TestType" class="com.abc.lucene.TestType"
>>> sortMissingLast="true" omitNorms="true"/>
>>> <fieldType name="InnerType" class="com.abc.lucene.InnerType"
>>> sortMissingLast="true" omitNorms="true"/>
>>> ....
>>> ....
>>>
>>> When I try to add an TestType POJO using below code, am getting unkown
>>> field "innerType" error,
>>>
>>> String url = "http://localhost:8983/solr";;
>>> SolrServer server = new CommonsHttpSolrServer( url );
>>>
>>> InnerType inner = new InnerType();
>>> inner.setName_s_i_s_nm("Test");
>>>
>>> TestType praveen = new TestType();
>>> praveen.setPartNumber("000001-0001");
>>> praveen.setRequestorID_s_i_s_nm("1111");
>>> praveen.setRequestorName_s_i_s_nm("Praveen Kumar Jayaram");
>>> praveen.setInnerType(inner);
>>>
>>> server.addBean(praveen);
>>> UpdateRequest req = new UpdateRequest();
>>> req.setAction( UpdateRequest.ACTION.COMMIT, false, false );
>>> UpdateResponse res = req.process(server);
>>>
>>> Initially POJO was getting added when it was not composite POJO.
>>> After trying to have composite POJO things are not working.
>>> What is that I am doing wrong??
>>>
>>> Any help will be appreciated.
>>>
>>>
>>>
>>
>>
>> -----
>> Regards,
>> Praveen
>> --
>> View this message in context:
>> http://www.nabble.com/Composite-POJO-support-tp22841854p22845799.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> --Noble Paul
> 
> 


-----
Regards,
Praveen
-- 
View this message in context: 
http://www.nabble.com/Composite-POJO-support-tp22841854p22862433.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to