lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aurora <auror...@gmail.com>
Subject bookkeeping documents cause problem in Sort
Date Thu, 17 Feb 2005 06:33:57 GMT
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: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message