You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "John Wang (JIRA)" <ji...@apache.org> on 2009/08/18 02:33:14 UTC

[jira] Created: (LUCENE-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
----------------------------------------------------------------------------

                 Key: LUCENE-1819
                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
             Project: Lucene - Java
          Issue Type: Bug
          Components: Search
    Affects Versions: 2.4.1
            Reporter: John Wang


Should be 

public String toString(String field){
  return "*:*";
}

QueryParser needs to be able to parse the String form of this query.

-- 
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-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

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

Mark Miller updated LUCENE-1819:
--------------------------------

         Priority: Minor  (was: Major)
    Lucene Fields: [New, Patch Available]  (was: [New])
         Assignee: Mark Miller

> MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-1819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4.1
>            Reporter: John Wang
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1819.patch
>
>
> Should be 
> public String toString(String field){
>   return "*:*";
> }
> QueryParser needs to be able to parse the String form of this query.

-- 
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-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

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

Mark Miller resolved LUCENE-1819.
---------------------------------

    Resolution: Fixed

Thanks John!

> MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-1819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4.1
>            Reporter: John Wang
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1819.patch
>
>
> Should be 
> public String toString(String field){
>   return "*:*";
> }
> QueryParser needs to be able to parse the String form of this query.

-- 
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-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

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

Mark Miller commented on LUCENE-1819:
-------------------------------------

bq. What are you thoughts about QueryParser being able to know about custom Query implementations? E.g. if I were to write a MyQuery class and implemen the toString method a certain way, how would QueryParser know about MyQuery?

Right - this has always been a limitation. That is why the wording has been loosened a lot of the years in Query.toString(). There is really not a lot you can do here - non of the SpanQuerys produce parsable toStrings because there is no support for SpanQuerys in the QueryParser. I think a couple others do not work either. I think its just got to be something we live with - you simply can't count on it - but if possible, its nice I guess - especially for the core queries.

bq.  Is it possible to extend QueryParser?

Its possible to extend it, but not really syntax wise. The new QueryParser in contrib will likely be more extensable in that regard in a way - though still you would be building another parser - it would just hopefully allow for a lot of non cut and paste reuse if you just want to add syntax (I think - I'm only at the surface with the new QP).

Overall though, its not really a contract, because its not something users can adhere to. Its more of an internal nicety suggestion - but if your not a Query already in the QP, your out of luck anyway - at best you could toString to a primitive query parsable String if your custom query rewrites to primitives.

> MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-1819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4.1
>            Reporter: John Wang
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1819.patch
>
>
> Should be 
> public String toString(String field){
>   return "*:*";
> }
> QueryParser needs to be able to parse the String form of this query.

-- 
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-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

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

Mark Miller updated LUCENE-1819:
--------------------------------

    Attachment: LUCENE-1819.patch

I agree - thanks John.

> MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-1819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4.1
>            Reporter: John Wang
>             Fix For: 2.9
>
>         Attachments: LUCENE-1819.patch
>
>
> Should be 
> public String toString(String field){
>   return "*:*";
> }
> QueryParser needs to be able to parse the String form of this query.

-- 
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-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

Posted by "John Wang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744530#action_12744530 ] 

John Wang commented on LUCENE-1819:
-----------------------------------

Thanks Mark for taking care of this issue!
w.r.t. this class, funny coincidence :)

What are you thoughts about QueryParser being able to know about custom Query implementations? E.g. if I were to write a MyQuery class and implemen the toString method a certain way, how would QueryParser know about MyQuery? Is it possible to extend QueryParser?

> MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-1819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4.1
>            Reporter: John Wang
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1819.patch
>
>
> Should be 
> public String toString(String field){
>   return "*:*";
> }
> QueryParser needs to be able to parse the String form of this query.

-- 
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-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

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

Mark Miller commented on LUCENE-1819:
-------------------------------------

Thats funny - I didn't realize you originally donated this back in 05 - 4 years later, almost to the day (it was committed August 21st), you are back to correct the parsable toString.

Thats interesting stuff.

> MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-1819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4.1
>            Reporter: John Wang
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1819.patch
>
>
> Should be 
> public String toString(String field){
>   return "*:*";
> }
> QueryParser needs to be able to parse the String form of this query.

-- 
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-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

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

Mark Miller commented on LUCENE-1819:
-------------------------------------

unless someone has an objection, I'm going to commit this in a day or two.

> MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-1819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4.1
>            Reporter: John Wang
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1819.patch
>
>
> Should be 
> public String toString(String field){
>   return "*:*";
> }
> QueryParser needs to be able to parse the String form of this query.

-- 
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-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

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

Mark Miller updated LUCENE-1819:
--------------------------------

    Fix Version/s: 2.9

> MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-1819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4.1
>            Reporter: John Wang
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1819.patch
>
>
> Should be 
> public String toString(String field){
>   return "*:*";
> }
> QueryParser needs to be able to parse the String form of this query.

-- 
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-1819) MatchAllDocsQuery.toString(String field) does not honor the javadoc contract

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

Yonik Seeley commented on LUCENE-1819:
--------------------------------------

bq. it would just hopefully allow for a lot of non cut and paste reuse if you just want to add syntax 

But the new query parser still uses the JavaCC grammar... so the most difficult part of adding new syntax (by far IMO) is unchanged.

> MatchAllDocsQuery.toString(String field) does not honor the javadoc contract
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-1819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1819
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4.1
>            Reporter: John Wang
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1819.patch
>
>
> Should be 
> public String toString(String field){
>   return "*:*";
> }
> QueryParser needs to be able to parse the String form of this query.

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