Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 62942 invoked from network); 9 Mar 2011 04:20:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Mar 2011 04:20:22 -0000 Received: (qmail 58322 invoked by uid 500); 9 Mar 2011 04:20:21 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 58270 invoked by uid 500); 9 Mar 2011 04:20:21 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 58263 invoked by uid 99); 9 Mar 2011 04:20:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2011 04:20:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2011 04:20:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 724D03A0E68 for ; Wed, 9 Mar 2011 04:19:59 +0000 (UTC) Date: Wed, 9 Mar 2011 04:19:59 +0000 (UTC) From: "Koji Sekiguchi (JIRA)" To: dev@lucene.apache.org Message-ID: <757508382.7039.1299644399464.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1675175669.6732.1296712169517.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Updated: (SOLR-2346) Non UTF-8 Text files having other than english texts(Japanese/Hebrew) are no getting indexed correctly. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-2346?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Koji Sekiguchi updated SOLR-2346: --------------------------------- Affects Version/s: 4.0 3.1 Fix Version/s: 4.0 3.2 > Non UTF-8 Text files having other than english texts(Japanese/Hebrew) are= no getting indexed correctly. > -------------------------------------------------------------------------= ------------------------------ > > Key: SOLR-2346 > URL: https://issues.apache.org/jira/browse/SOLR-2346 > Project: Solr > Issue Type: Bug > Components: contrib - Solr Cell (Tika extraction) > Affects Versions: 1.4.1, 3.1, 4.0 > Environment: Solr 1.4.1, Packaged Jetty as servlet container, Win= dows XP SP1, Machine was booted in Japanese Locale. > Reporter: Prasad Deshpande > Assignee: Koji Sekiguchi > Priority: Critical > Fix For: 3.2, 4.0 > > Attachments: NormalSave.msg, SOLR-2346.patch, UnicodeSave.msg, sa= mple_jap_UTF-8.txt, sample_jap_non_UTF-8.txt > > > I am able to successfully index/search non-Engilsh files (like Hebrew, Ja= panese) which was encoded in UTF-8. However, When I tried to index data whi= ch was encoded in local encoding like Big5 for Japanese I could not see the= desired results. The contents after indexing looked garbled for Big5 encod= ed document when I searched for all indexed documents. When I index attache= d non utf-8 file it indexes in following way > - > - > - > =EF=BF=BD=EF=BF=BD =EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD= =EF=BF=BD > > - > Big5 > > - > zh > > - > zh > > - > 17 > > - > text/plain > > doc2 > > > > Here you said it index file in UTF8 however it seems that non UTF8 file g= ets indexed in Big5 encoding. > Here I tried fetching indexed data stream in Big5 and converted in UTF8. > String id =3D (String) resulDocument.getFirstValue("attr_content"); > byte[] bytearray =3D id.getBytes("Big5"); > String utf8String =3D new String(bytearray, "UTF-8"); > It does not gives expected results. > When I index UTF-8 file it indexes like following > - > - > =E3=83=9E=E3=82=A4 =E3=83=8D=E3=83=83=E3=83=88=E3=83=AF=E3=83=BC= =E3=82=AF > > - > UTF-8 > > - > text/plain > > - > sample_jap_unicode.txt > > - > 28 > > - > myfile > > - > text/plain > > doc2 > > So, I can index and search UTF-8 data. > For more reference below is the discussion with Yonik. > Please find attached TXT file which I was using to index and search. > curl "http://localhost:8983/solr/update/extract?literal.id=3Ddoc1&upr= efix=3Dattr_&fmap.content=3Dattr_content&fmap.div=3Dfoo_t&boost.foo_t=3D3&c= ommit=3Dtrue&charset=3Dutf-8" -F "myfile=3D@sample_jap_non_UTF-8" > One problem is that you are giving big5 encoded text to Solr and saying t= hat it's UTF8. > Here's one way to actually tell solr what the encoding of the text you ar= e sending is: > curl "http://localhost:8983/solr/update/extract?literal.id=3Ddoc1&uprefix= =3Dattr_&fmap.content=3Dattr_content&fmap.div=3Dfoo_t&boost.foo_t=3D3&commi= t=3Dtrue" --data-binary @sample_jap_non_UTF-8.txt -H 'Content-type:text/pla= in; charset=3Dbig5' > Now the problem appears that for some reason, this doesn't work... > Could you open a JIRA issue and attach your two test files? > -Yonik > http://lucidimagination.com -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org