You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When query enhancements is enabled, switching from Discover to Dashboard would set query language back to DQL, and switching back to Discover would reset the selected index pattern to the default one. This becomes problematic when there are no index patterns in the current workspace. It would show the previously selected dataset with an empty "SQL" query bar, but it is actually sending DSL requests to /internal/search/opensearch-with-long-numerals
To Reproduce
Steps to reproduce the behavior:
Create a new workspace with a opensearch connection. Ensure there are no index patterns in this workspace
Click on discover and select an index from the opensearch connection with SQL language
Run some query like SELECT request,response FROM apachelog where response = '501' limit 2
Click on Dashboards and click back to Discover
See index is still selected, language says "OpenSearch SQL", and query bar is empty
Now try to run the same SQL query, discover shows different results
In network tab, it calls POST /w/czLj6e/internal/search/opensearch-with-long-numerals instead of /w/czLj6e/api/enhancements/search/sql
Expected behavior
UI appearance and underlying state should be consistent
OpenSearch Version
main
Dashboards Version
main
Plugins
none
Screenshots
Notice SQL query is inside DSL
Host/Environment (please complete the following information):
When there's no index pattern, on switching from Dashboard to Discover, it resets the query to default by passing query with dataset being undefined. The current logic will keep the original dataset in this case, but language still got reset to DQL. Now we have a index type dataset with incompatible language.
I've tried small effort fixes like
if(!query.dataset){newQuery.dataset=undefined;}
and the index is no longer selected, but clicking on "Run" still sends DSL queries to the apachelog index. Apparently there are more places causing issues and need to be fixed
The text was updated successfully, but these errors were encountered:
Describe the bug
When query enhancements is enabled, switching from Discover to Dashboard would set query language back to DQL, and switching back to Discover would reset the selected index pattern to the default one. This becomes problematic when there are no index patterns in the current workspace. It would show the previously selected dataset with an empty "SQL" query bar, but it is actually sending DSL requests to
/internal/search/opensearch-with-long-numerals
To Reproduce
Steps to reproduce the behavior:
SELECT request,response FROM apachelog where response = '501' limit 2
POST /w/czLj6e/internal/search/opensearch-with-long-numerals
instead of/w/czLj6e/api/enhancements/search/sql
Expected behavior
UI appearance and underlying state should be consistent
OpenSearch Version
main
Dashboards Version
main
Plugins
none
Screenshots
Notice SQL query is inside DSL
Host/Environment (please complete the following information):
Additional context
One root cause is in
setQuery
,OpenSearch-Dashboards/src/plugins/data/public/query/query_string/query_string_manager.ts
Lines 168 to 171 in 0be70a7
When there's no index pattern, on switching from Dashboard to Discover, it resets the query to default by passing
query
withdataset
beingundefined
. The current logic will keep the original dataset in this case, but language still got reset to DQL. Now we have aindex
type dataset with incompatible language.I've tried small effort fixes like
and the index is no longer selected, but clicking on "Run" still sends DSL queries to the
apachelog
index. Apparently there are more places causing issues and need to be fixedThe text was updated successfully, but these errors were encountered: