You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2010/02/13 20:26:27 UTC

[jira] Created: (LUCENE-2262) QueryParser should now allow leading '?' wildcards

QueryParser should now allow leading '?' wildcards
--------------------------------------------------

                 Key: LUCENE-2262
                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
             Project: Lucene - Java
          Issue Type: Improvement
          Components: QueryParser
    Affects Versions: Flex Branch
            Reporter: Robert Muir
            Assignee: Robert Muir
            Priority: Minor
             Fix For: Flex Branch


QueryParser currently throws an exception if a wildcard term begins with the ? operator.

The docs say this:
{noformat}
When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
Note that this can produce very slow queries on big indexes. 
{noformat}

In the flex branch, this is no longer true. foo?, ?foo, f?oo, these are all the same from a performance perspective.

-- 
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-2262) QueryParser should now allow leading '?' wildcards

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

Robert Muir commented on LUCENE-2262:
-------------------------------------

bq. It doesn't seem like this type of bug is not one that people would rely on (throwing an exception for ? but not for *

yonik, that's not what this issue is about. have you looked at the patch?

> QueryParser should now allow leading '?' wildcards
> --------------------------------------------------
>
>                 Key: LUCENE-2262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>    Affects Versions: Flex Branch
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>
>
> QueryParser currently throws an exception if a wildcard term begins with the ? operator.
> The docs say this:
> {noformat}
> When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
> Note that this can produce very slow queries on big indexes. 
> {noformat}
> In the flex branch, this is no longer true. foo?, ?foo, f?oo, these are all the same from a performance perspective.

-- 
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-2262) QueryParser should now allow leading '?' wildcards

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

Robert Muir commented on LUCENE-2262:
-------------------------------------

btw Yonik, in my opinion disallowing these queries with leading wildcards, be it * or ? or whatever, is rather silly, since we allow even slower fuzzyqueries by default.
so another option would be to do away with this 'setAllowLeadingWildcard' stuff alltogether, and if you want to disallow something, extend QueryParser yourself and throw ParseException yourself. I would actually prefer this.

i do think we should provide back compat to duplicate the previous behavior, its perfectly reasonable that someone would have special handling for these leading wildcards (e.g. Solr does).

but this issue is simply about the fact that in flex branch, leading ? is now fast, so there is no excuse to disallow it anymore, hence we should relax the queryparser to only throw a fit on leading *


> QueryParser should now allow leading '?' wildcards
> --------------------------------------------------
>
>                 Key: LUCENE-2262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>    Affects Versions: Flex Branch
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>
>
> QueryParser currently throws an exception if a wildcard term begins with the ? operator.
> The docs say this:
> {noformat}
> When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
> Note that this can produce very slow queries on big indexes. 
> {noformat}
> In the flex branch, this is no longer true. foo?, ?foo, f?oo, these are all the same from a performance perspective.

-- 
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-2262) QueryParser should now allow leading '?' wildcards

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

Robert Muir edited comment on LUCENE-2262 at 2/14/10 3:50 AM:
--------------------------------------------------------------

bq. in my opinion disallowing these queries with leading wildcards, be it * or ? or whatever, is rather silly, since we allow even slower fuzzyqueries by default.

bq. Agree.

What do you think, should we skip this step then and simply deprecate the entire setAllowLeadingWildcard concept all together, setting it to true for Version >= 3.1?

The only concern I have is that doing this might mislead someone into thinking leading * is no longer slow, which it still is (its faster than 3.0 but the computational complexity is still the same, unlike ?). Here is a comparison of 3.0 and trunk, on 10M terms, from the LUCENE-1606 benchmark:

||Pattern||Avg query time (ms) Lucene 3.0||Avg query time (ms) Flex||
|?NNNNNN|2408.5|28.8|
|*NNNNNN|3258.3|1048.0|

      was (Author: rcmuir):
    bq. in my opinion disallowing these queries with leading wildcards, be it * or ? or whatever, is rather silly, since we allow even slower fuzzyqueries by default.

bq. Agree.

