@@ -17,9 +17,9 @@ import {
1717 TimeRange ,
1818} from '@grafana/data' ;
1919import { BucketAggregation , DataLinkConfig , ElasticsearchQuery , TermsQuery , FieldCapabilitiesResponse } from '@/types' ;
20- import {
21- DataSourceWithBackend ,
22- getTemplateSrv ,
20+ import {
21+ DataSourceWithBackend ,
22+ getTemplateSrv ,
2323 TemplateSrv } from '@grafana/runtime' ;
2424import { QuickwitOptions } from 'quickwit' ;
2525import { getDataQuery } from 'QueryBuilder/elastic' ;
@@ -36,7 +36,7 @@ import { getQueryResponseProcessor } from 'datasource/processResponse';
3636import { SECOND } from 'utils/time' ;
3737import { GConstructor } from 'utils/mixins' ;
3838import { LuceneQuery } from '@/utils/lucene' ;
39- import { uidMaker } from "@/utils/uid"
39+ import { uidMaker } from "@/utils/uid"
4040import { DefaultsConfigOverrides } from 'store/defaults/conf' ;
4141
4242export type BaseQuickwitDataSourceConstructor = GConstructor < BaseQuickwitDataSource >
@@ -199,7 +199,7 @@ export class BaseQuickwitDataSource
199199 . map ( field_capability => {
200200 return {
201201 text : field_capability . field_name ,
202- value : fieldTypeMap [ field_capability . type ] ,
202+ value : fieldTypeMap [ field_capability . type ] ,
203203 }
204204 } ) ;
205205 const uniquefieldCapabilities = fieldCapabilities . filter ( ( field_capability , index , self ) =>
@@ -223,9 +223,10 @@ export class BaseQuickwitDataSource
223223 /**
224224 * Get tag values for adhoc filters
225225 */
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 : [ ] } ) ;
229230 }
230231
231232 /**
0 commit comments