def get_single_text(field, text, **kwargs):
 for t in field.process_text(text, mode='query', **kwargs):
  return t

def get_single_text ( field , text , ** kwargs ) : for t in field . process_text ( text , mode = 'query' , ** kwargs ) : return t
returns the first token from an analyzers output .