You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Itamar Syn-Hershko (JIRA)" <ji...@apache.org> on 2011/06/16 14:55:47 UTC

[Lucene.Net] [jira] [Created] (LUCENENET-426) Mark BaseFragmentsBuilder methods as virtual

Mark BaseFragmentsBuilder methods as virtual
--------------------------------------------

                 Key: LUCENENET-426
                 URL: https://issues.apache.org/jira/browse/LUCENENET-426
             Project: Lucene.Net
          Issue Type: Improvement
          Components: Lucene.Net Contrib
    Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.x, Lucene.Net 2.9.4g
            Reporter: Itamar Syn-Hershko
            Priority: Minor


Without marking methods in BaseFragmentsBuilder as virtual, it is meaningless to have FragmentsBuilder deriving from a class named "Base", since most of its functionality cannot be overridden. Attached is a patch for marking the important methods virtual.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[Lucene.Net] [jira] [Updated] (LUCENENET-426) Mark BaseFragmentsBuilder methods as virtual

Posted by "Itamar Syn-Hershko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Itamar Syn-Hershko updated LUCENENET-426:
-----------------------------------------

    Attachment: fvh.patch

Patch fixing this

> Mark BaseFragmentsBuilder methods as virtual
> --------------------------------------------
>
>                 Key: LUCENENET-426
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-426
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.x, Lucene.Net 2.9.4g
>            Reporter: Itamar Syn-Hershko
>            Priority: Minor
>         Attachments: fvh.patch
>
>
> Without marking methods in BaseFragmentsBuilder as virtual, it is meaningless to have FragmentsBuilder deriving from a class named "Base", since most of its functionality cannot be overridden. Attached is a patch for marking the important methods virtual.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[Lucene.Net] [jira] [Commented] (LUCENENET-426) Mark BaseFragmentsBuilder methods as virtual

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053519#comment-13053519 ] 

Digy commented on LUCENENET-426:
--------------------------------

Perhaps you do something wrong
Since you posted in your blog as
{quote}
Perhaps you have tackled this before: you wanted to use Lucene's FastVectorHighlighter (aka FVH), but since you have a custom CharFilter in your analysis chain, the highlighter fails to produce valid fragments.
{quote}
which is definitely wrong.

DIGY

> Mark BaseFragmentsBuilder methods as virtual
> --------------------------------------------
>
>                 Key: LUCENENET-426
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-426
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.x, Lucene.Net 2.9.4g
>            Reporter: Itamar Syn-Hershko
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4, Lucene.Net 2.9.4g
>
>         Attachments: fvh.patch
>
>
> Without marking methods in BaseFragmentsBuilder as virtual, it is meaningless to have FragmentsBuilder deriving from a class named "Base", since most of its functionality cannot be overridden. Attached is a patch for marking the important methods virtual.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[Lucene.Net] [jira] [Commented] (LUCENENET-426) Mark BaseFragmentsBuilder methods as virtual

Posted by "Itamar Syn-Hershko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053511#comment-13053511 ] 

Itamar Syn-Hershko commented on LUCENENET-426:
----------------------------------------------

Apparently that was not enough. I hit a need to override this one too:

protected Field[] GetFields(IndexReader reader, int docId, String fieldName)

Perhaps it'd make sense to make all protected virtual? In Java you can override anything that is not final, so that would be compatible with the original version.

> Mark BaseFragmentsBuilder methods as virtual
> --------------------------------------------
>
>                 Key: LUCENENET-426
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-426
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.x, Lucene.Net 2.9.4g
>            Reporter: Itamar Syn-Hershko
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4, Lucene.Net 2.9.4g
>
>         Attachments: fvh.patch
>
>
> Without marking methods in BaseFragmentsBuilder as virtual, it is meaningless to have FragmentsBuilder deriving from a class named "Base", since most of its functionality cannot be overridden. Attached is a patch for marking the important methods virtual.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[Lucene.Net] [jira] [Resolved] (LUCENENET-426) Mark BaseFragmentsBuilder methods as virtual

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy resolved LUCENENET-426.
----------------------------

       Resolution: Fixed
    Fix Version/s: Lucene.Net 2.9.4g
                   Lucene.Net 2.9.4

