lucene-solr-dev mailing list archives

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

    [ https://issues.apache.org/jira/browse/SOLR-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478810
] 

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 ResultsParser.java :
[code]
public QueryResults process( InputStream reader ) throws SolrClientException, SolrServerException,
XmlPullParserException, IOException
    {
    	QueryResults res = new QueryResults();

		try {
			XmlPullParser xpp = null;
			try {
				xpp = factory.newPullParser();
				xpp.setInput(reader,"UTF-8");
				xpp.nextTag();
			} 
.....
[/code]

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 SolrClientImpl.java to an inputstream :
[code]
....
InputStream inputStream = urlc.getInputStream();
			try {
				QueryResults res = parser.process( inputStream );
				res.setSolrURL( qurl );
				res.setQuery( query );
				return res;
			}
....
[/code]

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: https://issues.apache.org/jira/browse/SOLR-20
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - java
>         Environment: all
>            Reporter: Darren Erik Vengroff
>            Priority: Minor
>         Attachments: DocumentManagerClient.java, DocumentManagerClient.java, solr-client-java-2.zip.zip,
solr-client-java.zip, solr-client-sources.jar, solr-client.zip, solr-client.zip, solr-client.zip,
SolrClientException.java, SolrServerException.java
>
>
> 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.


Mime
View raw message