lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frederic Hennequin (JIRA)" <>
Subject [jira] Commented: (SOLR-20) A simple Java client for updating and searching
Date Wed, 07 Mar 2007 16:28:24 GMT


Frederic Hennequin commented on SOLR-20:

Hello, we have been testing the solr-client and think we have found a small bug :

the xml parsers on the query-side is not setup to use "UTF-8" encoding
this resulted in weird characters being returned by the solr-client...
for example : "é" came out like "©" ... not really what we would like...

we fixed it by setting the input stream for the xmlparser to "UTF8" which gave us this code
in :
public QueryResults process( InputStream reader ) throws SolrClientException, SolrServerException,
XmlPullParserException, IOException
    	QueryResults res = new QueryResults();

		try {
			XmlPullParser xpp = null;
			try {
				xpp = factory.newPullParser();

notice we changed the argument for this method to InputStream instead of the reader so we
could add "UTF-8" to the stream.
by doing this we had to change the reader in to an inputstream :
InputStream inputStream = urlc.getInputStream();
			try {
				QueryResults res = parser.process( inputStream );
				res.setSolrURL( qurl );
				res.setQuery( query );
				return res;

in our opinion this was a major bug (since all solr-xml is encoded in utf-8) and we guess
somebody just forgot to put it in...

yay, now we can all start using freaky characters without the client actually freaking out
:) enjoy

> A simple Java client for updating and searching
> -----------------------------------------------
>                 Key: SOLR-20
>                 URL:
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - java
>         Environment: all
>            Reporter: Darren Erik Vengroff
>            Priority: Minor
>         Attachments:,,,, solr-client-sources.jar,,,,,
> I wrote a simple little client class that can connect to a Solr server and issue add,
delete, commit and optimize commands using Java methods.  I'm posting here for review and
comments as suggested by Yonik.

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

View raw message