You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Adriano Crestani (JIRA)" <ji...@apache.org> on 2009/10/02 01:02:23 UTC

[jira] Created: (LUCENE-1938) Precedence query parser using the contrib/queryparser framework

Precedence query parser using the contrib/queryparser framework
---------------------------------------------------------------

                 Key: LUCENE-1938
                 URL: https://issues.apache.org/jira/browse/LUCENE-1938
             Project: Lucene - Java
          Issue Type: New Feature
          Components: contrib/*
    Affects Versions: 2.9
            Reporter: Adriano Crestani
            Assignee: Adriano Crestani
            Priority: Minor
             Fix For: 3.1


Extend the current StandardQueryParser on contrib so it supports boolean precedence

-- 
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-1938) Precedence query parser using the contrib/queryparser framework

Posted by "Luis Alves (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763185#action_12763185 ] 

Luis Alves commented on LUCENE-1938:
------------------------------------

Hi Erik, 

Should we remove the PrecedenceQueryParser on 3.0, or wait untill 3.1, where we would enabled this new implementation?

> Precedence query parser using the contrib/queryparser framework
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1938
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1938
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: contrib/*
>    Affects Versions: 2.9
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-1938.patch
>
>
> Extend the current StandardQueryParser on contrib so it supports boolean precedence

-- 
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-1938) Precedence query parser using the contrib/queryparser framework

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

Adriano Crestani updated LUCENE-1938:
-------------------------------------

    Attachment: LUCENE-1938.patch

This patch contains a Precedence query parser. It's basically an extension of the current Standard query parser, but enables the boolean precedence.

The patch also contains the test cases from the current PrecedenceQueryParser, currently located under contrib/misc. Everything passes fine, except a test that tests if the query <A B C> is the same as <A OR B C>, when the default operator is OR. The problem is that this new PQP does not flat/optimize the boolean tree when the boolean operator is the same. It can be performed later, but for now it does not implement this kind of optimization.

Another issue is that I created a class under contrib/queryparser called PrecedenceQueryParser within the same package declaration the PQP from contrib/misc is right now. Is that a big issue? Couldn't the old PQP be removed and we start using this one, so we have no class conflict.

The greatest advantage of this implementation is that it basically reuses all the StandardQueryParser functiontalities and syntax, and any modification on the StandardQP will be automatically applied to the PrecedenceQP. No need to maintain 2 different implementations with the same code, as the old PQP does today.

> Precedence query parser using the contrib/queryparser framework
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1938
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1938
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: contrib/*
>    Affects Versions: 2.9
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-1938.patch
>
>
> Extend the current StandardQueryParser on contrib so it supports boolean precedence

-- 
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-1938) Precedence query parser using the contrib/queryparser framework

Posted by "Luis Alves (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763185#action_12763185 ] 

Luis Alves edited comment on LUCENE-1938 at 10/7/09 1:08 PM:
-------------------------------------------------------------

Hi Erik, 

Should we remove the PrecedenceQueryParser on 3.0, or wait untill 3.1?

      was (Author: lafa):
    Hi Erik, 

Should we remove the PrecedenceQueryParser on 3.0, or wait untill 3.1, where we would enabled this new implementation?
  
> Precedence query parser using the contrib/queryparser framework
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1938
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1938
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: contrib/*
>    Affects Versions: 2.9
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-1938.patch
>
>
> Extend the current StandardQueryParser on contrib so it supports boolean precedence

-- 
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-1938) Precedence query parser using the contrib/queryparser framework

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

Adriano Crestani reassigned LUCENE-1938:
----------------------------------------

    Assignee:     (was: Adriano Crestani)

> Precedence query parser using the contrib/queryparser framework
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1938
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1938
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: contrib/*
>    Affects Versions: 2.9
>            Reporter: Adriano Crestani
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-1938.patch
>
>
> Extend the current StandardQueryParser on contrib so it supports boolean precedence

-- 
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-1938) Precedence query parser using the contrib/queryparser framework

Posted by "Luis Alves (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763180#action_12763180 ] 

Luis Alves commented on LUCENE-1938:
------------------------------------

Hi,

I looked at the pipeline PrecedenceQueryNodeProcessorPipeline, it contains some complex logic off removing a processor from the StandardQueryNodeProcessorPipeline.

I think it would be better to have a common ancestor, CommonQueryNodeProcessorPipeline, that both StandardQueryNodeProcessorPipeline and PrecedenceQueryNodeProcessorPipeline can extend.
It should make it easier for people reading the code.
What do you think?

> Precedence query parser using the contrib/queryparser framework
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1938
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1938
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: contrib/*
>    Affects Versions: 2.9
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-1938.patch
>
>
> Extend the current StandardQueryParser on contrib so it supports boolean precedence

-- 
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-1938) Precedence query parser using the contrib/queryparser framework

Posted by "Erik Hatcher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761405#action_12761405 ] 

Erik Hatcher commented on LUCENE-1938:
--------------------------------------

Yes, let's just remove the old PrecedenceQueryParser (which was just an experiment by me - is anyone actually using it?)

> Precedence query parser using the contrib/queryparser framework
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1938
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1938
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: contrib/*
>    Affects Versions: 2.9
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-1938.patch
>
>
> Extend the current StandardQueryParser on contrib so it supports boolean precedence

-- 
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-1938) Precedence query parser using the contrib/queryparser framework

Posted by "Adriano Crestani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763365#action_12763365 ] 

Adriano Crestani commented on LUCENE-1938:
------------------------------------------

{quote}
I looked at the pipeline PrecedenceQueryNodeProcessorPipeline, it contains some complex logic off removing a processor from the StandardQueryNodeProcessorPipeline.

I think it would be better to have a common ancestor, CommonQueryNodeProcessorPipeline, that both StandardQueryNodeProcessorPipeline and PrecedenceQueryNodeProcessorPipeline can extend.
{quote}

I don't think it's so complex, it just removes GroupQueryNodeProcessor and adds ModifierQueryNodeProcessor (I think this is the class name). I also added this description to the javadocs.

Anyway, I would prefer to leave it like that, extending StandardQPP, instead of creating a common pipeline. The common pipeline would not make much sense right now, there is not QueryBuilder impl that would produce a correct Query instance from a query tree processed by it, so no one could just use it.

In future, we could have a third QP implementation, that instead of replacing GroupQueryNodeProcessor by ModifierQueryNodeProcessor, it would replace another processor, or switch the processors position, etc... the CommonQueryNodeProcessorPipeline would not make sense anymore, it only make sense right now for PrecedenceQP and StandardQP, because we know what both have in common, but doesn't mean a third QP would have the same in common.

So, +1 to leave it the way it's.


> Precedence query parser using the contrib/queryparser framework
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1938
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1938
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: contrib/*
>    Affects Versions: 2.9
>            Reporter: Adriano Crestani
>            Assignee: Adriano Crestani
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-1938.patch
>
>
> Extend the current StandardQueryParser on contrib so it supports boolean precedence

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