fix #2727 check opensearchexception on query processing
This commit is contained in:
parent
1141fdf774
commit
7edb18d39b
5 changed files with 26 additions and 0 deletions
|
@ -948,6 +948,12 @@ public class SearchEngineClient implements Client {
|
|||
} catch (final SearchPhaseExecutionException e) {
|
||||
throw new InvalidQueryException(messages -> messages.addErrorsInvalidQueryParseError(UserMessages.GLOBAL_PROPERTY_KEY),
|
||||
"Invalid query: " + searchRequestBuilder, e);
|
||||
} catch (final OpenSearchException e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Cannot process {}", searchRequestBuilder, e);
|
||||
}
|
||||
throw new InvalidQueryException(messages -> messages.addErrorsInvalidQueryCannotProcess(UserMessages.GLOBAL_PROPERTY_KEY),
|
||||
"Failed query: " + searchRequestBuilder, e);
|
||||
}
|
||||
}
|
||||
final long execTime = System.currentTimeMillis() - startTime;
|
||||
|
|
|
@ -380,6 +380,9 @@ public class FessMessages extends FessLabels {
|
|||
/** The key of the message: The given sort order ({0}) is not supported. */
|
||||
public static final String ERRORS_invalid_query_unsupported_sort_order = "{errors.invalid_query_unsupported_sort_order}";
|
||||
|
||||
/** The key of the message: The given query could not be processed. */
|
||||
public static final String ERRORS_invalid_query_cannot_process = "{errors.invalid_query_cannot_process}";
|
||||
|
||||
/** The key of the message: Invalid mode(expected value is {0}, but it's {1}). */
|
||||
public static final String ERRORS_crud_invalid_mode = "{errors.crud_invalid_mode}";
|
||||
|
||||
|
@ -2245,6 +2248,20 @@ public class FessMessages extends FessLabels {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.invalid_query_cannot_process' with parameters.
|
||||
* <pre>
|
||||
* message: The given query could not be processed.
|
||||
* </pre>
|
||||
* @param property The property name for the message. (NotNull)
|
||||
* @return this. (NotNull)
|
||||
*/
|
||||
public FessMessages addErrorsInvalidQueryCannotProcess(String property) {
|
||||
assertPropertyNotNull(property);
|
||||
add(property, new UserMessage(ERRORS_invalid_query_cannot_process));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the created action message for the key 'errors.crud_invalid_mode' with parameters.
|
||||
* <pre>
|
||||
|
|
|
@ -149,6 +149,7 @@ errors.invalid_query_parse_error=The given query is invalid.
|
|||
errors.invalid_query_sort_value=The given sort ({0}) is invalid.
|
||||
errors.invalid_query_unsupported_sort_field=The given sort ({0}) is not supported.
|
||||
errors.invalid_query_unsupported_sort_order=The given sort order ({0}) is not supported.
|
||||
errors.invalid_query_cannot_process=The given query could not be processed.
|
||||
|
||||
errors.crud_invalid_mode=Invalid mode(expected value is {0}, but it's {1}).
|
||||
errors.crud_failed_to_create_instance=Failed to create a new data.
|
||||
|
|
|
@ -145,6 +145,7 @@ errors.invalid_query_parse_error=The given query is invalid.
|
|||
errors.invalid_query_sort_value=The given sort ({0}) is invalid.
|
||||
errors.invalid_query_unsupported_sort_field=The given sort ({0}) is not supported.
|
||||
errors.invalid_query_unsupported_sort_order=The given sort order ({0}) is not supported.
|
||||
errors.invalid_query_cannot_process=The given query could not be processed.
|
||||
|
||||
errors.crud_invalid_mode=Invalid mode(expected value is {0}, but it's {1}).
|
||||
errors.crud_failed_to_create_instance=Failed to create a new data.
|
||||
|
|
|
@ -124,6 +124,7 @@ errors.invalid_query_parse_error = 与えられたクエリーは無効です。
|
|||
errors.invalid_query_sort_value = 指定されたソート {0} が無効です。
|
||||
errors.invalid_query_unsupported_sort_field = 指定されたソート {0} はサポートされていません。
|
||||
errors.invalid_query_unsupported_sort_order = 指定されたソート順 {0} はサポートされていません。
|
||||
errors.invalid_query_cannot_process=指定されたクエリーを処理できませんでした。
|
||||
errors.crud_invalid_mode = モードが正しくありません。({0} でなく、{1} です)
|
||||
errors.crud_failed_to_create_instance = 新しいデータの作成に失敗しました。
|
||||
errors.crud_failed_to_create_crud_table = 新しいデータの作成に失敗しました。({0})
|
||||
|
|
Loading…
Add table
Reference in a new issue