You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mark Miller (JIRA)" <ji...@apache.org> on 2008/10/19 15:23:03 UTC

[jira] Created: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
-----------------------------------------------------------

                 Key: LUCENE-1424
                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
             Project: Lucene - Java
          Issue Type: New Feature
            Reporter: Mark Miller
            Priority: Minor


If we want to be able to highlight these queries, they need to be added to Lucene core (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646034#action_12646034 ] 

Mark Miller commented on LUCENE-1424:
-------------------------------------

It looks like termContainsWildcard; and the check code can come out of wildcardquery. I pretty much got around that by making wc enum not blow up when the term doesn't contain a wildcard. There are other ways to do it that would keep the check if we prefer (a simple override of rewrite on wildcardquery would be the other option I like). I just liked the idea of WCTermEnum not blowing up like WCQuery doesnt blow up.

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Issue Comment Edited: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646161#action_12646161 ] 

markrmiller@gmail.com edited comment on LUCENE-1424 at 11/9/08 7:43 PM:
--------------------------------------------------------------

looks great!

Sorry to do this, but I had to touch up the javadoc on RangeQuery as it no longer requires at least one term. I promise thats my last!

Oh yeah, and co credit would probably be more accurate.

      was (Author: markrmiller@gmail.com):
    looks great!

Sorry to do this, but I had to touch up the javadoc on RangeQuery as it no longer requires at least one term. I promise thats my last!
  
> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646023#action_12646023 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

bq. Sorry about all the patches by the way.

Whoa, no need to apologize -- I in fact love all the patches and fast feedback/iterations.  That's definitely the right way to do it.  When I said "...but I sure hope this is the last patch" I meant "if I need to manually fix the patch failures".  Since you are fixing the patch problems (thanks!) then it's all good -- keep the patch iterations going.

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment:     (was: LUCENE-1424.patch)

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646029#action_12646029 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

Excellent -- patch applies perfectly and all tests pass.  I'll review the changes.  Thanks Mark!

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Michael Busch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646606#action_12646606 ] 

Michael Busch commented on LUCENE-1424:
---------------------------------------

Yeah, I understand the reason... and easy "fix" would be in QueryParser#newRangeQuery():
{code:java}
  protected Query newRangeQuery(String field, String part1, String part2, boolean inclusive) {
    RangeQuery query;  
  
    if (constantScoreRewrite) {
      // TODO: remove in Lucene 3.0
      query = new ConstantScoreRangeQuery(field, part1, part2, inclusive, inclusive, rangeCollator);
    } else {
      query = new RangeQuery(field, part1, part2, inclusive, inclusive, rangeCollator);
    }
    query.setConstantScoreRewrite(constantScoreRewrite);
    return query;
  }
{code}

Since ConstantScoreRangeQuery extends RangeQuery this works and should not change any behavior, right?
I tried it out, "ant test-core test-tag" passes with this change.


> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Assigned: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

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

Michael McCandless reassigned LUCENE-1424:
------------------------------------------

    Assignee: Michael McCandless

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

This time granting license to ASF

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

What do people think about putting these classes in? They have no max clause limitations, and reports have been that they can be *much* more efficient on large indexes. Solr has switched from using the boolean rewriting WildcardQuery,PrefixQuery to ConstantScore queries. We already put in the ConstantScoreRange query for just these reasons, so I think it makes since to add the rest of the family. An upside will be that I can add support for these queries to the Span highlighter. That will put our Highlighter in a position of being able to highlight pretty much every major query type, which I think is an important goal.

- Mark

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Priority: Minor
>         Attachments: LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

Heres an early review patch.

I switched range and prefix to use multiterm query, but its debatable if thats necessary. Prob a few clock cycles slower, and the benefits are slim beyond overall code design niceness (which counts a lot to me <g>). Just not sure every mutlitermquery would want to have to implement a constantscore version, and the amount of code reuse saved is low (it could do a bit more with something like getFilteredEnum, but thats not much either).

TODO:

look over
some comments maybe
some tests for the constant score versions
rangequery is not as expressive as constantscorequery, which can have separate inclusive/exclusive ends.


When I was talking about deprecating constantscorequery being awkward, its wasnt really in the implementation sense (i think we can leave it as is), but more the deprecating one of the newest queries already :) Still don't consider that a huge deal though.


> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: [jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by Mark Miller <ma...@gmail.com>.
Just realized I missed changing query parser to use rangequery rather  
than constantrangequery.  I'll do another patch later.

- Mark


On Nov 6, 2008, at 1:52 PM, "Mark Miller (JIRA)" <ji...@apache.org>  
wrote:

>
>     [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel 
>  ]
>
> Mark Miller updated LUCENE-1424:
> --------------------------------
>
>    Attachment: LUCENE-1424.patch
>
> Okay, this should be good. Thanks for the guidance.
>
>> Change all mutli term querys so that they extend MultiTermQuery and  
>> allow for a constant score mode
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> ---------------------------------------------------------------------
>>
>>                Key: LUCENE-1424
>>                URL: https://issues.apache.org/jira/browse/LUCENE-1424
>>            Project: Lucene - Java
>>         Issue Type: New Feature
>>           Reporter: Mark Miller
>>           Assignee: Michael McCandless
>>           Priority: Minor
>>        Attachments: LUCENE-1424.patch, LUCENE-1424.patch,  
>> LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch,  
>> LUCENE-1424.patch, LUCENE-1424.patch
>>
>>
>> Cleans up a bunch of code duplication, closer to how things should  
>> be - design wise, gives us constant score for all the multi term  
>> queries, and allows us at least the option of highlighting the  
>> constant score queries without much further work.
>
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

Okay, this should be good. Thanks for the guidance.

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Michael McCandless resolved LUCENE-1424.
----------------------------------------

    Resolution: Fixed

Thanks Mark -- I just committed that.

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424-dep_rng_cstr_fix.patch, lucene-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: [jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by Mark Miller <ma...@gmail.com>.
Found the issue. The anon filter I am making in mutliterm query needs  
a hashcode and equals.

- Mark


On Nov 5, 2008, at 2:35 PM, "Mark Miller (JIRA)" <ji...@apache.org>  
wrote:

>
>     [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel 
>  ]
>
> Mark Miller updated LUCENE-1424:
> --------------------------------
>
>    Attachment: LUCENE-1424.patch
>
> Okay, almost there. Making constantscorerange query extend  
> rangequery exposed a small problem though - there is scoring  
> difference when using multiserver vs single searcher. The simple  
> rangequery test in the multisearcher scoring test fails. The single  
> searcher returns a score of 1 and the multi 1.4 - still trying to  
> figure out how the heck that is happening...there is not a lot going  
> on, so its prob obvious, but not sticking out at the moment...
>
>> Change all mutli term querys so that they extend MultiTermQuery and  
>> allow for a constant score mode
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> --- 
>> ---------------------------------------------------------------------
>>
>>                Key: LUCENE-1424
>>                URL: https://issues.apache.org/jira/browse/LUCENE-1424
>>            Project: Lucene - Java
>>         Issue Type: New Feature
>>           Reporter: Mark Miller
>>           Assignee: Michael McCandless
>>           Priority: Minor
>>        Attachments: LUCENE-1424.patch, LUCENE-1424.patch,  
>> LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch,  
>> LUCENE-1424.patch
>>
>>
>> Cleans up a bunch of code duplication, closer to how things should  
>> be - design wise, gives us constant score for all the multi term  
>> queries, and allows us at least the option of highlighting the  
>> constant score queries without much further work.
>
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

Okay, almost there. Making constantscorerange query extend rangequery exposed a small problem though - there is scoring difference when using multiserver vs single searcher. The simple rangequery test in the multisearcher scoring test fails. The single searcher returns a score of 1 and the multi 1.4 - still trying to figure out how the heck that is happening...there is not a lot going on, so its prob obvious, but not sticking out at the moment...

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644848#action_12644848 ] 

Mark Miller commented on LUCENE-1424:
-------------------------------------

No worries, I'm still in the thick of it - plenty of little strings to 
wrap up, just wanted to make sure I was on the right track.




> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642628#action_12642628 ] 

Hoss Man commented on LUCENE-1424:
----------------------------------

bq. Is there any reason to keep the rewrite-to-BooleanQuery

In addition to the coord example Mark mentioned, there are also cases where the tf and idf values for terms matching a wildcard/prefix are meaningful ... but the other advantage to keeping the existing implementations is use cases where the number of unique terms a query expands to is  is very small, but the number of documents matched is very large ... in theory (but i haven't tested this) the expanding queries should be more efficient in space and equally efficient in time as the ConstantScore equivalents.

bq. It would then be possible to just switch the QueryParser or other code by e.g. setting a global (static) flag.

I'm loath to see more static "setter" methods added to query clauses, but there's no reason this couldn't be a member property on instances of the classes with corresponding properties on QueryParser.

In theory it could even be a tertiary state property: REWRITE_TO_BOOLEAN, REWRITE_TO_CONSTANT_SCORE. REWRITE_GUESS ... where the third option caused the REWRITE method to make it's best guess using a first pass at the TermEnum iteration and aborting if the number of terms get's above some threshold.

(but that kind of "optimization" would be premature without testing .. the point is it would be possible)

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

bq In favor of new QueryWrapperFilter(new XXXQuery(...))? 

I didn't end up going with the wrapper. Check out this patch just so we get back on the same page sooner rather than later...does this look like a doable way of doing it? It kills all the dupe code I think.

We can just leave Prefixfilter since its their anyway, but the prefixquery wont use it.

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Mark Harwood (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642615#action_12642615 ] 

Mark Harwood commented on LUCENE-1424:
--------------------------------------

>> Are the score differences caused by the rewrite-to-BooleanQuery implementations ever "useful"?

So we need to consider what we are losing - TF, IDF, coordination, length norm, doc boosts.

I can only think of one use case which relates to coordination factor.

If you have a "category" field for a product e.g. given Lucene docs for these books:

Title:            Lucene in Action
Category:   /Books/Computing/Languages/Java
                    /Books/Computing/InformationRetrieval

Title:           The Long Tail
Category:  /Books/Business/Internet
                   /Books/Computing

You might then use a wildcard search of /Books/Computing/* and "Lucene in Action" would rank higher than "The Long Tail" because a BooleanQuery would score a higher coordination factor suggesting LIA got more hits under this "/Books/Computing.." category. There would still be the issue of IDF potentially skewing results but the coordination factor is potentially useful here. 

I think in general IDF tends to be useless for "auto-expanded" terms e.g. Wildcard, fuzzy etc. Incidentally, we still see that IDF issue in fuzzy queries ranking rare mis-spellings higher but that's another issue (one I resolved in contrib's FuzzyLikeThisQuery).

I suppose one other consideration is for people who have created any doc boosts e.g. trying to use this to boost by date.

I don't think any of these cases necessarily outweigh the benefit to be obtained from switching "wildcard/prefix to constant score queries"


Cheers,
Mark







> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Michael McCandless updated LUCENE-1424:
---------------------------------------

    Attachment: LUCENE-1424.patch


Excellent!  OK I made a few more changes, new patch attached.  This is like playing ping-pong ;):

  - Fixed QueryParser.jj to match our changes to QueryParser.java

  - Fixed a few more unused imports, unused assignments, deprecated
    calls, javadocs, etc


> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Michael McCandless resolved LUCENE-1424.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.9

Committed revision 712890.

Thanks Mark!

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642605#action_12642605 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

bq. What do people think about putting these classes in?

+1

I think in general we should more aggressively slurp useful things like this from Solr into Lucene.

Is there any reason to keep the rewrite-to-BooleanQuery version of these (vs, deprecating them in favor of the ConstantScore variety)?  Are the score differences caused by the rewrite-to-BooleanQuery implementations ever "useful"?

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Priority: Minor
>         Attachments: LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646215#action_12646215 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

OK this version looks good!  I plan to commit sometime later today... thanks Mark!

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Reopened: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller reopened LUCENE-1424:
---------------------------------

      Assignee:     (was: Michael Busch)

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424-dep_rng_cstr_fix.patch, lucene-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

Okay, fingers crossed, this is good.

Eclipse was displaying the $id correctly, but it wasn't going out in the patch. Also, I didn't realize refactoring can cause issues like that, so I deleted and created a new class. Personally, I think thats fine, but let me know if you disagree. I also tested applying the patch to a fresh checkout and ran the tests. Should be good.

I think I'm done unless (probably when) you prompt something else / something I missed.

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

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

Uwe Schindler commented on LUCENE-1424:
---------------------------------------

Just a suggestion:
How about *not* inventing new Class names. Just include both code parts into e.g. (Range|Prefix|Wildcard)Query's rewrite() method. It would then be possible to just switch the QueryParser or other code by e.g. setting a global (static) flag in (Range|Prefix|Wildcard)Query that switches between both implementations).

To your patch:
For printing out the boost in toString(): there is a nice helper routine (instead of "if (getBoost()!=1.0f)...."). I think it should be consistent with toString() of all other core query types.

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Otis Gospodnetic updated LUCENE-1424:
-------------------------------------

    Summary: Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode  (was: Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode)

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

Sorry bout the @overrides...grabbed/copied from solr and forgot the java 1.4 cleanse. There was also one StringBuilder in the wildcardfilter that this patch pulls.

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Issue Comment Edited: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644756#action_12644756 ] 

markrmiller@gmail.com edited comment on LUCENE-1424 at 11/3/08 10:44 AM:
---------------------------------------------------------------

Heres an early review patch.

I switched range and prefix to use multiterm query, but its debatable if thats necessary. Prob a few clock cycles slower, and the benefits are slim beyond overall code design niceness (which counts a lot to me <g>). Just not sure every mutlitermquery would want to have to implement a constantscore version, and the amount of code reuse saved is low (it could do a bit more with something like getConstantScoreQuery, but thats not much either - I may put it in come to think of it).

TODO:

look over
some comments maybe
some tests for the constant score versions
rangequery is not as expressive as constantscorequery, which can have separate inclusive/exclusive ends.


When I was talking about deprecating constantscorequery being awkward, its wasnt really in the implementation sense (i think we can leave it as is), but more the deprecating one of the newest queries already :) Still don't consider that a huge deal though.


      was (Author: markrmiller@gmail.com):
    Heres an early review patch.

I switched range and prefix to use multiterm query, but its debatable if thats necessary. Prob a few clock cycles slower, and the benefits are slim beyond overall code design niceness (which counts a lot to me <g>). Just not sure every mutlitermquery would want to have to implement a constantscore version, and the amount of code reuse saved is low (it could do a bit more with something like getFilteredEnum, but thats not much either).

TODO:

look over
some comments maybe
some tests for the constant score versions
rangequery is not as expressive as constantscorequery, which can have separate inclusive/exclusive ends.


When I was talking about deprecating constantscorequery being awkward, its wasnt really in the implementation sense (i think we can leave it as is), but more the deprecating one of the newest queries already :) Still don't consider that a huge deal though.

  
> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646935#action_12646935 ] 

Mark Miller commented on LUCENE-1424:
-------------------------------------

Another one: looks like as we were iterating back and forth, after I changed the constructors to the non deprecated, we lost the ability of the deprecated constructors to accept null properly. Doh! I'll try and fix it tonight.

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: lucene-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Issue Comment Edited: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646012#action_12646012 ] 

markrmiller@gmail.com edited comment on LUCENE-1424 at 11/8/08 11:03 AM:
---------------------------------------------------------------

Don't work through it. I'm just using eclipse And did nothing  
different, but don't waste your time.  Let me figure it out. I'll make  
sure it works without eclipse before putting it up.

That test was just an eclipse name refactor.

Sorry about all the patches by the way. Tends to be my style :) I tried to indicate which were merely progress patches (if someone has the interest, it allows my ,any wrong directions to be pointed out sooner) and which were something that should be considered more final review worthy. I am sure I can do a better job on that though. Certainly not my intention to waste anyones time, especially when that time could be better spent improving Lucene ;)

- Mark


On Nov 8, 2008, at 12:34 PM, "Michael McCandless (JIRA)" <jira@apache.org 



      was (Author: markrmiller@gmail.com):
    Don't work through it. I'm just using eclipse And did nothing  
different, but don't waste your time.  Let me figure it out. I'll make  
sure it works without eclipse before putting it up.

That test was just an eclipse name refactor.

- Mark


On Nov 8, 2008, at 12:34 PM, "Michael McCandless (JIRA)" <jira@apache.org 


  
> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

+1 on all of your changes.

Still had an issue with your patch with the two $id classes - I have no clue whats up with that, so I just manually paste the expanded line into my patch.

Removed some unused imports in new/modified classes and further added/tweaked appropriate javadoc.

Changed RangeQuery tests to use non deprecated constructors, exposed a null pointer issue with RangeQuery.equals and hashcode, fixed.

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Description: If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.  (was: If we want to be able to highlight these queries, they need to be added to Lucene core (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.)

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Priority: Minor
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646609#action_12646609 ] 

Mark Miller commented on LUCENE-1424:
-------------------------------------

Looks like a fine solution to me. Cool tests.




> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Michael Busch updated LUCENE-1424:
----------------------------------

    Attachment: lucene-1424.patch

Here's the patch. 
'ant test test-tag' passes now.

I'll commit shortly.

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: lucene-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Michael Busch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646594#action_12646594 ] 

Michael Busch commented on LUCENE-1424:
---------------------------------------

Since this was committed I get a test failure when I run
  'ant -Dtag=lucene_2_4_0 test-tag'

    [junit] Testcase: testRange(org.apache.lucene.queryParser.TestQueryParser):FAILED
    [junit] null
    [junit] junit.framework.AssertionFailedError
    [junit] 	at org.apache.lucene.queryParser.TestQueryParser.testRange(TestQueryParser.java:418)

Seems like this might have broken backwards-compatibility. I haven't looked into the reason yet.

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646005#action_12646005 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

I'm having trouble applying the latest patch -- I get failed Hunks, and, patch can't find one of the source files:

{code}
patching file contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
patching file src/java/org/apache/lucene/queryParser/QueryParser.java
patching file src/java/org/apache/lucene/search/ConstantScoreRangeQuery.java
Hunk #2 FAILED at 29.
1 out of 2 hunks FAILED -- saving rejects to file src/java/org/apache/lucene/search/ConstantScoreRangeQuery.java.rej
patching file src/java/org/apache/lucene/search/MultiTermQuery.java
patching file src/java/org/apache/lucene/search/PrefixFilter.java
patching file src/java/org/apache/lucene/search/PrefixQuery.java
patching file src/java/org/apache/lucene/search/PrefixTermEnum.java
patching file src/java/org/apache/lucene/search/RangeFilter.java
patching file src/java/org/apache/lucene/search/RangeQuery.java
Hunk #1 FAILED at 21.
1 out of 3 hunks FAILED -- saving rejects to file src/java/org/apache/lucene/search/RangeQuery.java.rej
patching file src/java/org/apache/lucene/search/RangeTermEnum.java
patching file src/java/org/apache/lucene/search/WildcardQuery.java
patching file src/java/org/apache/lucene/search/WildcardTermEnum.java
patching file src/test/org/apache/lucene/queryParser/TestQueryParser.java
patching file src/test/org/apache/lucene/search/TestConstantScoreRangeQuery.java
can't find file to patch at input line 1952
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
|===================================================================
|--- src/test/org/apache/lucene/search/TestMultiTermConstantScore.java	(revision 710055)
|+++ src/test/org/apache/lucene/search/TestMultiTermConstantScore.java	(working copy)
--------------------------
File to patch: 
{code}

Did you turn off keyword expansion in your local svn checkout?  That seems to explain the first to failures (if I manually undo the $Id$ keyword expansion then the patch applies cleanly).

On the 3rd failure, it seems like you renamed TestConstantScoreRangeQuery.java to TestMultiTermConstantScore.java, and then modified it?  This confuses my patch client.

I think I can work through these, but I sure hope this is the last patch ;)

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

looks great!

Sorry to do this, but I had to touch up the javadoc on RangeQuery as it no longer requires at least one term. I promise thats my last!

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642611#action_12642611 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

Patch looks good.  I plan to commit in a day or two.

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644842#action_12644842 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

Excellent!

Looks like PrefixGenerator got lost.  Why not have it just get its bits by creating a PrefixQuery and calling getFilter().getDocIdSet()?

WildcardFilter is still in the patch.

Maybe fix getDocIdSet to not call bits() (since that's 2-pass, it's slower).  In fact, does that Filter even need to implement bits?  Can we throw a not implemented exception, since it's a new Filter?

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644802#action_12644802 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

Patch looks good!  Thanks Mark.

I think we should indeed "factor up" into MultiTermQuery the ability to create a ConstantScoreQuery out of the filter generated by enumerating the terms and walking the docs for those terms?  Then we don't need to special case in each of the subclasses.

Maybe we can then fix Wildcard/Prefix/RangeFilter to create the corresponding query and then ask it for its filter (assuming we make a method eg "getDocIdSet" in MultiTermQuery)?  Or I guess we could just make a QueryWrapperFilter around the corresponding query, though that seems rather roundabout.  I don't think we need to have duplicated code in PrefixFilter, RangeFilter, WildcardFilter.

{quote}
When I was talking about deprecating constantscorequery being awkward, its wasnt really in the implementation sense (i think we can leave it as is), but more the deprecating one of the newest queries already  Still don't consider that a huge deal though.
{quote}

Well ... this is just how software evolves :)  You can't control which code will be the "victim" of a nice refactoring.  It's a healthy sign of progress, and progress is good!

bq. rangequery is not as expressive as constantscorequery, which can have separate inclusive/exclusive ends.

If we do deprecate ConstantScoreRangeQuery (I think we should) then we could add a ctor to RangeQuery matching ConstantScoreRangeQuery's more expressive one?

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646012#action_12646012 ] 

Mark Miller commented on LUCENE-1424:
-------------------------------------

Don't work through it. I'm just using eclipse And did nothing  
different, but don't waste your time.  Let me figure it out. I'll make  
sure it works without eclipse before putting it up.

That test was just an eclipse name refactor.

- Mark


On Nov 8, 2008, at 12:34 PM, "Michael McCandless (JIRA)" <jira@apache.org 



> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: [jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by Chris Hostetter <ho...@fucit.org>.
: I think it would be quite clean if all XXXQuery classes that simply
: enumerate certain terms and then match all docs containing those
: terms, would subclass MultiTermQuery which itself would implement
: set/getRewriteMethod?

FWIW: that may be tricky for the collator logic that was added to 
RangeQuery.

: > > I am torn on this one. Not against the idea, but I think it should be
: > > consistent with ConstantScoreRangeQuery, and it seems a bit awkward to
: > > deprecate that at this point. Not a huge deal either way I guess though.

it wouldn't really be that awkward.  assuming RangeQuery had an option for 
rewriting to a ConstantScoreQuery, ConstantScoreRangeQuery becomes as 
simple as...

   public class ConstantScoreRangeQuery extends RangeQuery {
     public ConstantScoreRangeQuery(...) {
        super(...);
        this.setRewriteConstantScore(true);
     }
   }



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: [jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by Michael McCandless <lu...@mikemccandless.com>.
I think it would be quite clean if all XXXQuery classes that simply
enumerate certain terms and then match all docs containing those
terms, would subclass MultiTermQuery which itself would implement
set/getRewriteMethod?

I guess we'd also create a MultiTermFilter, which is basically the
same as TermsFilter from contrib/queries.

And then no more separate ConstantScoreXXXQuery classes... so we'd
deprecate ConstantScoreRangeQuery.

At least these [core] queries should fit this refactoring: RangeQuery,
PrefixQuery, WildcardQuery, FuzzyQuery.

I don't think I'll have time near-term to do this myself... but I do
think it's a good step forward, to bring constant-score rewriting to
all of these XXXQuery classes.

Mike

Uwe Schindler wrote:

>> Michael McCandless (JIRA) wrote:
>>> I do like the idea of adding "constant score capability" to the
>>> existing query classes, instead of adding new ConstantScoreXXXQuery
>>> classes.
>>>
>> I am torn on this one. Not against the idea, but I think it should be
>> consistent with ConstantScoreRangeQuery, and it seems a bit awkward  
>> to
>> deprecate that at this point. Not a huge deal either way I guess  
>> though.
>
> In my opinion, RangeQuery should also have this boolean flag for
> consistency. Deprecating ConstantScoreRangeQuery is not so nice, but  
> needed.
> A workaround would be:
>
> ... RangeQuery ... {
> 	public Query rewrite(IndexReader r) {
> 		if (constantScore)
> 			return new ConstantScoreRangeQuery(...).rewrite(r);
> 		else...
> 	}
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


RE: [jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by Uwe Schindler <uw...@thetaphi.de>.
> Michael McCandless (JIRA) wrote:
> > I do like the idea of adding "constant score capability" to the
> > existing query classes, instead of adding new ConstantScoreXXXQuery
> > classes.
> >
> I am torn on this one. Not against the idea, but I think it should be
> consistent with ConstantScoreRangeQuery, and it seems a bit awkward to
> deprecate that at this point. Not a huge deal either way I guess though.

In my opinion, RangeQuery should also have this boolean flag for
consistency. Deprecating ConstantScoreRangeQuery is not so nice, but needed.
A workaround would be:

... RangeQuery ... {
	public Query rewrite(IndexReader r) {
		if (constantScore)
			return new ConstantScoreRangeQuery(...).rewrite(r);
		else...
	}
}


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: [jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by Mark Miller <ma...@gmail.com>.
Michael McCandless (JIRA) wrote:
> I do like the idea of adding "constant score capability" to the
> existing query classes, instead of adding new ConstantScoreXXXQuery
> classes.
>   
I am torn on this one. Not against the idea, but I think it should be 
consistent with ConstantScoreRangeQuery, and it seems a bit awkward to 
deprecate that at this point. Not a huge deal either way I guess though.

- Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643219#action_12643219 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

OK, it sounds like we should preserve the rewrite-to-BooleanQuery
option for each of these Query classes since there are clear use cases
where it makes sense.

I do like the idea of adding "constant score capability" to the
existing query classes, instead of adding new ConstantScoreXXXQuery
classes.

I don't really like the REWRITE_GUESS option because it could lead to
strange inconsistent results as seen by the end user -- eg prefix1
sorts one way but then a relaxed prefix2 sorts another way.  I think a
simple static binary choice is good?

Couldn't we build this functionality (get/setRewriteMethod(...)) into
MultiTermQuery?  And then fix those queries that don't already to
subclass MultiTermQuery (at least RangeQuery and PrefixQuery)?

Finally, I would also prefer non-static methods to instruct
QueryParser which rewrite method to use.  In fact we already have
setUseOldRangeQuery -- maybe change this to
setUseConstantScoreRewriteMethod (defaulting to true)?


> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Description: Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.  (was: If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.)
        Summary: Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode  (was: Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery)

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642606#action_12642606 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

Woops... patch uses @Override (Java 5 only):

{code}
common.compile-core:
    [mkdir] Created dir: /lucene/lucene.constant/build/classes/java
    [javac] Compiling 333 source files to /lucene/lucene.constant/build/classes/java
    [javac] /lucene/lucene.constant/src/java/org/apache/lucene/search/ConstantScoreWildcardQuery.java:69: annotations are not supported in -source 1.4
    [javac] (use -source 5 or higher to enable annotations)
    [javac]   @Override
    [javac]    ^
    [javac] /lucene/lucene.constant/src/java/org/apache/lucene/search/WildcardFilter.java:49: annotations are not supported in -source 1.4
    [javac] (use -source 5 or higher to enable annotations)
    [javac]   @Override
    [javac]    ^
    [javac] 2 errors
{code}

I'll fix in my local checkout.

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646602#action_12646602 ] 

Mark Miller commented on LUCENE-1424:
-------------------------------------

Now it returns a RangeQuery that is set for constant score mode. Its 
behavior is back compatible with  ConstantScoreRangeQuery, but we no 
longer return it...




> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646721#action_12646721 ] 

Mark Miller commented on LUCENE-1424:
-------------------------------------

For kicks, I tried implementing the MultiTermGenerator so that it returns an inner class DocSetId iterator that iterates over matching terms/docs, thinking we could save some speed by avoiding the OpenBitSet creation, population, read. Instead, even in tests that didn't involve any skip-to (not sure what/if any of these cases actually do, still wrapping my head around that), the non generate the bitset first approach was a tad slower rather than faster. Don't know exactly why I the moment, but thought I'd chronicle the attempt for future optimizers. Probably all the stuff that happens between next calls slows down the enumeration quite a bit, so that doing it all at once saves enough time to make up for the OpenBitSet stuff.

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Michael Busch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646596#action_12646596 ] 

Michael Busch commented on LUCENE-1424:
---------------------------------------

Hmm the culprit is this line in 2.4's TestQueryParser.testRange():

    assertTrue(getQuery("[ a TO z]", null) instanceof ConstantScoreRangeQuery);

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Michael Busch resolved LUCENE-1424.
-----------------------------------

    Resolution: Fixed

Committed revision 713225.

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: lucene-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424.patch

Ahhhh...satisfying bringing order to all of that. It kaleidoscopes up quite nicely. Thanks for the help Michael.

Back to just needing:

review
possibly some comments/comment changes
tests for the constantscore side of the queries

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Michael McCandless updated LUCENE-1424:
---------------------------------------

    Attachment: LUCENE-1424.patch


OK I made some changes to the patch -- I think we are real close now:

  * Overrode WildcardQuery.rewrite to return TermQuery if the pattern has
    no wildcards (your suggestion above).

  * Simplified MultiTermFilter: made it a static inner class, moved
    TermGenerator inside it (absorbed IdGenerator interface into it),
    move bits() and getDocIdSet() out of the anonymous class,
    simplified the equals method.

  * Removed extra TermGenerator class from PrefixQuery.

  * Fixed but RangeFilter's ctor -- I think you could have gotten null
    rangeQuery if you pass in null collator.

  * Various small javadoc fixes, renaming, refactoring.

  * Deprecated ConstantScoreRangeQuery in favor of RangeQuery.

  * Overrode FuzzyQuery.setConstantScoreRewrite to throw
    UnsupportedOperationException, because it overrides rewrite.

  * Added set/getConstantScoreRewrite to QueryParser (defaults to
    true) and deprecated set/getUseOldRangeQuery.

  * Deprecated the ctor's of RangeQuery that take Term (in favor of
    String versions); removed new ctors in RangeQuery that take Term
    for upper/lower val.

Mark can you look this over and see if the changes are OK?  Thanks.

> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Mark Miller updated LUCENE-1424:
--------------------------------

    Attachment: LUCENE-1424-dep_rng_cstr_fix.patch

Fixes the null problem with deprecated RangeQuery constructors and adds unit test for it.

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424-dep_rng_cstr_fix.patch, lucene-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646639#action_12646639 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

Thanks Michael!

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645006#action_12645006 ] 

Michael McCandless commented on LUCENE-1424:
--------------------------------------------

Looks good!  I think we're almost done here...

Shouldn't we deprecate ConstantScoreRangeQuery, and maybe change it to
simply subclass RangeQuery and set useConstantScoreRewrite to true?

Should we match the ctor of ConstantScoreRangeQuery (field, lower, upper,
inclLower, inclUpper) with RangeQuery?  Right now you have Term for
lower & upper, not String.

Can we rename MultiTermQuery.isUseConstantScoreRewrite() to
getUseConstantScoreRewrite()?  Or maybe set/getConstantScoreRewrite()?

There seems to be a leftover "abstract class TermGenerator implements
IdGenerator" at the bottom of Prefixquery.java.

Small whitespace issue: you need to insert a space in "if(..." in a
few places.


> Change all mutli term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: [jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by Mark Miller <ma...@gmail.com>.
Mark Miller wrote:
> Do we want to deprecate all of the Prefix/Range/Wildcard Filter classes?
Actually, guess just Prefix is in there for now. Ill leave it and not 
add the others.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: [jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by Michael McCandless <lu...@mikemccandless.com>.
In favor of new QueryWrapperFilter(new XXXQuery(...))?

Actually you'd probably want to do this (should be faster than big  
BooleanQuery, and, won't hit the clause limit):

   MultiTermQuery q = new XXXQuery(...);
   q.setUseConstantScorer(true);
   Filter f = new QueryWrapperFilter(q);

It may be better to keep them around (but delegate using that code  
above) since this code is not immediately obvious and is somewhat  
roundabout?  But I'm not sure how popular these filters are, so I  
could go either way.

Or I suppose we could fix QueryWrapperFilter to notice it's wrapping a  
MultiTermQuery and just ask it directly for the DocIdSet?  In fact I  
think we should do this regardless of whether we deprecate those 3.

Mike

Mark Miller wrote:

> Do we want to deprecate all of the Prefix/Range/Wildcard Filter  
> classes?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: [jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by Mark Miller <ma...@gmail.com>.
Do we want to deprecate all of the Prefix/Range/Wildcard Filter classes?

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1424) Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644805#action_12644805 ] 

Mark Miller commented on LUCENE-1424:
-------------------------------------

bq. I think we should indeed "factor up" into MultiTermQuery...

Ah, I see...I hadn't thought all way up that path - it goes a bit further than was in my mind. The way to go for sure.

All the comments make perfect sense, I'll work up a new patch while I'm at apachcon.

> Add ConstantScorePrefixQuery and ConstantScoreWildcardQuery
> -----------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> If we want to be able to highlight these queries, they need to be added to Lucene core or contrib (solr's WildCardFilter can be used to create the ConstantScoreWildcardQuery). They are very useful anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Reopened: (LUCENE-1424) Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode

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

Michael Busch reopened LUCENE-1424:
-----------------------------------

      Assignee: Michael Busch  (was: Michael McCandless)

Thanks Mark.

OK, I'll make a patch and commit it later today.

> Change all multi-term querys so that they extend MultiTermQuery and allow for a constant score mode
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1424
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1424
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch, LUCENE-1424.patch
>
>
> Cleans up a bunch of code duplication, closer to how things should be - design wise, gives us constant score for all the multi term queries, and allows us at least the option of highlighting the constant score queries without much further work.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org