You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2013/03/11 19:05:13 UTC

[jira] [Commented] (SOLR-4538) DateMath strings truncated to 32 chars by lucene qparser in simple term queries

    [ https://issues.apache.org/jira/browse/SOLR-4538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13599066#comment-13599066 ] 

Uwe Schindler commented on SOLR-4538:
-------------------------------------

Hoss: The term attribute is misused in the patch (as it is populated in ctor/reset()). It is also shared with the inner NumericTokenStream, which makes me nervous in combination with your changes. I just want to be sure, that the termattribute's contents are not used after thee ctor finishes, so incrementToken() can do what it wants with the attribute. :-)

You should maybe add a comment or use a separate growable instance like StringBuilder to get the chars and not misuse the term attribute.
                
> DateMath strings truncated to 32 chars by lucene qparser in simple term queries
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-4538
>                 URL: https://issues.apache.org/jira/browse/SOLR-4538
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 4.1
>            Reporter: Minoru Osuka
>            Assignee: Hoss Man
>         Attachments: SOLR-4538.patch, SOLR-4538.patch, SOLR-4538_test.patch
>
>
> When using the "lucene" QParser, term queries on date fields cause the field value portion of the query clause to be truncated at 32 characters. This can cause visible errors about invalid date math expressions, or may result in silently returning incorrect results if the truncation results in a valid (but incomplete) date math expression.
> For example...
> {noformat}
> Example...
> last_modified:"2013-03-08T00:46:15Z/DAY+6MONTHS+3DAYS"
> ...truncates to...
> last_modified:"2013-03-08T00:46:15Z/DAY+6MONTHS"
> (silently incorrect)
> foo_tdt:"2013-03-10T08:00:00.1Z/MINUTE+6MONTHS"
> ...truncates to...
> foo_tdt:2013-03-10T08:00:00.1Z/MINUTE+6M
> ("Invalid Date Math String" error msg)
> {noformat}
> This problem does not affect range queries, or queries using either the term or field qparsers...
> {noformat}
> Examples that work fine even though the math is longer then 32 chars...
> foo_tdt:[2013-03-10T08:00:00.1Z/MINUTE+6MONTHS TO 2013-03-10T08:00:00.1Z/MINUTE+6MONTHS]
> {!term f=bday}1976-07-04T12:08:56.45Z/SECOND+235MILLIS
> foo_tdt:"2013-03-10T08:00:00.1Z/MINUTE+6MONTHS"
> {noformat}
> {panel:title=Original problem report}
> DateMathParser doesn't work correctly.
> http://lucene.apache.org/solr/4_1_0/solr-core/org/apache/solr/util/DateMathParser.html
> fq=last_modified:"2013-03-08T00:46:15Z/DAY+6MONTHS+3DAYS"
> expected; last_modified:2013-09-11T00:00:00Z
> actual; last_modified:2013-09-08T00:00:00Z
> {panel}

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