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 81F46DCAE for ; Tue, 9 Oct 2012 02:50:04 +0000 (UTC) Received: (qmail 15249 invoked by uid 500); 9 Oct 2012 02:50:03 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 15173 invoked by uid 500); 9 Oct 2012 02:50:03 -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 15165 invoked by uid 99); 9 Oct 2012 02:50:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2012 02:50:03 +0000 Date: Tue, 9 Oct 2012 02:50:03 +0000 (UTC) From: "Koji Sekiguchi (JIRA)" To: dev@lucene.apache.org Message-ID: <361803156.12482.1349751003322.JavaMail.jiratomcat@arcas> Subject: [jira] [Resolved] (LUCENE-1822) FastVectorHighlighter: SimpleFragListBuilder hard-coded 6 char margin is too naive 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-1822?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Koji Sekiguchi resolved LUCENE-1822. ------------------------------------ Resolution: Fixed Fix Version/s: 5.0 4.1 trunk: Committed revision 1395847. branch_4x: Committed revision 1395848. =20 > FastVectorHighlighter: SimpleFragListBuilder hard-coded 6 char margin is = too naive > -------------------------------------------------------------------------= --------- > > Key: LUCENE-1822 > URL: https://issues.apache.org/jira/browse/LUCENE-1822 > Project: Lucene - Core > Issue Type: Improvement > Components: modules/highlighter > Affects Versions: 2.9 > Environment: any > Reporter: Alex Vigdor > Assignee: Koji Sekiguchi > Priority: Minor > Fix For: 4.1, 5.0 > > Attachments: LUCENE-1822.patch, LUCENE-1822.patch, LUCENE-1822.pa= tch, LUCENE-1822-tests.patch > > > The new FastVectorHighlighter performs extremely well, however I've found= in testing that the window of text chosen per fragment is often very poor,= as it is hard coded in SimpleFragListBuilder to always select starting 6 c= haracters to the left of the first phrase match in a fragment. When select= ing long fragments, this often means that there is barely any context befor= e the highlighted word, and lots after; even worse, when highlighting a phr= ase at the end of a short text the beginning is cut off, even though the en= tire phrase would fit in the specified fragCharSize. For example, highligh= ting "Punishment" in "Crime and Punishment" returns "e and Punishment" no matter what fragCharSize is specified. I am going to attach a patch= that improves the text window selection by recalculating the starting marg= in once all phrases in the fragment have been identified - this way if a si= ngle word is matched in a fragment, it will appear in the middle of the hig= hlight, instead of 6 characters from the beginning. This way one can also = guarantee that the entirety of short texts are represented in a fragment by= specifying a large enough fragCharSize. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs 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