What do you think, should we skip this step then and simply deprecate the entire setAllowLeadingWildcard concept all together, setting it to true for Version >= 3.1?

  
> QueryParser should now allow leading '?' wildcards
> --------------------------------------------------
>
>                 Key: LUCENE-2262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>    Affects Versions: Flex Branch
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>
>
> QueryParser currently throws an exception if a wildcard term begins with the '?' operator.
> The current documentation describes why this is:
> {noformat}
> When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
> Note that this can produce very slow queries on big indexes. 
> {noformat}
> In the flexible indexing branch, wildcard queries with leading '?' operator are no longer slow on big indexes (they do not enumerate terms in linear fashion).
> Thus, it no longer makes sense to throw a ParseException for a leading '?'
> So, users should be able to perform a query of "?foo" and no longer get a ParseException from the QueryParser.
> For the flexible indexing branch, wildcard queries of  'foo?', '?foo', 'f?oo', etc are all the same from a performance perspective.

-- 
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-2262) QueryParser should now allow leading '?' wildcards

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

Robert Muir updated LUCENE-2262:
--------------------------------

    Attachment: LUCENE-2262.patch

initial patch:
* doesnt throw the exception for leading ? when matchVersion >= 3.1
* contrib's queryparser doesnt use Version, so i simply change AllowLeadingWildcardProcessor
* the backwards tests will fail because LUCENE-2248: TestQueryParser uses LUCENE_CURRENT when it should really be using some constant that resolves to LUCENE_30: we can fix the test to use LUCENE_30 instead of LUCENE_CURRENT

> QueryParser should now allow leading '?' wildcards
> --------------------------------------------------
>
>                 Key: LUCENE-2262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>    Affects Versions: Flex Branch
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: LUCENE-2262.patch
>
>
> QueryParser currently throws an exception if a wildcard term begins with the ? operator.
> The docs say this:
> {noformat}
> When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
> Note that this can produce very slow queries on big indexes. 
> {noformat}
> In the flex branch, this is no longer true. foo?, ?foo, f?oo, these are all the same from a performance perspective.

-- 
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-2262) QueryParser should now allow leading '?' wildcards

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

Robert Muir updated LUCENE-2262:
--------------------------------

    Attachment: LUCENE-2262_backwards.patch

patch for the backwards tests (not the best I admit, but uwe has fixed this in general for the future)

> QueryParser should now allow leading '?' wildcards
> --------------------------------------------------
>
>                 Key: LUCENE-2262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>    Affects Versions: Flex Branch
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>
>
> QueryParser currently throws an exception if a wildcard term begins with the ? operator.
> The docs say this:
> {noformat}
> When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
> Note that this can produce very slow queries on big indexes. 
> {noformat}
> In the flex branch, this is no longer true. foo?, ?foo, f?oo, these are all the same from a performance perspective.

-- 
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-2262) QueryParser should now allow leading '?' wildcards

Posted by Robert Muir <rc...@gmail.com>.
i think we can make some reasonable defaults (based on Version) for fuzzy so
that its fast.

i'm trying to figure out a way to use TREC's confusion data (
http://trec.nist.gov/data/t5_confusion.html, OCR-damaged test collection),
to help determine some defaults so Hoss won't be after me... yes i know OCR
isn't the only use case but its better than pure subjective :)

On Sat, Feb 13, 2010 at 10:51 PM, Mark Miller <ma...@gmail.com> wrote:

> Nah, let's just make fuzzy not work in the qp by default :) And make that
> back compat while your at it - while not abusing Version so that it's used
> for something subjective :) wouldn't want to rile up Hoss.
>
> I'm like 3/4 serious.
>
> - Mark
>
> http://www.lucidimagination.com (mobile)
>
>
> On Feb 13, 2010, at 10:22 PM, "Robert Muir (JIRA)" <ji...@apache.org>
> wrote:
>
>
>>   [
>> https://issues.apache.org/jira/browse/LUCENE-2262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833496#action_12833496
>>  ]
>>
>> Robert Muir commented on LUCENE-2262:
>> -------------------------------------
>>
>> bq. in my opinion disallowing these queries with leading wildcards, be it
>> * or ? or whatever, is rather silly, since we allow even slower fuzzyqueries
>> by default.
>>
>> bq. Agree.
>>
>> What do you think, should we skip this step then and simply deprecate the
>> entire setAllowLeadingWildcard concept all together, setting it to true for
>> Version >= 3.1?
>>
>>
>>  QueryParser should now allow leading '?' wildcards
>>> --------------------------------------------------
>>>
>>>               Key: LUCENE-2262
>>>               URL: https://issues.apache.org/jira/browse/LUCENE-2262
>>>           Project: Lucene - Java
>>>        Issue Type: Improvement
>>>        Components: QueryParser
>>>  Affects Versions: Flex Branch
>>>          Reporter: Robert Muir
>>>          Assignee: Robert Muir
>>>          Priority: Minor
>>>           Fix For: Flex Branch
>>>
>>>       Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>>>
>>>
>>> QueryParser currently throws an exception if a wildcard term begins with
>>> the '?' operator.
>>> The current documentation describes why this is:
>>> {noformat}
>>> When set, * or ? are allowed as the first character of a PrefixQuery and
>>> WildcardQuery.
>>> Note that this can produce very slow queries on big indexes.
>>> {noformat}
>>> In the flexible indexing branch, wildcard queries with leading '?'
>>> operator are no longer slow on big indexes (they do not enumerate terms in
>>> linear fashion).
>>> Thus, it no longer makes sense to throw a ParseException for a leading
>>> '?'
>>> So, users should be able to perform a query of "?foo" and no longer get a
>>> ParseException from the QueryParser.
>>> For the flexible indexing branch, wildcard queries of  'foo?', '?foo',
>>> 'f?oo', etc are all the same from a performance perspective.
>>>
>>
>> --
>> 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
>
>


