I think you are doing it right. Fields used for sorting must be Keyword type. See you are not adding the Field more than once for the same Document. -----"Taylor, BE \(Beverley\)" <[EMAIL PROTECTED]> escribió: ----- Para: <java-user@lucene.apache.org> De: "Taylor, BE \(Beverley\)" <[EMAIL PROTECTED]> Fecha: 23/11/2005 16:04 Asunto: there are more terms than documents in field <my sort field> Hi Everyone, I am very new to Lucene and am trying to perform a sort on a field containing strings. I get the error message: there are more terms than documents in field I have read through the same problem in the user group archives and the replies usually ask the person if they are trying to sort on a tokenised field, however, I can't see any further correspondence to say whether they were or not and if they found a solution. I create my index as below, where field is the field name I am trying to sort and sortvalue is the text content of the field. From what I have read, I think this is creating an index field which is stored but not tokenised: doc.add(Field.Keyword(field, sortvalue)); Does anyone know how to look into this problem further or can point me in the direction of a solution? Many thanks in anticipation, Beverley Taylor --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]