mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
This commit is contained in:
parent
0a3d209b13
commit
b533ab9298
2 changed files with 8 additions and 4 deletions
|
@ -239,6 +239,8 @@ export class DocumentSearchClient extends AbstractSearchClient {
|
|||
? DocumentSearchIndexWithScope(req.repoScope)
|
||||
: `${DocumentIndexNamePrefix}*`;
|
||||
|
||||
const queryStr = req.query.toLowerCase();
|
||||
|
||||
const rawRes = await this.client.search({
|
||||
index,
|
||||
body: {
|
||||
|
@ -250,7 +252,7 @@ export class DocumentSearchClient extends AbstractSearchClient {
|
|||
{
|
||||
prefix: {
|
||||
'path.hierarchy': {
|
||||
value: req.query,
|
||||
value: queryStr,
|
||||
boost: 1.0,
|
||||
},
|
||||
},
|
||||
|
@ -258,7 +260,7 @@ export class DocumentSearchClient extends AbstractSearchClient {
|
|||
{
|
||||
term: {
|
||||
'path.hierarchy': {
|
||||
value: req.query,
|
||||
value: queryStr,
|
||||
boost: 10.0,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -28,6 +28,8 @@ export class RepositorySearchClient extends AbstractSearchClient {
|
|||
? RepositorySearchIndexWithScope(req.repoScope)
|
||||
: `${RepositoryIndexNamePrefix}*`;
|
||||
|
||||
const queryStr = req.query.toLowerCase();
|
||||
|
||||
const rawRes = await this.client.search({
|
||||
index,
|
||||
body: {
|
||||
|
@ -38,7 +40,7 @@ export class RepositorySearchClient extends AbstractSearchClient {
|
|||
should: [
|
||||
{
|
||||
simple_query_string: {
|
||||
query: req.query,
|
||||
query: queryStr,
|
||||
fields: [
|
||||
`${RepositoryReservedField}.name^1.0`,
|
||||
`${RepositoryReservedField}.org^1.0`,
|
||||
|
@ -53,7 +55,7 @@ export class RepositorySearchClient extends AbstractSearchClient {
|
|||
{
|
||||
prefix: {
|
||||
[`${RepositoryReservedField}.name`]: {
|
||||
value: req.query,
|
||||
value: queryStr,
|
||||
boost: 100.0,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue