Skip to content
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

[Code] boost exact match for symbol qname #30913

Merged
merged 1 commit into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion x-pack/plugins/code/server/routes/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ export function repositoryRoute(
try {
indexStatus = await repoObjectClient.getRepositoryLspIndexStatus(repoUri);
} catch (error) {
log.error(`Get repository index status ${repoUri} error: ${error}`);
// index status won't exist if during clone, so suppress the error log to debug level.
log.debug(`Get repository index status ${repoUri} error: ${error}`);
}

let deleteStatus = null;
Expand Down
10 changes: 10 additions & 0 deletions x-pack/plugins/code/server/search/symbol_search_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ export class SymbolSearchClient extends AbstractSearchClient {
},
},
},
// Boost the exact match for qname.
{
term: {
qname: {
value: req.query,
boost: 10.0,
},
},
},
{
prefix: {
'symbolInformation.name': {
Expand All @@ -67,6 +76,7 @@ export class SymbolSearchClient extends AbstractSearchClient {
},
},
},
// Boost the exact match for symbol name.
{
term: {
'symbolInformation.name': {
Expand Down