[ 
https://issues.apache.org/jira/browse/SOLR-807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12640748#action_12640748
 ] 

Noble Paul commented on SOLR-807:
---------------------------------

bq.NamedListCodec could have pass a special TextResponseWriter...
Not a godd idea. On the client side it may not know how to deserialize it. 
Moreover , Binary format is very fragile and it can break the output because 
each bit is significant. Every byte that is written out must use NamedListCodec.
bq.NamedListCodec maintains it's current list of efficient encodings for common 
types, but uses FieldType.toExternal() to generate a String to send over the 
wire (instead of using toObject) in non-common cases.
make sense. 

bq.we add a new "toSimpleObject(Fieldable)" method to FieldType,
Problem is not with writing out. How to deserialize it at the other end of the 
pipe. 

String representation is the most convenient form for everyone. Even with xml 
we write out everything as a String <str></str>, just that the the content 
format of the string type is decided by the FieldType. If toString() is 
implemented properly by the Object it should be fine.

We may not be able to support all the user defined types. But , we must be able 
to support all the types which we know of.

> UUIDField type cannot be recognized when wt=javabin is used
> -----------------------------------------------------------
>
>                 Key: SOLR-807
>                 URL: https://issues.apache.org/jira/browse/SOLR-807
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java, search
>    Affects Versions: 1.3
>            Reporter: Koji Sekiguchi
>            Priority: Trivial
>             Fix For: 1.3.1
>
>         Attachments: SOLR-807.patch
>
>
> I'm using UUID via Solrj in my project. When I use javabin (default), I got:
> *java.util.UUID:* 391e3214-4f8e-4abd-aa6b-4f12be79534f
> as the uuid value. But if I use xml, I got:
> 391e3214-4f8e-4abd-aa6b-4f12be79534f
> I think the both of them should return same string.
> program for reproducing the problem:
> {code:java}
>   public static void main(String[] args) throws Exception {
>     CommonsHttpSolrServer server = new CommonsHttpSolrServer( 
> "http://localhost:8983/solr"; );
>     SolrQuery query = new SolrQuery().setQuery( "*:*" );
>     //server.setParser( new XMLResponseParser() );   // uncomment for wt=xml
>     System.out.println( "===== " + 
> server.getParser().getClass().getSimpleName() + " =====" );
>     QueryResponse rsp = server.query( query );
>     SolrDocumentList docs = rsp.getResults();
>     for( SolrDocument doc : docs ){
>       Object id = doc.getFieldValue( "id" );
>       System.out.println( "type = " + id.getClass().getName() + ", id = " + 
> id );
>       Object timestamp = doc.getFieldValue( "timestamp" );
>       System.out.println( "type = " + timestamp.getClass().getName() + ", 
> timestamp = " + timestamp );
>     }
>   }
> {code}
> result for wt=javabin
> {code:title=javabin}
> ===== BinaryResponseParser =====
> type = java.lang.String, id = 
> java.util.UUID:391e3214-4f8e-4abd-aa6b-4f12be79534f
> type = java.util.Date, timestamp = Wed Oct 15 00:20:50 JST 2008
> {code}
> result for wt=xml
> {code:title=xml}
> ===== XMLResponseParser =====
> type = java.lang.String, id = 391e3214-4f8e-4abd-aa6b-4f12be79534f
> type = java.util.Date, timestamp = Wed Oct 15 00:20:50 JST 2008
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to