You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Simon Willnauer (Created) (JIRA)" <ji...@apache.org> on 2012/02/15 14:50:59 UTC

[jira] [Created] (LUCENE-3789) Expose FilteredTermsEnum from MTQ

Expose FilteredTermsEnum from MTQ 
----------------------------------

                 Key: LUCENE-3789
                 URL: https://issues.apache.org/jira/browse/LUCENE-3789
             Project: Lucene - Java
          Issue Type: Improvement
          Components: core/search
    Affects Versions: 3.6, 4.0
            Reporter: Simon Willnauer
            Priority: Minor
             Fix For: 3.6, 4.0


MTQ#getEnum() is protected and in order to access it you need to be in the o.a.l.search package. 

here is a relevant snipped from the mailing list discussion

{noformat}
getEnum() is protected so it is intended to be called *only* by subclasses (that's the idea behind protected methods). They are also accessible by other classes from the same package, but that's more a Java bug than a feature. The problem with MTQ is that RewriteMethod is a separate *class* and *not a subclass* of MTQ, so the method cannot be called (it can because of the "java bug" called from same package). So theoretically it has to be public otherwise you cannot call getEnum().

Another cleaner fix would be to add a protected final method to RewriteMethod that calls this method from MTQ. So anything subclassing RewriteMethod can get the enum from inside the RewriteMethod class which is the "correct" way to handle it. Delegating to MTQ is then "internal".
{noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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


[jira] [Commented] (LUCENE-3789) Expose FilteredTermsEnum from MTQ

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211056#comment-13211056 ] 

Robert Muir commented on LUCENE-3789:
-------------------------------------

Looks fine to me!
                
> Expose FilteredTermsEnum from MTQ 
> ----------------------------------
>
>                 Key: LUCENE-3789
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3789
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3789.patch
>
>
> MTQ#getEnum() is protected and in order to access it you need to be in the o.a.l.search package. 
> here is a relevant snipped from the mailing list discussion
> {noformat}
> getEnum() is protected so it is intended to be called *only* by subclasses (that's the idea behind protected methods). They are also accessible by other classes from the same package, but that's more a Java bug than a feature. The problem with MTQ is that RewriteMethod is a separate *class* and *not a subclass* of MTQ, so the method cannot be called (it can because of the "java bug" called from same package). So theoretically it has to be public otherwise you cannot call getEnum().
> Another cleaner fix would be to add a protected final method to RewriteMethod that calls this method from MTQ. So anything subclassing RewriteMethod can get the enum from inside the RewriteMethod class which is the "correct" way to handle it. Delegating to MTQ is then "internal".
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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


[jira] [Commented] (LUCENE-3789) Expose FilteredTermsEnum from MTQ

Posted by "Simon Willnauer (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211055#comment-13211055 ] 

Simon Willnauer commented on LUCENE-3789:
-----------------------------------------

i will go ahead and commit if nobody objects? I will work on a 3.x port once this is in trunk
                
> Expose FilteredTermsEnum from MTQ 
> ----------------------------------
>
>                 Key: LUCENE-3789
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3789
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3789.patch
>
>
> MTQ#getEnum() is protected and in order to access it you need to be in the o.a.l.search package. 
> here is a relevant snipped from the mailing list discussion
> {noformat}
> getEnum() is protected so it is intended to be called *only* by subclasses (that's the idea behind protected methods). They are also accessible by other classes from the same package, but that's more a Java bug than a feature. The problem with MTQ is that RewriteMethod is a separate *class* and *not a subclass* of MTQ, so the method cannot be called (it can because of the "java bug" called from same package). So theoretically it has to be public otherwise you cannot call getEnum().
> Another cleaner fix would be to add a protected final method to RewriteMethod that calls this method from MTQ. So anything subclassing RewriteMethod can get the enum from inside the RewriteMethod class which is the "correct" way to handle it. Delegating to MTQ is then "internal".
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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


[jira] [Commented] (LUCENE-3789) Expose FilteredTermsEnum from MTQ

Posted by "Uwe Schindler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211091#comment-13211091 ] 

Uwe Schindler commented on LUCENE-3789:
---------------------------------------

OK, I agree. I had a usecase exactly like you said (filtering the termsenum to only collect terms with a low/high docfreq,...). I did this by wrapping MTQ qith the protected problem in another variant. Here you only need a new rewrite method.
                
> Expose FilteredTermsEnum from MTQ 
> ----------------------------------
>
>                 Key: LUCENE-3789
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3789
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3789.patch
>
>
> MTQ#getEnum() is protected and in order to access it you need to be in the o.a.l.search package. 
> here is a relevant snipped from the mailing list discussion
> {noformat}
> getEnum() is protected so it is intended to be called *only* by subclasses (that's the idea behind protected methods). They are also accessible by other classes from the same package, but that's more a Java bug than a feature. The problem with MTQ is that RewriteMethod is a separate *class* and *not a subclass* of MTQ, so the method cannot be called (it can because of the "java bug" called from same package). So theoretically it has to be public otherwise you cannot call getEnum().
> Another cleaner fix would be to add a protected final method to RewriteMethod that calls this method from MTQ. So anything subclassing RewriteMethod can get the enum from inside the RewriteMethod class which is the "correct" way to handle it. Delegating to MTQ is then "internal".
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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


[jira] [Resolved] (LUCENE-3789) Expose FilteredTermsEnum from MTQ

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

Simon Willnauer resolved LUCENE-3789.
-------------------------------------

       Resolution: Fixed
         Assignee: Simon Willnauer
    Lucene Fields: New,Patch Available  (was: New)
    
> Expose FilteredTermsEnum from MTQ 
> ----------------------------------
>
>                 Key: LUCENE-3789
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3789
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>            Assignee: Simon Willnauer
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3789.patch
>
>
> MTQ#getEnum() is protected and in order to access it you need to be in the o.a.l.search package. 
> here is a relevant snipped from the mailing list discussion
> {noformat}
> getEnum() is protected so it is intended to be called *only* by subclasses (that's the idea behind protected methods). They are also accessible by other classes from the same package, but that's more a Java bug than a feature. The problem with MTQ is that RewriteMethod is a separate *class* and *not a subclass* of MTQ, so the method cannot be called (it can because of the "java bug" called from same package). So theoretically it has to be public otherwise you cannot call getEnum().
> Another cleaner fix would be to add a protected final method to RewriteMethod that calls this method from MTQ. So anything subclassing RewriteMethod can get the enum from inside the RewriteMethod class which is the "correct" way to handle it. Delegating to MTQ is then "internal".
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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


[jira] [Commented] (LUCENE-3789) Expose FilteredTermsEnum from MTQ

Posted by "Uwe Schindler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211071#comment-13211071 ] 

Uwe Schindler commented on LUCENE-3789:
---------------------------------------

Looks fine. I would make the access method final.
                
> Expose FilteredTermsEnum from MTQ 
> ----------------------------------
>
>                 Key: LUCENE-3789
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3789
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3789.patch
>
>
> MTQ#getEnum() is protected and in order to access it you need to be in the o.a.l.search package. 
> here is a relevant snipped from the mailing list discussion
> {noformat}
> getEnum() is protected so it is intended to be called *only* by subclasses (that's the idea behind protected methods). They are also accessible by other classes from the same package, but that's more a Java bug than a feature. The problem with MTQ is that RewriteMethod is a separate *class* and *not a subclass* of MTQ, so the method cannot be called (it can because of the "java bug" called from same package). So theoretically it has to be public otherwise you cannot call getEnum().
> Another cleaner fix would be to add a protected final method to RewriteMethod that calls this method from MTQ. So anything subclassing RewriteMethod can get the enum from inside the RewriteMethod class which is the "correct" way to handle it. Delegating to MTQ is then "internal".
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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


[jira] [Updated] (LUCENE-3789) Expose FilteredTermsEnum from MTQ

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

Simon Willnauer updated LUCENE-3789:
------------------------------------

    Attachment: LUCENE-3789.patch

tiny simple patch against trunk... 3.x'd look slightly different and needs a changes entry to its pretty straight forward though. 
                
> Expose FilteredTermsEnum from MTQ 
> ----------------------------------
>
>                 Key: LUCENE-3789
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3789
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3789.patch
>
>
> MTQ#getEnum() is protected and in order to access it you need to be in the o.a.l.search package. 
> here is a relevant snipped from the mailing list discussion
> {noformat}
> getEnum() is protected so it is intended to be called *only* by subclasses (that's the idea behind protected methods). They are also accessible by other classes from the same package, but that's more a Java bug than a feature. The problem with MTQ is that RewriteMethod is a separate *class* and *not a subclass* of MTQ, so the method cannot be called (it can because of the "java bug" called from same package). So theoretically it has to be public otherwise you cannot call getEnum().
> Another cleaner fix would be to add a protected final method to RewriteMethod that calls this method from MTQ. So anything subclassing RewriteMethod can get the enum from inside the RewriteMethod class which is the "correct" way to handle it. Delegating to MTQ is then "internal".
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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


[jira] [Commented] (LUCENE-3789) Expose FilteredTermsEnum from MTQ

Posted by "Simon Willnauer (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13211084#comment-13211084 ] 

Simon Willnauer commented on LUCENE-3789:
-----------------------------------------

bq. Looks fine. I would make the access method final.

well, I actually didn't make this final on purpose. if you want to filter the enum used for rewriting you can now simply override and call super.getTermsEnum(...) otherwise you need to subclass all MTQ you want to filter and change QParsers etc. that way we can simply subclass one rewrite method and we are good to go. I have a usecase where I drop terms based on their DF so this would make this much easier...

                
> Expose FilteredTermsEnum from MTQ 
> ----------------------------------
>
>                 Key: LUCENE-3789
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3789
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3789.patch
>
>
> MTQ#getEnum() is protected and in order to access it you need to be in the o.a.l.search package. 
> here is a relevant snipped from the mailing list discussion
> {noformat}
> getEnum() is protected so it is intended to be called *only* by subclasses (that's the idea behind protected methods). They are also accessible by other classes from the same package, but that's more a Java bug than a feature. The problem with MTQ is that RewriteMethod is a separate *class* and *not a subclass* of MTQ, so the method cannot be called (it can because of the "java bug" called from same package). So theoretically it has to be public otherwise you cannot call getEnum().
> Another cleaner fix would be to add a protected final method to RewriteMethod that calls this method from MTQ. So anything subclassing RewriteMethod can get the enum from inside the RewriteMethod class which is the "correct" way to handle it. Delegating to MTQ is then "internal".
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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