You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Miklós Márton (JIRA)" <ji...@apache.org> on 2012/09/24 19:27:07 UTC

[jira] [Created] (SOLR-3878) NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField

Miklós Márton created SOLR-3878:
-----------------------------------

             Summary: NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField
                 Key: SOLR-3878
                 URL: https://issues.apache.org/jira/browse/SOLR-3878
             Project: Solr
          Issue Type: Bug
          Components: query parsers
    Affects Versions: 3.6.1
            Reporter: Miklós Márton
            Priority: Minor


According to the [wiki|http://wiki.apache.org/solr/CurrencyField#Querying] wildcard range queries are supported. In reality either of the following queries result in NPE using the example schema.

- price_c:[* TO 1000]
- price_c:[* TO 1000,USD]
- price_c:[*,USD TO 1000,USD]
- price_c:[1000 TO *]
- price_c:[1000,USD TO *]
- price_c:[1000,USD TO *]


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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] (SOLR-3878) NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField

Posted by "Jan Høydahl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-3878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Høydahl updated SOLR-3878:
------------------------------

    Attachment: SOLR-3878.patch

Patch for trunk attached, including tests
                
> NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-3878
>                 URL: https://issues.apache.org/jira/browse/SOLR-3878
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 3.6.1, 4.0-BETA
>            Reporter: Miklós Márton
>            Assignee: Jan Høydahl
>            Priority: Critical
>             Fix For: 4.0, 4.1, 5.0
>
>         Attachments: SOLR-3878.patch
>
>
> According to the [wiki|http://wiki.apache.org/solr/CurrencyField#Querying] wildcard range queries are supported. In reality either of the following queries result in NPE using the example schema.
> - price_c:[* TO 1000]
> - price_c:[* TO 1000,USD]
> - price_c:[*,USD TO 1000,USD]
> - price_c:[1000 TO *]
> - price_c:[1000,USD TO *]
> - price_c:[1000,USD TO *]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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] (SOLR-3878) NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField

Posted by "Jan Høydahl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-3878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Høydahl resolved SOLR-3878.
-------------------------------

    Resolution: Fixed

Committed to trunk (1389659), 4.x (1389675) and 4.0.0 (1389679)

Hoss, I kept the implementation returning null as CurrencyValue as this actually means fewer changes, and is more inline with the other range methods.
Regarding price_c:*, that did not work in 3.6 either (returns 0 hits), and does not work now. Will file a separate issue.
Also, polishing JavaDocs can be dealt with post 4.0.0 release.
                
> NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-3878
>                 URL: https://issues.apache.org/jira/browse/SOLR-3878
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 3.6.1, 4.0-BETA
>            Reporter: Miklós Márton
>            Assignee: Jan Høydahl
>            Priority: Critical
>             Fix For: 4.0, 4.1, 5.0
>
>         Attachments: SOLR-3878.patch
>
>
> According to the [wiki|http://wiki.apache.org/solr/CurrencyField#Querying] wildcard range queries are supported. In reality either of the following queries result in NPE using the example schema.
> - price_c:[* TO 1000]
> - price_c:[* TO 1000,USD]
> - price_c:[*,USD TO 1000,USD]
> - price_c:[1000 TO *]
> - price_c:[1000,USD TO *]
> - price_c:[1000,USD TO *]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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] (SOLR-3878) NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField

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

Hoss Man commented on SOLR-3878:
--------------------------------

Jan: i've only skimmed the patch, but would it be better/simpler if CurrencyValue.parse(...) always returned a non null CurrencyValue object, but that CurrencyValue.getAmmount() could return null (ie: make it return Long instead of long)?

that seems like it would simply some of the null checks you had to add in your patch.

either way:

