Skip to content

Add support for Fts auto Complete and docs + tests#406

Open
prajwal-pai77 wants to merge 27 commits intoDA-392-Add-Search-Query-Validationfrom
DA-395-Add-Fts-Autocomplete
Open

Add support for Fts auto Complete and docs + tests#406
prajwal-pai77 wants to merge 27 commits intoDA-392-Add-Search-Query-Validationfrom
DA-395-Add-Fts-Autocomplete

Conversation

@prajwal-pai77
Copy link
Copy Markdown
Collaborator

  • Add support for FTS auto complete
  • Add support for Documentation hover
  • Add support for FTS auto complete templates
  • Updated and added unit tests

Comment thread package.json
"key": "ctrl+shift+e",
"mac": "cmd+shift+e",
"when": "(editorLangId == cbs.json || resourceFilename =~ /.cbs.json$/) && !isKVCluster"
"when": "editorLangId == json && resourceFilename =~ /\\.cbs\\.json$/ && !isKVCluster && isSearchEnabled"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QQ: Do we use query to search or just the SDK?
If we directly use SDK, then probably we don't require isKVCluster check

Comment thread CHANGELOG.md
Comment on lines +3 to 9
## [v2.1.0]
- Add FTS workbench support inside extension
- Add FTS workbench json validation
- Add FTS workbench json auto complete feature
- Add FTS workbench documentation

## [v2.0.0]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add other changelogs as well for versions 2.0.1->2.0.5

Comment thread package.json
"command": "vscode-couchbase.runSearch",
"category": "Couchbase",
"when": "(editorLangId == cbs.json || resourceFilename =~ /.cbs.json$/) && !isKVCluster",
"when": "editorLangId == json && resourceFilename =~ /\\.cbs\\.json$/ && !isKVCluster && isSearchEnabled",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "||" to "&&"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because I updated the languageId to be json it self and not cbs.json, due to which we need the conditional
"editorLangId == json && resourceFilename =~ /\.cbs\.json$/ to be true, otherwise it will trigger for all json files which is not what we want.

Comment thread src/commands/fts/SearchWorkbench/contributor/autoCompleteVisitor.ts Outdated
Comment thread src/commands/fts/SearchWorkbench/contributor/autoCompleteVisitor.ts Outdated
await workbenchWebviewProvider.sendQueryResult(JSON.stringify([{ "status": "Executing statement" }]), { queryStatus: QueryStatus.Running }, null);
const explainPlan = JSON.stringify("");
const couchbbaseRestAPI = new CouchbaseRestAPI(connection);
const searchIndexesManager = connection?.cluster?.searchIndexes();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no scope level indexes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better in this file, i feel because: queryContext?.indexName is of the format bucketName.scopeName.indexName and using scope level indexes returns just indexName. Also we will need to pass additional parameter scopeName and bucketName to this method which is unnecessary, as we can just check directly if the index is present in the cluster level or not.

@prajwal-pai77
Copy link
Copy Markdown
Collaborator Author

Formatted using prettier, Also updated changelog to include from v2.0.1->v2.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants