I understand that unlike relational database, Lucene is flexible in having documents with different set of fields. My index has documents with a date and content field. There are also a few book keeping documents that does not have the date field. Things work well except in one case:

  Sort sort = Sort('date');
  searcher.search(query, sort);

In this case an exception is thrown:

  java.lang.RuntimeException: field "date" does not appear to be indexed

It does not make sense to sort by 'date' when the document does not has 'date'. On the other hand I don't expect the search() to return any book keeping documents at all since the current look for fields not in those documents. Is this an implementation issue or is there any inherent reason all document need to have the 'date' field if it is sorted?


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



Reply via email to