Skip to content

[FEATURE] Improve error reporting for relevance search queries #838

@Yury-Fridlyand

Description

@Yury-Fridlyand

Is your feature request related to a problem?
In some cases, SQL engine returns very unclear error messages on error.

What solution would you like?
A clear and user-friendly error messages.

SELECT phrase, insert_time2 from phrase WHERE match_phrase(phrase, 'brown fox', slop = 0.5);
{'reason': 'Invalid SQL query', 'details': 'For input string: "0.5"', 'type': 'NumberFormatException'}
select `key` from calcs where multi_match([str1], 'DVD', zero_terms_query=meow);
{'reason': 'Invalid SQL query', 'details': 'No enum constant org.opensearch.index.search.MatchQuery.ZeroTermsQuery.MEOW', 'type': 'IllegalArgumentException'}
SELECT phrase, insert_time2 from phrase WHERE match(phrase, 'brown fox', slop = 0);
{'reason': 'Invalid SQL query', 'details': 'Parameter slop is invalid for match function', 'type': 'SemanticCheckException'}
SELECT phrase, insert_time2 from phrase WHERE match_phrase2(phrase, 'brown fox', slop = 0);
TransportError(503, 'Exception', {'error': {'reason': 'There was internal problem at backend', 'details': '[701f78b8-da61-4eb1-a00a-18f089f5644d] Request SQLQueryRequest(jsonContent={"query":"SELECT phrase, insert_time2 from phrase WHERE match_phrase2(phrase, \'brown fox\', slop = 0)"}, query=SELECT phrase, insert_time2 from phrase WHERE match_phrase2(phrase, \'brown fox\', slop = 0), path=/_plugins/_sql/, format=jdbc, params={format=jdbc}, sanitize=true) is not supported and falling back to old SQL engine', 'type': 'Exception'}, 'status': 503})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesterror-experienceIssues related to how we handle failure cases in the plugin.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions