Try the same with plain HTTP, queries, and use wt=xml and wt=json, to
see whether the space survives there (remember to view source). If there
is a bug, it could be localised to the solrj case.

Upayavira

On Tue, Feb 5, 2013, at 10:44 AM, Marc Hermann wrote:
> 
> Hi everyone,
> 
> i am new to SOLR and I have experienced a strange behavior:
> 
> I have defined a field called name of type "string". This field contains
> values with trailing spaces such as " John".
> This is intended and the space needs to "survive".
> 
> The space is in the index as I can see when using Luke.
> 
> But when I am retrieving documents from the index using :
> 
>     final CommonsHttpSolrServer sorlServer =
> server.connection(query.retrieveCore());
>     final SolrQuery solrQuery = query.getSolrQuery();
>     final QueryResponse response = sorlServer.query(solrQuery);
> 
>     final Result result = new Result();
>     final SolrDocumentList documents = response.getResults();
> 
> 
> ... I don“t get the spaces (so I get "John") ... as if all values always
> get
> a trim() before they are returned.
> 
> Any suggestions ? 
> Is this a standard behavior ?
> 
> Best regards,
> 
> M. Hermann

Reply via email to