On Jun 13, 2005, at 7:47 AM, Harald Stowasser wrote:
1. Sorting by Date is ruinously slow. So I deactivated it.

How were you sorting by date?

3. I also read that we should save the Date as YYYYMMDD-String. I don't like this solution, because I don't know that this will work. And then I
have to reindex the whole Data!

It will work :) Terms need to be lexicographically orderable - and using YYYYMMDD will do just that as long as you don't need granularity beyond day. However, before reindexing with YYYYMMDD - what are your searching/sorting needs? If day is the granularity, then YYYYMMDD will be fine. However you may want to break it into more fields such as year, month, and day separately. Note: keep numbers padded to the same number of characters (1 for a day field should be "01" for example).

For sorting, you may find that once you've used YYYYMMDD that you can then sort with the field type as INT on that same field (use Field.Keyword for indexing).

[3]
My Fields:
  neu.setBoost( boost  );
  neu.add(Field.UnStored("content",content));
  neu.add(Field.Keyword("keyword",keyword));
  ConfDate date = new ConfDate(datum);
  neu.add(Field.Keyword("datum",(Date)date.getUtilDate()));
  neu.add(Field.UnIndexed("content_vorschau",content_vorschau));
  neu.add(Field.UnIndexed("content_id",""+content_id));
  neu.add(Field.UnIndexed("zeitstempel",zeitstempel));
  neu.add(Field.UnIndexed("link",link));
  neu.add(Field.Keyword("bereich",bereich));
  index.addDocument(neu);

What kind of granularity for dates does ConfDate.getUtilDate() return?

Using Date for Field.Keyword indexes to the millisecond granularity - that is very unlikely to be of use to you at that level.

    Erik


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

Reply via email to