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 2011/01/26 21:16:45 UTC

[jira] Created: (LUCENE-2892) Add QueryParser.newFieldQuery

Add QueryParser.newFieldQuery
-----------------------------

                 Key: LUCENE-2892
                 URL: https://issues.apache.org/jira/browse/LUCENE-2892
             Project: Lucene - Java
          Issue Type: Improvement
          Components: QueryParser
            Reporter: Robert Muir
         Attachments: LUCENE-2892.patch

Note: this patch changes no behavior, just makes QP more subclassable.

Currently we have Query getFieldQuery(String field, String queryText, boolean quoted)
This contains very hairy methods for producing a query from QP's analyzer.

I propose we factor this into newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted)
Then getFieldQuery just calls newFieldQuery(this.analyzer, field, queryText, quoted);

The reasoning is: it can be quite useful to consider the double quote as more than phrases, but a "more exact" search.
In the case the user quoted the terms, you might want to analyze the text with an alternate analyzer that:
doesn't produce synonyms, doesnt decompose compounds, doesn't use WordDelimiterFilter 
(you would need to be using preserveOriginal=true at index time for the WDF one), etc etc.

This is similar to the way google's double quote operator works, its not defined as phrase but "this exact wording or phrase".
For example compare results to a query of tests versus "tests".

Currently you can do this without heavy code duplication, but really only if you make a separate field (which is wasteful),
and make your custom QP lie about its field... in the examples I listed above you can do this with a single field, yet still
have a more exact phrase search.


-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Updated: (LUCENE-2892) Add QueryParser.newFieldQuery

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

Robert Muir updated LUCENE-2892:
--------------------------------

    Fix Version/s: 4.0

> Add QueryParser.newFieldQuery
> -----------------------------
>
>                 Key: LUCENE-2892
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2892
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>             Fix For: 4.0
>
>         Attachments: LUCENE-2892.patch
>
>
> Note: this patch changes no behavior, just makes QP more subclassable.
> Currently we have Query getFieldQuery(String field, String queryText, boolean quoted)
> This contains very hairy methods for producing a query from QP's analyzer.
> I propose we factor this into newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted)
> Then getFieldQuery just calls newFieldQuery(this.analyzer, field, queryText, quoted);
> The reasoning is: it can be quite useful to consider the double quote as more than phrases, but a "more exact" search.
> In the case the user quoted the terms, you might want to analyze the text with an alternate analyzer that:
> doesn't produce synonyms, doesnt decompose compounds, doesn't use WordDelimiterFilter 
> (you would need to be using preserveOriginal=true at index time for the WDF one), etc etc.
> This is similar to the way google's double quote operator works, its not defined as phrase but "this exact wording or phrase".
> For example compare results to a query of tests versus "tests".
> Currently you can do this without heavy code duplication, but really only if you make a separate field (which is wasteful),
> and make your custom QP lie about its field... in the examples I listed above you can do this with a single field, yet still
> have a more exact phrase search.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (LUCENE-2892) Add QueryParser.newFieldQuery

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

Robert Muir commented on LUCENE-2892:
-------------------------------------

I think this is an easy win for some common use cases from the API perspective.

If no one objects i'll commit in a few days.

> Add QueryParser.newFieldQuery
> -----------------------------
>
>                 Key: LUCENE-2892
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2892
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>            Reporter: Robert Muir
>             Fix For: 4.0
>
>         Attachments: LUCENE-2892.patch
>
>
> Note: this patch changes no behavior, just makes QP more subclassable.
> Currently we have Query getFieldQuery(String field, String queryText, boolean quoted)
> This contains very hairy methods for producing a query from QP's analyzer.
> I propose we factor this into newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted)
> Then getFieldQuery just calls newFieldQuery(this.analyzer, field, queryText, quoted);
> The reasoning is: it can be quite useful to consider the double quote as more than phrases, but a "more exact" search.
> In the case the user quoted the terms, you might want to analyze the text with an alternate analyzer that:
> doesn't produce synonyms, doesnt decompose compounds, doesn't use WordDelimiterFilter 
> (you would need to be using preserveOriginal=true at index time for the WDF one), etc etc.
> This is similar to the way google's double quote operator works, its not defined as phrase but "this exact wording or phrase".
> For example compare results to a query of tests versus "tests".
> Currently you can do this without heavy code duplication, but really only if you make a separate field (which is wasteful),
> and make your custom QP lie about its field... in the examples I listed above you can do this with a single field, yet still
> have a more exact phrase search.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Assigned: (LUCENE-2892) Add QueryParser.newFieldQuery

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

