import { ProcessorEvent } from '../../../common/processor_event' ; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions' ; import { Setup } from '../../lib/helpers/setup_request' ; export async function getSuggestions ( { field , searchAggregatedTransactions , setup , size , string , } ) { const { apmEventClient } = setup ; const response = await apmEventClient . termsEnum ( 'get_suggestions' , { apm : { events : [ getProcessorEventForTransactions ( searchAggregatedTransactions ) , ProcessorEvent . error , ProcessorEvent . metric , ] , } , body : { case_insensitive : true , field , size , string , } , } ) ; return { terms : response . terms } ; }