Searching/Filtering through Dates and Numbers

Submitted by rizjoj on Thu, 2007-10-11 08:43.Troubleshooting

How can I search a date range?

When I index a date column I get a value like 011895696000000. From previous posts I know how to display it as a date. However, how can you search with a date range on it?

Apparently I can't search based on a particular column either. For example: a Query like: 'MyColumn1: Books' gives me no results. But of course just Books will return results although I can't restrict the term to the field MyColumn1.

To search on a date or numeric range, do I have to normalize the field? I.e, for Numbers - convert 1.234, 10.56 to 01.234 and 10.560)? and for Dates - convert 7/19/2007, 7/20/07 to 2007-07-19 and 2007-07-20 even though the field is Date/Time?

I've tried all possibilities - ColumnName: (Term), ColumnName: Term, MyDate: 07-20-2007, MyDate: 07/20/2007, MyDate: 2007-07-20, MyDate: 20070720 (with and without parenthesis). None worked.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Submitted by will on Thu, 2007-10-11 13:30.
Submitted by rizjoj on Fri, 2007-10-12 21:27.

The number column works. However, the date doesn't work so well. It doesn't return the right count, sometimes overshoots a bit. And if query had the format yyyy/mm/dd instead of yyyy/m/dd it won't find the record. Am I missing a configuration setting here?

Submitted by will on Sat, 2007-10-13 12:25.

Not sure, but if you can append

 &debug=y

to the search url, you may see something like:

 DEBUG 10-13 13:21:19,339|Advanced query: +last_added_time:[01144998000000 TO 01145084400000}|SearchAction:getSearchQuery

This will be the filtering Lucene range query for

 last_added_time:[2006/04/14,2006/04/15)

And I test this format, seems it's been translated into the same query with the same search results.

 last_added_time:[2006/04/14,2006/4/15)