diff --git a/src/java/org/apache/lucene/search/SortField.java b/src/java/org/apache/lucene/search/SortField.java index 4c249066a52..1ca5b19578e 100644 --- a/src/java/org/apache/lucene/search/SortField.java +++ b/src/java/org/apache/lucene/search/SortField.java @@ -146,8 +146,9 @@ implements Serializable { default: buffer.append("\"" + field + "\""); break; } - - buffer.append(reverse ? " DESC" : " ASC"); + + if (reverse) + buffer.append('!'); return buffer.toString(); }