Michael J. Prichard wrote:

I am working on indexing emails and have stored the data as milliseconds. I was thinking of using a filter w/ my search that would only return the email in that data range. I am currently indexing as follows:

doc.add(new Field("date", (String) itemContent.get("date").toString(), Field.Store.YES, Field.Index.UN_TOKENIZED));

does this look like a good approach to you all?


Using milliseconds as your resolutions will make range searches very slow, since it has to enumerate so many values. I suggest using at most minutes instead.

But either way I suggest using DateTools rather than using a Date object's toString() form, i.e.:

doc.add(new Field("date", DateTools.dateToString(itemContent.get("date"), DateTools.Resolution.MILLISECOND), Field.Store.YES, Field.Index.UN_TOKENIZED));




Miles

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to