-- 
Robert Muir
rcmuir@gmail.com

Re: [jira] Commented: (LUCENE-2262) QueryParser should now allow leading '?' wildcards

Posted by Mark Miller <ma...@gmail.com>.
Nah, let's just make fuzzy not work in the qp by default :) And make  
that back compat while your at it - while not abusing Version so that  
it's used for something subjective :) wouldn't want to rile up Hoss.

I'm like 3/4 serious.

- Mark

http://www.lucidimagination.com (mobile)

On Feb 13, 2010, at 10:22 PM, "Robert Muir (JIRA)" <ji...@apache.org>  
wrote:

>
>    [ https://issues.apache.org/jira/browse/LUCENE-2262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833496#action_12833496 
>  ]
>
> Robert Muir commented on LUCENE-2262:
> -------------------------------------
>
> bq. in my opinion disallowing these queries with leading wildcards,  
> be it * or ? or whatever, is rather silly, since we allow even  
> slower fuzzyqueries by default.
>
> bq. Agree.
>
> What do you think, should we skip this step then and simply  
> deprecate the entire setAllowLeadingWildcard concept all together,  
> setting it to true for Version >= 3.1?
>
>
>> QueryParser should now allow leading '?' wildcards
>> --------------------------------------------------
>>
>>                Key: LUCENE-2262
>>                URL: https://issues.apache.org/jira/browse/LUCENE-2262
>>            Project: Lucene - Java
>>         Issue Type: Improvement
>>         Components: QueryParser
>>   Affects Versions: Flex Branch
>>           Reporter: Robert Muir
>>           Assignee: Robert Muir
>>           Priority: Minor
>>            Fix For: Flex Branch
>>
>>        Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>>
>>
>> QueryParser currently throws an exception if a wildcard term begins  
>> with the '?' operator.
>> The current documentation describes why this is:
>> {noformat}
>> When set, * or ? are allowed as the first character of a  
>> PrefixQuery and WildcardQuery.
>> Note that this can produce very slow queries on big indexes.
>> {noformat}
>> In the flexible indexing branch, wildcard queries with leading '?'  
>> operator are no longer slow on big indexes (they do not enumerate  
>> terms in linear fashion).
>> Thus, it no longer makes sense to throw a ParseException for a  
>> leading '?'
>> So, users should be able to perform a query of "?foo" and no longer  
>> get a ParseException from the QueryParser.
>> For the flexible indexing branch, wildcard queries of  'foo?', '? 
>> foo', 'f?oo', etc are all the same from a performance perspective.
>
> -- 
> 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] Commented: (LUCENE-2262) QueryParser should now allow leading '?' wildcards

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

Robert Muir commented on LUCENE-2262:
-------------------------------------

bq. in my opinion disallowing these queries with leading wildcards, be it * or ? or whatever, is rather silly, since we allow even slower fuzzyqueries by default.

bq. Agree.

What do you think, should we skip this step then and simply deprecate the entire setAllowLeadingWildcard concept all together, setting it to true for Version >= 3.1?


> QueryParser should now allow leading '?' wildcards
> --------------------------------------------------
>
>                 Key: LUCENE-2262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>    Affects Versions: Flex Branch
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>
>
> QueryParser currently throws an exception if a wildcard term begins with the '?' operator.
> The current documentation describes why this is:
> {noformat}
> When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
> Note that this can produce very slow queries on big indexes. 
> {noformat}
> In the flexible indexing branch, wildcard queries with leading '?' operator are no longer slow on big indexes (they do not enumerate terms in linear fashion).
> Thus, it no longer makes sense to throw a ParseException for a leading '?'
> So, users should be able to perform a query of "?foo" and no longer get a ParseException from the QueryParser.
> For the flexible indexing branch, wildcard queries of  'foo?', '?foo', 'f?oo', etc are all the same from a performance perspective.

