Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AEB7E10685 for ; Wed, 4 Feb 2015 09:00:59 +0000 (UTC) Received: (qmail 23446 invoked by uid 500); 4 Feb 2015 09:00:57 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 23318 invoked by uid 500); 4 Feb 2015 09:00:57 -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 23111 invoked by uid 99); 4 Feb 2015 09:00:57 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2015 09:00:57 +0000 Date: Wed, 4 Feb 2015 09:00:57 +0000 (UTC) From: "Shinichiro Abe (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LUCENE-6200) Highlighter sometime went wrong 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/LUCENE-6200?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D143= 04806#comment-14304806 ]=20 Shinichiro Abe commented on LUCENE-6200: ---------------------------------------- Perhaps the same as LUCENE-1489. > Highlighter sometime went wrong > ------------------------------- > > Key: LUCENE-6200 > URL: https://issues.apache.org/jira/browse/LUCENE-6200 > Project: Lucene - Core > Issue Type: Bug > Components: modules/highlighter > Affects Versions: 4.10.2 > Reporter: thihy > Labels: highlighter > > I have write a test case for this. I expect "=E6=B8=B8=E6=88=8F=E6= =98=AF=E6=B8=B8=E6=88=8F", but get "=E6=B8=B8=E6=88=8F=E6=98=AF= =E6=B8=B8=E6=88=8F" > {code:java} > =09public static void main(String[] args) throws IOException, > =09=09=09InvalidTokenOffsetsException { > =09=09String text =3D "=E6=B8=B8=E6=88=8F=E6=98=AF=E6=B8=B8=E6=88=8F"; > =09=09String query =3D "=E6=B8=B8=E6=88=8F"; > =09=09CJKAnalyzer analyzer =3D new CJKAnalyzer(); > =09=09Scorer fragmentScorer =3D new QueryScorer(new TermQuery(new Term("f= ield", > =09=09=09=09query))); > =09=09Highlighter highlighter =3D new Highlighter(fragmentScorer); > =09=09String fragment =3D highlighter.getBestFragment( > =09=09=09=09analyzer.tokenStream("field", text), text); > =09=09analyzer.close(); > =09=09System.out.println(fragment); // println: =E6=B8=B8=E6=88=8F=E6= =98=AF=E6=B8=B8=E6=88=8F > =09} > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org