@@ -17,9 +17,9 @@ import {
17
17
TimeRange ,
18
18
} from '@grafana/data' ;
19
19
import { BucketAggregation , DataLinkConfig , ElasticsearchQuery , TermsQuery , FieldCapabilitiesResponse } from '@/types' ;
20
- import {
21
- DataSourceWithBackend ,
22
- getTemplateSrv ,
20
+ import {
21
+ DataSourceWithBackend ,
22
+ getTemplateSrv ,
23
23
TemplateSrv } from '@grafana/runtime' ;
24
24
import { QuickwitOptions } from 'quickwit' ;
25
25
import { getDataQuery } from 'QueryBuilder/elastic' ;
@@ -36,7 +36,7 @@ import { getQueryResponseProcessor } from 'datasource/processResponse';
36
36
import { SECOND } from 'utils/time' ;
37
37
import { GConstructor } from 'utils/mixins' ;
38
38
import { LuceneQuery } from '@/utils/lucene' ;
39
- import { uidMaker } from "@/utils/uid"
39
+ import { uidMaker } from "@/utils/uid"
40
40
import { DefaultsConfigOverrides } from 'store/defaults/conf' ;
41
41
42
42
export type BaseQuickwitDataSourceConstructor = GConstructor < BaseQuickwitDataSource >
@@ -199,7 +199,7 @@ export class BaseQuickwitDataSource
199
199
. map ( field_capability => {
200
200
return {
201
201
text : field_capability . field_name ,
202
- value : fieldTypeMap [ field_capability . type ] ,
202
+ value : fieldTypeMap [ field_capability . type ] ,
203
203
}
204
204
} ) ;
205
205
const uniquefieldCapabilities = fieldCapabilities . filter ( ( field_capability , index , self ) =>
@@ -223,9 +223,10 @@ export class BaseQuickwitDataSource
223
223
/**
224
224
* Get tag values for adhoc filters
225
225
*/
226
- getTagValues ( options : any ) {
227
- const terms = this . getTerms ( { field : options . key } , options . timeRange )
228
- return lastValueFrom ( terms , { defaultValue :[ ] } ) ;
226
+ getTagValues ( options : { key : string , fieldValue : string , timeRange : TimeRange } ) {
227
+ const query = `${ options . key } :${ options . fieldValue } *`
228
+ const terms = this . getTerms ( { field : options . key , query } , options . timeRange )
229
+ return lastValueFrom ( terms , { defaultValue : [ ] } ) ;
229
230
}
230
231
231
232
/**
0 commit comments