If you need to reprint, please indicate the source and the author. Thank you QQ: 221704msn: Flyly@yeah.Netemail: zhangfl@sports.cn is limited to the use of time range in the actual use. This means that it is impossible to query the time that is not infinite, nor It may be endless. You can find this in his document: org.apache.lucene.document.datafieldDates Before 1970 Cannot Be buy, and therefore cannot be indexed when useing this class 2970 is the beginning of Greenwich Time. If you need to be added If the time of the index is in 1970, you can't use it. Let's take a look at the source code in the source code.
Import java.util.date;
Public class datefield {private datefield () {}
// make date strings long enough to last_lenium private static int date_len = long.toT7tring (1000L * 365 * 24 * 60 * 60 * 1000, character.max_radix) .length ();
Public static string min_date_string () {return Timetostring (0);
Public static string max_date_string () {char [] buffer = new char [date_len]; char c = character.max_radix-1, character.max_radix; for (int i = 0; i / ** * Converts a Date to a string suitable for indexing. * @Throws RuntimeException if the date specified in the * method argument is before 1970 * / public static String dateToString (Date date) {return timeToString (date.getTime ()) ;.} / ** * Converts a millisecond time to a string suitable for indexing * @throws RuntimeException if the time specified in the * method argument is negative, that is, before 1970 * / public static String timeToString (long time) {if (TIME <0) Throw new runtimeException ("Time Too Early"); String s = long.toString (Time, Character.max_Radix); IF (S.Length ()> DATE_LEN) THROW New RuntimeException ("TIME TOO LATE"); // pad with listed zeros if (s.Length () . / ** Converts a string-encoded date into a millisecond time * / public static long stringToTime (String s) {return Long.parseLong (s, Character.MAX_RADIX);} / ** Converts a string-encoded date into a Date Object. * / public static date stringtodate (string s) {return new date (Stringtotime (s));}} is not very depressed, I don't know why the author wants such a restriction. The limit of the Java.util.date class is By 1900 (there is no verification. If you don't shoot bricks). However, the advantage of open source is to change the source code. Ha ha. After the above limitations, you will re-compile the package. Everything OK, the world is quiet when the PS: The purpose of the revised is to do time index for the picture of some nine-five years of age. If this requirement can do not have to modify it. I think the author has a restriction of this. It should be his reason. Go to his maillist there. ask.