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

Hoss Man commented on SOLR-4538:
--------------------------------

bq. Although I don't like the pattern-misuse of CharTermAttribute

as mentioned in IRC: the patch initially started trying to be consistent with 
how KeywordTokenizer works, but since NumericTokenStream doesn't support 
CharTermAttribute i made it private instead of using addAttribute().

If anyone feels strongly about changing the implementation to not using 
CharTermAttributeImpl (and replace with StringBuilder, io-utils reader2String, 
whatever..) feel free, but i just choose to leave CharTermAttributeImpl in here 
because: a) i'd already written the code & committed it to trunk before i even 
saw uwe's comment; b) it keeps the buffer resizing abstracted away out of the 
tokenizer and consistent with the behaviour of other tokenizers.

                
> 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
>             Fix For: 4.3
>
>         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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to