-
Notifications
You must be signed in to change notification settings - Fork 973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discover-next] add query enhancements plugin as a core plugin #7212
Merged
Merged
Changes from 73 commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
40d6ed1
init
kavilla b7063c5
fixing bugs and removing target
sejli a34f895
Updating plugin.ts and removing target directory
kavilla c767590
add target and build to .gitignore
sejli 50ce9c6
Add target and build to .gitignore
kavilla 0783ea3
Remove SQL Async and Query Assist
kavilla c0304d1
adding fix for PPL queries
sejli c617aa5
Merge pull request #3 from sejli/ppl-fix
kavilla 67e6b30
Clean up files and add helper functions
kavilla e11a384
final touches
kavilla 8867564
Clean up files and use helper functions
kavilla b6d54a5
[Discover-next] add query assist to query enhancements plugin (#6895)
joshuali925 b0053b9
[Discover-next] Address comments for search bar extensions and query …
joshuali925 eb0e6f3
[Discover-next] Support data sources for query assist (#6972)
joshuali925 56ab13b
add query assist banner
joshuali925 43d1d43
implement banner rendering logic
joshuali925 c97cd2d
pick opensearch-project/dashboards-observability/pull/1896
joshuali925 48f9c7a
Conditionally render the data source select config
kavilla ec37345
restore no space
kavilla 780fbd5
add basic tests
joshuali925 9b811a5
add index selector
joshuali925 c636dee
Conditionally render the data source select config
kavilla 8572c23
MDS working with PPL and SQL
kavilla fd651e7
rename logo to mark
joshuali925 8ad8600
extract supported languages to config
joshuali925 90ab0bf
Add query assist to query enhancements plugin
kavilla 97b57ba
Merge branch 'main' into kavilla/mds_working
kavilla 3d2e294
MDS working + more cleanups
kavilla 2e3304e
Add missing license headers
kavilla 6192877
Adds license headers
kavilla 0b3cb2a
initial implementation for async queries
sejli 5a7cb21
remove queryId and sessionId from facet
sejli 36f6218
fix: Update call out tests with intl wrapper
Swiddis 0c84b4c
maintenance: Add and apply lint command
Swiddis 35102fc
changing to observables
sejli 25526d2
search interceptor and cleanup
sejli 49cfd34
moving polling class into plugin
sejli f16fb12
maintenance: Add and apply lint command
kavilla 9daa636
SQL Async queries
kavilla 045af8e
Some minor clean ups plus lint
kavilla d0541ff
Merge pull request #23 from kavilla/asynccleanup
kavilla 2ac79c5
test: Add mock-heavy tests for sql search strategy
Swiddis 51cb500
test: add GH workflows
Swiddis 27bf623
More clean ups
kavilla 5b401be
Add some props interfaces and consolidated some of the facets
kavilla ca89c60
test: add GH workflows
kavilla 4f52c32
fix: Update call out tests with intl wrapper
kavilla 9e4c83c
Merge remote-tracking branch 'kavilla/main' into test/sql_search_stra…
Swiddis f3320a5
chore: apply auto-lints to plugin
Swiddis bea27f8
Not done
kavilla cfc4741
working
kavilla 6d0730f
working and styled
kavilla 388ea43
add connection service
kavilla 48d9c00
Update public/types.ts
kavilla e73982b
Update public/plugin.tsx
kavilla 6ee5508
Update public/plugin.tsx
kavilla 8bb83a1
fix linter
kavilla e5f626b
[MDS] datasource selector added
kavilla 3543d51
add more tests for query assist (#31)
joshuali925 222b928
fix!: remove dataSource key in get connection response
joshuali925 9f43eba
change isEnabled to an observable based on selected connection
joshuali925 a43fcdc
protect duplicated calls
joshuali925 9306f14
test: Add mock-heavy tests for sql search strategy
kavilla 468b74b
(Query assist) change isEnabled to an observable based on selected co…
kavilla 9abc883
[build] import via start services
kavilla e2a1636
Add 'src/plugins/query_enhancements/' from commit '9abc883f56e1d032fd…
kavilla fdab7a2
Changeset file for PR #7212 created/updated
opensearch-changeset-bot[bot] dbf05b5
foobar
kavilla b398640
Merge branch 'query_enhancements' of github.com:kavilla/OpenSearch-Da…
kavilla f879c1b
updating imports still in progress
kavilla ece47d0
Update more imports
kavilla f58c4ba
fix setting of state
kavilla 20411f1
fixes bugs
kavilla 8a94a4b
Update test
kavilla 6a1bfec
Merge remote-tracking branch 'upstream/main' into query_enhancements
kavilla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Add query enhancements plugin as a core plugin ([#7212](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7212)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"prefix": "queryEnhancements", | ||
"paths": { | ||
"queryEnhancements": "." | ||
}, | ||
"translations": ["translations/ja-JP.json"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Query Enhancements Plugin | ||
|
||
Optional plugin, that registers query enhancing capabilities within | ||
the application. | ||
|
||
## List of enhancements | ||
|
||
* PPL within Discover | ||
* SQL within Discover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { schema, TypeOf } from '@osd/config-schema'; | ||
|
||
export const configSchema = schema.object({ | ||
enabled: schema.boolean({ defaultValue: true }), | ||
queryAssist: schema.object({ | ||
supportedLanguages: schema.arrayOf( | ||
schema.object({ | ||
language: schema.string(), | ||
agentConfig: schema.string(), | ||
}), | ||
{ | ||
defaultValue: [{ language: 'PPL', agentConfig: 'os_query_assist_ppl' }], | ||
} | ||
), | ||
}), | ||
}); | ||
|
||
export type ConfigSchema = TypeOf<typeof configSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export const PLUGIN_ID = 'queryEnhancements'; | ||
export const PLUGIN_NAME = 'queryEnhancements'; | ||
|
||
export const BASE_API = '/api/enhancements'; | ||
|
||
export const SEARCH_STRATEGY = { | ||
PPL: 'ppl', | ||
SQL: 'sql', | ||
SQL_ASYNC: 'sqlasync', | ||
}; | ||
|
||
export const API = { | ||
SEARCH: `${BASE_API}/search`, | ||
PPL_SEARCH: `${BASE_API}/search/${SEARCH_STRATEGY.PPL}`, | ||
SQL_SEARCH: `${BASE_API}/search/${SEARCH_STRATEGY.SQL}`, | ||
SQL_ASYNC_SEARCH: `${BASE_API}/search/${SEARCH_STRATEGY.SQL_ASYNC}`, | ||
QUERY_ASSIST: { | ||
LANGUAGES: `${BASE_API}/assist/languages`, | ||
GENERATE: `${BASE_API}/assist/generate`, | ||
}, | ||
DATA_SOURCE: { | ||
CONNECTIONS: `${BASE_API}/datasource/connections`, | ||
}, | ||
}; | ||
|
||
export const URI = { | ||
PPL: '/_plugins/_ppl', | ||
SQL: '/_plugins/_sql', | ||
ASYNC_QUERY: '/_plugins/_async_query', | ||
ML: '/_plugins/_ml', | ||
OBSERVABILITY: '/_plugins/_observability', | ||
DATA_CONNECTIONS: '/_plugins/_query/_datasources', | ||
}; | ||
|
||
export const OPENSEARCH_API = { | ||
PANELS: `${URI.OBSERVABILITY}/object`, | ||
DATA_CONNECTIONS: URI.DATA_CONNECTIONS, | ||
}; | ||
|
||
export const UI_SETTINGS = {}; | ||
|
||
export const ERROR_DETAILS = { GUARDRAILS_TRIGGERED: 'guardrails triggered' }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from './constants'; | ||
export * from './types'; | ||
export * from './utils'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { QueryAssistParameters, QueryAssistResponse } from './types'; |
19 changes: 19 additions & 0 deletions
19
src/plugins/query_enhancements/common/query_assist/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { TimeRange } from 'src/plugins/data/common'; | ||
|
||
export interface QueryAssistResponse { | ||
query: string; | ||
timeRange?: TimeRange; | ||
} | ||
|
||
export interface QueryAssistParameters { | ||
question: string; | ||
index: string; | ||
language: string; | ||
// for MDS | ||
dataSourceId?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { CoreSetup } from 'opensearch-dashboards/public'; | ||
import { Observable } from 'rxjs'; | ||
|
||
export interface FetchDataFrameContext { | ||
http: CoreSetup['http']; | ||
path: string; | ||
signal?: AbortSignal; | ||
} | ||
|
||
export type FetchFunction<T, P = void> = (params?: P) => Observable<T>; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Readme could use more data.