Analysis : Fix no response from Analyze API without specified index
Fix error handling in TransportSingleShardAction without shardIt Closes #15148
This commit is contained in:
parent
445be98e4c
commit
267cd65506
|
@ -177,7 +177,7 @@ public abstract class TransportSingleShardAction<Request extends SingleShardRequ
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleException(TransportException exp) {
|
public void handleException(TransportException exp) {
|
||||||
perform(exp);
|
listener.onFailure(exp);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -503,4 +503,19 @@ public class AnalyzeActionIT extends ESIntegTestCase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testNonExistTokenizer() {
|
||||||
|
try {
|
||||||
|
AnalyzeResponse analyzeResponse = client().admin().indices()
|
||||||
|
.prepareAnalyze("this is a test")
|
||||||
|
.setAnalyzer("not_exist_analyzer")
|
||||||
|
.get();
|
||||||
|
fail("shouldn't get here");
|
||||||
|
} catch (Throwable t) {
|
||||||
|
assertThat(t, instanceOf(IllegalArgumentException.class));
|
||||||
|
assertThat(t.getMessage(), startsWith("failed to find analyzer"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue