def _Dynamic_Match(self, request, response):
    self._ExpireSubscriptions()
    doc = {}
    properties = itertools.chain(request.document().property_list(),
                                 request.document().raw_property_list())
    for prop in properties:

      prop_name = unicode(prop.name(), 'utf-8')
      doc.setdefault(prop_name, [])
      if prop.value().has_int64value():
        value = prop.value().int64value()

        if (value < 2**32) and (value >= -2**32):
          doc[prop_name].append(prop.value().int64value())
      elif prop.value().has_stringvalue():

        unicode_value = unicode(prop.value().stringvalue(), 'utf-8')
        doc[prop_name].append(unicode_value)
      elif prop.value().has_doublevalue():
        doc[prop_name].append(prop.value().doublevalue())
      elif prop.value().has_booleanvalue():
        doc[prop_name].append(prop.value().booleanvalue())

    matches = []
    topic_subs = self.topics.get(request.topic(), {})
    sub_ids = topic_subs.keys()
    for sub_id in sub_ids:
      vanilla_query, _ = topic_subs[sub_id]
      if self._FindMatches(vanilla_query, doc):
        matches.append(sub_id)
    if matches:
      self._DeliverMatches(matches, request)
Match a document.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/prospective_search/prospective_search_stub.py/ProspectiveSearchStub._Dynamic_Match