-- 
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-2262) QueryParser should now allow leading '?' wildcards

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833481#action_12833481 ] 

Yonik Seeley commented on LUCENE-2262:
--------------------------------------

It doesn't seem like this type of bug is not one that people would rely on (throwing an exception for ? but not for *), hence we should just fix and not make it conditional on matchVersion?

> QueryParser should now allow leading '?' wildcards
> --------------------------------------------------
>
>                 Key: LUCENE-2262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>    Affects Versions: Flex Branch
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>
>
> QueryParser currently throws an exception if a wildcard term begins with the ? operator.
> The docs say this:
> {noformat}
> When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
> Note that this can produce very slow queries on big indexes. 
> {noformat}
> In the flex branch, this is no longer true. foo?, ?foo, f?oo, these are all the same from a performance perspective.

-- 
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-2262) QueryParser should now allow leading '?' wildcards

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

Robert Muir updated LUCENE-2262:
--------------------------------

    Description: 
QueryParser currently throws an exception if a wildcard term begins with the '?' operator.

The current documentation describes why this is:
{noformat}
When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
Note that this can produce very slow queries on big indexes. 
{noformat}

In the flexible indexing branch, wildcard queries with leading '?' operator are no longer slow on big indexes (they do not enumerate terms in linear fashion).
Thus, it no longer makes sense to throw a ParseException for a leading '?'

So, users should be able to perform a query of "?foo" and no longer get a ParseException from the QueryParser.

For the flexible indexing branch, wildcard queries of  'foo?', '?foo', 'f?oo', etc are all the same from a performance perspective.

  was:
QueryParser currently throws an exception if a wildcard term begins with the ? operator.

The docs say this:
{noformat}
When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
Note that this can produce very slow queries on big indexes. 
{noformat}

In the flex branch, this is no longer true. foo?, ?foo, f?oo, these are all the same from a performance perspective.


update description to be less terse

> QueryParser should now allow leading '?' wildcards
> --------------------------------------------------
>
>                 Key: LUCENE-2262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>    Affects Versions: Flex Branch
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>
>
> QueryParser currently throws an exception if a wildcard term begins with the '?' operator.
> The current documentation describes why this is:
> {noformat}
> When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
> Note that this can produce very slow queries on big indexes. 
> {noformat}
> In the flexible indexing branch, wildcard queries with leading '?' operator are no longer slow on big indexes (they do not enumerate terms in linear fashion).
> Thus, it no longer makes sense to throw a ParseException for a leading '?'
> So, users should be able to perform a query of "?foo" and no longer get a ParseException from the QueryParser.
> For the flexible indexing branch, wildcard queries of  'foo?', '?foo', 'f?oo', etc are all the same from a performance perspective.

-- 
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-2262) QueryParser should now allow leading '?' wildcards

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833493#action_12833493 ] 

Yonik Seeley commented on LUCENE-2262:
--------------------------------------

bq. yonik, that's not what this issue is about. have you looked at the patch?

Nope, I was going by the comments. Looks like I misinterpreted them.  Sorry.

As an aside: In solr-land I encourage adding API examples, etc, to lower the bar for giving feedback (i.e. they don't have to read the patch to give an opinion on what the syntax of a new request should look like).  That's not a criticism of your description (which was fine) but rather the implication that I should have read the patch (and I may have misread that too).

bq. in my opinion disallowing these queries with leading wildcards, be it * or ? or whatever, is rather silly, since we allow even slower fuzzyqueries by default.

Agree.

> QueryParser should now allow leading '?' wildcards
> --------------------------------------------------
>
>                 Key: LUCENE-2262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2262
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>    Affects Versions: Flex Branch
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: LUCENE-2262.patch, LUCENE-2262_backwards.patch
>
>
> QueryParser currently throws an exception if a wildcard term begins with the ? operator.
> The docs say this:
> {noformat}
> When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
> Note that this can produce very slow queries on big indexes. 
> {noformat}
> In the flex branch, this is no longer true. foo?, ?foo, f?oo, these are all the same from a performance perspective.

-- 
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