

def existing_terms(self, ixreader, termset=None, reverse=False, phrases=True):
    'Returns a set of all terms in this query tree that exist in the index\n        represented by the given ixreaderder.\n        \n        This method references the IndexReader to expand Prefix and Wildcard\n        queries, and only adds terms that actually exist in the index\n        (unless reverse=True).\n        \n        >>> ixreader = my_index.reader()\n        >>> q = And([Or([Term("content", u"render"), Term("content", u"rendering")]),\n                     Prefix("path", u"/a/")])\n        >>> q.existing_terms(ixreader, termset)\n        set([("content", u"render"), ("path", u"/a/b"), ("path", u"/a/c")])\n        \n        :param ixreader: A :class:`whoosh.reading.IndexReader` object.\n        :param reverse: If True, this method adds *missing* terms\n            rather than *existing* terms to the set.\n        :param phrases: Whether to add words found in Phrase queries.\n        :rtype: set\n        '
    if (termset is None):
        termset = set()
    self._existing_terms(ixreader, termset, reverse=reverse, phrases=phrases)
    return termset

dataset/ETHPy150Open dokipen/whoosh/src/whoosh/query.py Query.existing_terms/original