* CurrencyValue.parse should have some javadocs talking about how it deals with "\*" as input
* other uses of CurrencyValue.parse need to be checked to ensure the behavior appropriately if "\*" is specified as a value (ie: will i get a meaningful error if I try to add a document with a value of "*" ? what happens if i do a query on {{currency_field:\*}}


                
> NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-3878
>                 URL: https://issues.apache.org/jira/browse/SOLR-3878
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 3.6.1, 4.0-BETA
>            Reporter: Miklós Márton
>            Assignee: Jan Høydahl
>            Priority: Critical
>             Fix For: 4.0, 4.1, 5.0
>
>         Attachments: SOLR-3878.patch
>
>
> According to the [wiki|http://wiki.apache.org/solr/CurrencyField#Querying] wildcard range queries are supported. In reality either of the following queries result in NPE using the example schema.
> - price_c:[* TO 1000]
> - price_c:[* TO 1000,USD]
> - price_c:[*,USD TO 1000,USD]
> - price_c:[1000 TO *]
> - price_c:[1000,USD TO *]
> - price_c:[1000,USD TO *]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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] (SOLR-3878) NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField

Posted by "Jan Høydahl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-3878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Høydahl updated SOLR-3878:
------------------------------

    Affects Version/s: 4.0-BETA
        Fix Version/s: 4.0

Aiming for the 4.0 respin
                
> NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-3878
>                 URL: https://issues.apache.org/jira/browse/SOLR-3878
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 3.6.1, 4.0-BETA
>            Reporter: Miklós Márton
>            Assignee: Jan Høydahl
>            Priority: Critical
>             Fix For: 4.0, 4.1, 5.0
>
>
> According to the [wiki|http://wiki.apache.org/solr/CurrencyField#Querying] wildcard range queries are supported. In reality either of the following queries result in NPE using the example schema.
> - price_c:[* TO 1000]
> - price_c:[* TO 1000,USD]
> - price_c:[*,USD TO 1000,USD]
> - price_c:[1000 TO *]
> - price_c:[1000,USD TO *]
> - price_c:[1000,USD TO *]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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] (SOLR-3878) NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField

Posted by "Miklós Márton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-3878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462307#comment-13462307 ] 

Miklós Márton commented on SOLR-3878:
-------------------------------------

Hoss says something... Either way: I'm pretty happy that it's already solved. :]

I hate to nitpick, but as I checked the source (always happy to learn something), I noticed a typo in the block comment above CurrencyValue.parse():
{code}
   * <p/>
   * Currency values are expected to be in the format &lt;amount&gt;,&lt;currency code&gt;,
   * for example, "500,USD" would represent 5 U.S. Dollars.
   * <p/>
{code}

I assume it should be "... *500* U.S. Dollars ..."

                
> NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-3878
>                 URL: https://issues.apache.org/jira/browse/SOLR-3878
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 3.6.1, 4.0-BETA
>            Reporter: Miklós Márton
>            Assignee: Jan Høydahl
>            Priority: Critical
>             Fix For: 4.0, 4.1, 5.0
>
>         Attachments: SOLR-3878.patch
>
>
> According to the [wiki|http://wiki.apache.org/solr/CurrencyField#Querying] wildcard range queries are supported. In reality either of the following queries result in NPE using the example schema.
> - price_c:[* TO 1000]
> - price_c:[* TO 1000,USD]
> - price_c:[*,USD TO 1000,USD]
> - price_c:[1000 TO *]
> - price_c:[1000,USD TO *]
> - price_c:[1000,USD TO *]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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] (SOLR-3878) NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField

Posted by "Jan Høydahl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-3878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Høydahl reassigned SOLR-3878:
---------------------------------

    Assignee: Jan Høydahl
    
> NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-3878
>                 URL: https://issues.apache.org/jira/browse/SOLR-3878
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 3.6.1
>            Reporter: Miklós Márton
>            Assignee: Jan Høydahl
>            Priority: Minor
>             Fix For: 4.1, 5.0
>
>
> According to the [wiki|http://wiki.apache.org/solr/CurrencyField#Querying] wildcard range queries are supported. In reality either of the following queries result in NPE using the example schema.
> - price_c:[* TO 1000]
> - price_c:[* TO 1000,USD]
> - price_c:[*,USD TO 1000,USD]
> - price_c:[1000 TO *]
> - price_c:[1000,USD TO *]
> - price_c:[1000,USD TO *]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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] (SOLR-3878) NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField

Posted by "Jan Høydahl (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-3878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Høydahl updated SOLR-3878:
------------------------------

         Priority: Critical  (was: Minor)
    Fix Version/s: 5.0
                   4.1

Confirmed. The code does not support open-ended ranges :( Starting a fix.
                
> NPE in CurrencyValue.parse() while issuing wildcard range query on a CurrencyField
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-3878
>                 URL: https://issues.apache.org/jira/browse/SOLR-3878
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 3.6.1
>            Reporter: Miklós Márton
>            Assignee: Jan Høydahl
>            Priority: Critical
>             Fix For: 4.1, 5.0
>
>
> According to the [wiki|http://wiki.apache.org/solr/CurrencyField#Querying] wildcard range queries are supported. In reality either of the following queries result in NPE using the example schema.
> - price_c:[* TO 1000]
> - price_c:[* TO 1000,USD]
> - price_c:[*,USD TO 1000,USD]
> - price_c:[1000 TO *]
> - price_c:[1000,USD TO *]
> - price_c:[1000,USD TO *]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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