QueryResponse rsp = commonsHttpSolrServer.query( mySolrQuery);
MySerializableType obj  = rsp.getResponse().get("myresult");

In the code - the API referred to is -

http://lucene.apache.org/solr/api/org/apache/solr/common/util/NamedList.html#get(java.lang.String)
 .

That seems to return any object of type T , as per the API .

So  - is there any Solr code that I can look at - that imposes the
restriction that the type has to be an int, string ,List (of what
allowed objects ? ) . Map ( allowed key, value types ? )  etc.




On Sun, Mar 8, 2009 at 2:18 AM, Shalin Shekhar Mangar
<shalinman...@gmail.com> wrote:
> On Sun, Mar 8, 2009 at 5:34 AM, Rakesh Sinha <rakesh.use...@gmail.com>wrote:
>
>>
>> client:
>> --------
>> QueryResponse rsp = commonsHttpSolrServer.query( mySolrQuery);
>> MySerializableType obj  = rsp.getResponse().get("myresult");
>>
>> I was curious if the above mentioned code would work for any kind of
>> serializable type , T, as long as it implements Serializable . Would
>> there be any restrictions on the same (like only List of Strings -
>> List of Integers etc).
>> Thanks.
>>
>
> No, the returned object is a NamedList data structure. It can contain the
> basic java types (int/float etc.), strings, lists, maps and a couple of Solr
> specific objects such as SolrDocumentList, SolrDocument
>
> http://lucene.apache.org/solr/api/solrj/org/apache/solr/common/util/NamedList.html
> --
> Regards,
> Shalin Shekhar Mangar.
>

Reply via email to