lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Aroush (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENENET-156) Contrib Highlighter.net -> getBestTextFraments error
Date Wed, 31 Dec 2008 03:04:44 GMT

    [ https://issues.apache.org/jira/browse/LUCENENET-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660015#action_12660015
] 

George Aroush commented on LUCENENET-156:
-----------------------------------------

Good catch, but shouldn't the fix actually be:

	if (startOffset > lastEndOffset)
		newText.Append(encoder.EncodeText(text.Substring(lastEndOffset, (startOffset) - (lastEndOffset)
+ 1)));

You have the test logic changed from ">" to "<"; in my case, I added "+ 1"

The Java code, looks like so:

	if (startOffset > lastEndOffset)
		newText.append(encoder.encodeText(text.substring(lastEndOffset, startOffset)));

Java's substring() is: substring(int beginIndex, int endIndex)
C#'s Substring() is: Substring(int startIndex, int length);

> Contrib Highlighter.net -> getBestTextFraments error
> ----------------------------------------------------
>
>                 Key: LUCENENET-156
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-156
>             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.


Mime
View raw message