lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrique Martínez Zúñiga (JIRA) <>
Subject [jira] Commented: (LUCENENET-156) Contrib -> getBestTextFraments error
Date Wed, 01 Jul 2009 20:31:47 GMT


Enrique Martínez Zúñiga commented on LUCENENET-156:

After applying the patch with the example code does the following marking:

Searching for "novela":
    Una en otra: <span class=""highlight"">novela</span> de ccostumbres

Instead of:
    Una en otra: <span class=""highlight"">novela</span> de costumbres

    <span class=""highlight"">Novela</span> CCostumbrista

Instead of:
    <span class=""highlight"">Novela</span> Costumbrista

Sample Code

Dim idxSF As SimpleHTMLFormatter = New SimpleHTMLFormatter("<span class=""highlight"">",
Dim qs As QueryScorer = New QueryScorer(qry.Rewrite(idxReader))
Dim highlighter As Highlighter = New Highlighter(idxSF, qs)
Dim ts As TokenStream = idxAnalyzer.TokenStream(strFieldName, New StringReader(strValue))
Dim strText As String = hi.GetBestFragments(ts, strValue, 80, "...")

> Contrib -> getBestTextFraments error
> ----------------------------------------------------
>                 Key: LUCENENET-156
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: .NET framework
>            Reporter: Poul Erik Nielsen
> In line 274 and 275 is comment out. So far, it's obvious written wrong. It should look
like this. 
> if (lastEndOffset < text.Length)
>     newText.Append(encoder.EncodeText(text.Substring(lastEndOffset)));
> If this code is comment out, it could cut off the end of the field. Example i field ends
with </span> the newText would end as </span 
> Please correct it in the next release.
> Poul 

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

View raw message