lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirko Torrisi <>
Subject Re: Invalid Date String:'1992-07-10T17'
Date Wed, 11 Mar 2015 10:06:33 GMT
Thanks very much for each of your replies. These resolved my problem and 
teach me something important.
I have just discovered that I have another problem but I guess that I 
have to open another discussion.



On 10/03/15 20:30, Chris Hostetter wrote:
> ":" is a syntactically significant character to the query parser, so it's
> getting confused by it in the text of your query.
> you're seeing the same problem as if you tried to search for "foo:bar" in
> the "yak" field using q=yak:foo:bar
> you either need to backslash escape the ":" characters, or wrap the date
> in quotes, or use a diff parser that doesn't treat colons as special
> characters (but remember that since you are building this up as a java
> string, you have to deal with *java* string escaping as well...
>     String a = "speechDate:1992-07-10T17\\:33\\:18Z";
>     String a = "speechDate:\"1992-07-10T17:33:18Z\"";
>     String a = "speechDate:" + ClientUtils.escapeQueryChars("1992-07-10T17:33:18Z");
>     String a = "{!field f=speechDate}1992-07-10T17:33:18Z";
> : My goal is to group these speeches (hopefully using date math syntax). I would
> Unless you are truely seraching for only documents that have an *exact*
> date value matching your input (down to the millisecond) then seraching or
> a single date value is almost certainly not what you want -- you most
> likely want to do a range search...
>    String a = "speechDate:[1992-07-10T00:00:00Z TO 1992-07-11T00:00:00Z]";
> (which doesn't require special escaping, because the query parser is smart
> enough to know that ":" aren't special inside of the "[..]")
> : like to know if you suggest me to use date or tdate or other because I have
> : not understood the difference.
> the difference between date and tdate has to do with how you wnat to trade
> index size (on disk & in ram) with search speed for range queries like
> these -- tdate takes up a little more room in the index, but came make
> range queries faster.
> -Hoss

View raw message