import six
from datetime import datetime, date
from collections import Mapping, Iterable

from jsonmapping.transforms import transliterate

IGNORE_FIELDS = ['$schema', '$sources', '$latin', '$text', '$attrcount',
                 '$linkcount', 'id']


def latinize(text):
    """ Transliterate text to latin. """
    if text is None or not len(text):
        return text
    return transliterate(text).lower()


def extract_text(data, sep=' : '):
    """ Get all the instances of text from a given object, recursively. """
    if isinstance(data, Mapping):
        values = []
        for k, v in data.items():
            if k in IGNORE_FIELDS:
                continue
            values.append(v)
        data = values
    if isinstance(data, (date, datetime)):
        data = data.isoformat()
    elif isinstance(data, (int, float)):
        data = six.text_type(data)
    if isinstance(data, six.string_types):
        return data
    if isinstance(data, Iterable):
        text = [extract_text(d, sep=sep) for d in data]
        return sep.join([t for t in text if t is not None])

@@ -430,19 +430,8 @@
 data
-, sep=' : '
 ):%0A 
@@ -913,20 +913,22 @@
  return 
+%5B
 data
+%5D
 %0A    if 
@@ -967,40 +967,27 @@
     
-text = %5Bextract_text(d, sep=sep)
+values = %5B%5D%0A       
  for
@@ -996,26 +996,27 @@
  in data
-%5D%0A
+:%0A 
         
 return s
@@ -1011,56 +1011,60 @@
     
-return sep.join(%5Bt for t in text if t is not None%5D)
+   values.extend(extract_text(d))%0A        return values
 %0A

Make text a list in the index.