Robert Muir reassigned LUCENE-2892:
-----------------------------------

    Assignee: Robert Muir

> Add QueryParser.newFieldQuery
> -----------------------------
>
>                 Key: LUCENE-2892
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2892
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>             Fix For: 4.0
>
>         Attachments: LUCENE-2892.patch
>
>
> Note: this patch changes no behavior, just makes QP more subclassable.
> Currently we have Query getFieldQuery(String field, String queryText, boolean quoted)
> This contains very hairy methods for producing a query from QP's analyzer.
> I propose we factor this into newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted)
> Then getFieldQuery just calls newFieldQuery(this.analyzer, field, queryText, quoted);
> The reasoning is: it can be quite useful to consider the double quote as more than phrases, but a "more exact" search.
> In the case the user quoted the terms, you might want to analyze the text with an alternate analyzer that:
> doesn't produce synonyms, doesnt decompose compounds, doesn't use WordDelimiterFilter 
> (you would need to be using preserveOriginal=true at index time for the WDF one), etc etc.
> This is similar to the way google's double quote operator works, its not defined as phrase but "this exact wording or phrase".
> For example compare results to a query of tests versus "tests".
> Currently you can do this without heavy code duplication, but really only if you make a separate field (which is wasteful),
> and make your custom QP lie about its field... in the examples I listed above you can do this with a single field, yet still
> have a more exact phrase search.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Resolved: (LUCENE-2892) Add QueryParser.newFieldQuery

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

Robert Muir resolved LUCENE-2892.
---------------------------------

    Resolution: Fixed

Committed revision 1069977.

> Add QueryParser.newFieldQuery
> -----------------------------
>
>                 Key: LUCENE-2892
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2892
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>             Fix For: 4.0
>
>         Attachments: LUCENE-2892.patch
>
>
> Note: this patch changes no behavior, just makes QP more subclassable.
> Currently we have Query getFieldQuery(String field, String queryText, boolean quoted)
> This contains very hairy methods for producing a query from QP's analyzer.
> I propose we factor this into newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted)
> Then getFieldQuery just calls newFieldQuery(this.analyzer, field, queryText, quoted);
> The reasoning is: it can be quite useful to consider the double quote as more than phrases, but a "more exact" search.
> In the case the user quoted the terms, you might want to analyze the text with an alternate analyzer that:
> doesn't produce synonyms, doesnt decompose compounds, doesn't use WordDelimiterFilter 
> (you would need to be using preserveOriginal=true at index time for the WDF one), etc etc.
> This is similar to the way google's double quote operator works, its not defined as phrase but "this exact wording or phrase".
> For example compare results to a query of tests versus "tests".
> Currently you can do this without heavy code duplication, but really only if you make a separate field (which is wasteful),
> and make your custom QP lie about its field... in the examples I listed above you can do this with a single field, yet still
> have a more exact phrase search.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Updated: (LUCENE-2892) Add QueryParser.newFieldQuery

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

Robert Muir updated LUCENE-2892:
--------------------------------

    Attachment: LUCENE-2892.patch

> Add QueryParser.newFieldQuery
> -----------------------------
>
>                 Key: LUCENE-2892
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2892
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: QueryParser
>            Reporter: Robert Muir
>         Attachments: LUCENE-2892.patch
>
>
> Note: this patch changes no behavior, just makes QP more subclassable.
> Currently we have Query getFieldQuery(String field, String queryText, boolean quoted)
> This contains very hairy methods for producing a query from QP's analyzer.
> I propose we factor this into newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted)
> Then getFieldQuery just calls newFieldQuery(this.analyzer, field, queryText, quoted);
> The reasoning is: it can be quite useful to consider the double quote as more than phrases, but a "more exact" search.
> In the case the user quoted the terms, you might want to analyze the text with an alternate analyzer that:
> doesn't produce synonyms, doesnt decompose compounds, doesn't use WordDelimiterFilter 
> (you would need to be using preserveOriginal=true at index time for the WDF one), etc etc.
> This is similar to the way google's double quote operator works, its not defined as phrase but "this exact wording or phrase".
> For example compare results to a query of tests versus "tests".
> Currently you can do this without heavy code duplication, but really only if you make a separate field (which is wasteful),
> and make your custom QP lie about its field... in the examples I listed above you can do this with a single field, yet still
> have a more exact phrase search.

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org