parent
a14db8e17e
commit
7ad804fa52
|
@ -99,7 +99,7 @@ public abstract class MappedFieldType extends FieldType {
|
|||
|
||||
/** Return a fielddata builder for this field. */
|
||||
public IndexFieldData.Builder fielddataBuilder() {
|
||||
throw new IllegalArgumentException("Fielddata is not supported on fields of type [" + typeName() + "]");
|
||||
throw new IllegalArgumentException("Fielddata is not supported on field [" + name() + "] of type [" + typeName() + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -222,10 +222,6 @@ public abstract class MappedFieldType extends FieldType {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isSortable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
|
|
@ -344,11 +344,6 @@ public class CompletionFieldMapper extends FieldMapper implements ArrayValueMapp
|
|||
return value.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSortable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -263,10 +263,6 @@ public class FieldSortBuilder extends SortBuilder<FieldSortBuilder> {
|
|||
}
|
||||
}
|
||||
|
||||
if (!fieldType.isSortable()) {
|
||||
throw new QueryShardException(context, "Sorting not supported for field[" + fieldName + "]");
|
||||
}
|
||||
|
||||
MultiValueMode localSortMode = null;
|
||||
if (sortMode != null) {
|
||||
localSortMode = MultiValueMode.fromString(sortMode.toString());
|
||||
|
|
|
@ -834,7 +834,7 @@ public class CompletionSuggestSearchIT extends ESIntegTestCase {
|
|||
fail("Expected an exception due to trying to sort on completion field, but did not happen");
|
||||
} catch (SearchPhaseExecutionException e) {
|
||||
assertThat(e.status().getStatus(), is(400));
|
||||
assertThat(e.toString(), containsString("Sorting not supported for field[" + FIELD + "]"));
|
||||
assertThat(e.toString(), containsString("Fielddata is not supported on field [" + FIELD + "] of type [completion]"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1114,7 +1114,7 @@ public class CompletionSuggestSearchIT extends ESIntegTestCase {
|
|||
// Exception must be thrown
|
||||
assertFalse(true);
|
||||
} catch (SearchPhaseExecutionException e) {
|
||||
assertThat(e.toString(), containsString("Fielddata is not supported on fields of type [completion]"));
|
||||
assertThat(e.toString(), containsString("Fielddata is not supported on field [" + FIELD + "] of type [completion]"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue