Quote:
Originally Posted by kovidgoyal
I suppose searching on dates should be implementable, in fact you should be able to do it yourself. I suggest the following syntax
Code:
pubdate:(><=)YYYY-MM-DD
month and day should be optional.
Similarly for date:
|
This shouldn't be hard to do. However, be careful with things like pubdate:>2000. If one is not careful, the 2000 would convert to 2000-01-01 for the comparison, which wouldn't work at all.
Given 30 seconds of thought, I think that if one does a equal-length substring match, everything works. pubdate:OP2000 would compare 4 characters. ..:OP2000-10 would compare 7. This should work with all the relational comparisons.
While at it, whoever does this should implement all the relational operators (=, >, <. !=. >=. <=). In addition, comparison strings that aren't valid dates (e.g., 2000-88-54) should raise PARSE_ERROR, which would indicate that the search has an error (search bar becomes pink).