From 745b8cbefe56c0f68040339095d6327a81d78161 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Wed, 10 Aug 2011 16:52:10 +0300 Subject: [PATCH] Full field paths not respected in sort parameters, closes #1226. --- .../java/org/elasticsearch/search/sort/SortParseElement.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/search/sort/SortParseElement.java b/modules/elasticsearch/src/main/java/org/elasticsearch/search/sort/SortParseElement.java index f5e1cba9833..021269dbdc4 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/search/sort/SortParseElement.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/search/sort/SortParseElement.java @@ -142,7 +142,7 @@ public class SortParseElement implements SearchParseElement { if (fieldMapper == null) { throw new SearchParseException(context, "No mapping found for [" + fieldName + "]"); } - sortFields.add(new SortField(fieldName, fieldMapper.fieldDataType().newFieldComparatorSource(context.fieldDataCache(), missing), reverse)); + sortFields.add(new SortField(fieldMapper.names().indexName(), fieldMapper.fieldDataType().newFieldComparatorSource(context.fieldDataCache(), missing), reverse)); } } }