Thanks Itamar.
Fixed in trunk & 2.9.4g branch.

DIGY

> Mark BaseFragmentsBuilder methods as virtual
> --------------------------------------------
>
>                 Key: LUCENENET-426
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-426
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.x, Lucene.Net 2.9.4g
>            Reporter: Itamar Syn-Hershko
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4, Lucene.Net 2.9.4g
>
>         Attachments: fvh.patch
>
>
> Without marking methods in BaseFragmentsBuilder as virtual, it is meaningless to have FragmentsBuilder deriving from a class named "Base", since most of its functionality cannot be overridden. Attached is a patch for marking the important methods virtual.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[Lucene.Net] [jira] [Commented] (LUCENENET-426) Mark BaseFragmentsBuilder methods as virtual

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053722#comment-13053722 ] 

Digy commented on LUCENENET-426:
--------------------------------

10 min. work done.
DIGY

> Mark BaseFragmentsBuilder methods as virtual
> --------------------------------------------
>
>                 Key: LUCENENET-426
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-426
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.x, Lucene.Net 2.9.4g
>            Reporter: Itamar Syn-Hershko
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4, Lucene.Net 2.9.4g
>
>         Attachments: fvh.patch
>
>
> Without marking methods in BaseFragmentsBuilder as virtual, it is meaningless to have FragmentsBuilder deriving from a class named "Base", since most of its functionality cannot be overridden. Attached is a patch for marking the important methods virtual.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[Lucene.Net] [jira] [Issue Comment Edited] (LUCENENET-426) Mark BaseFragmentsBuilder methods as virtual

Posted by "Itamar Syn-Hershko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053692#comment-13053692 ] 

Itamar Syn-Hershko edited comment on LUCENENET-426 at 6/23/11 8:02 AM:
-----------------------------------------------------------------------

I think we already went through this?

Anyway, I don't see how that's relevant. My point here is language difference you didn't take into account, and that point is valid.

As for my particular use case - I'm trying to highlight based on termvectors of field A using the stored content from field B. I don't think I'm doing anything wrong here. Only spent 10 minutes on that tho.

      was (Author: itamar):
    I think we already went through this?

Anyway, I don't see how that's relevant. My point here is .

As for my particular use case - I'm trying to highlight based on termvectors of field A using the stored content from field B. I don't think I'm doing anything wrong here. Only spent 10 minutes on that tho.
  
> Mark BaseFragmentsBuilder methods as virtual
> --------------------------------------------
>
>                 Key: LUCENENET-426
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-426
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.x, Lucene.Net 2.9.4g
>            Reporter: Itamar Syn-Hershko
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4, Lucene.Net 2.9.4g
>
>         Attachments: fvh.patch
>
>
> Without marking methods in BaseFragmentsBuilder as virtual, it is meaningless to have FragmentsBuilder deriving from a class named "Base", since most of its functionality cannot be overridden. Attached is a patch for marking the important methods virtual.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[Lucene.Net] [jira] [Commented] (LUCENENET-426) Mark BaseFragmentsBuilder methods as virtual

Posted by "Itamar Syn-Hershko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053692#comment-13053692 ] 

Itamar Syn-Hershko commented on LUCENENET-426:
----------------------------------------------

I think we already went through this?

Anyway, I don't see how that's relevant. My point here is .

As for my particular use case - I'm trying to highlight based on termvectors of field A using the stored content from field B. I don't think I'm doing anything wrong here. Only spent 10 minutes on that tho.

> Mark BaseFragmentsBuilder methods as virtual
> --------------------------------------------
>
>                 Key: LUCENENET-426
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-426
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 3.x, Lucene.Net 2.9.4g
>            Reporter: Itamar Syn-Hershko
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4, Lucene.Net 2.9.4g
>
>         Attachments: fvh.patch
>
>
> Without marking methods in BaseFragmentsBuilder as virtual, it is meaningless to have FragmentsBuilder deriving from a class named "Base", since most of its functionality cannot be overridden. Attached is a patch for marking the important methods virtual.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira