: When I parse DateRange query in a custom RequestHandler I get the date in
: format yyyy-MM-dd'T'HH:mm:ss, but I would like it with the trailling 'Z' for
: UTC time. Is there a way how to set the desired date format?
        ...
: Query q = QueryParsing.parseQuery(query, req.getSchema());
: log.debug(q.toString()); // output the dates in yyyy-MM-dd'T'HH:mm:ss format

what you are logging is the toString of the internal query object -- for 
field types that have special encodings (SortableIntField, etc...) this is 
going to be gibberish -- it's why there is a static 
QueryParsing.toString(Query,IndexSchema) method, which isn't perfect but 
does a decent job for debugging.

DateField may not seem like a field with "special incodings" but the 
the Z is missing when you look at that Query object for the same reason -- 
the indexed form suitable for searching and range queries is missing hte Z 
so that things sort properly.

in general, if you have an indexed term for a field, and you want to make 
it readable, you should the methods in the appropraite FieldType to 
convert it (I think the method is "indexedToReadable" but double check 
that)




-Hoss

Reply via email to