def get_indexed_nodes(self, index, key, value): """ Fetch all nodes indexed under a given key-value pair. :param index: index name or instance :type index: :py:class:`str` or :py:class:`Index` :param key: key under which nodes are indexed :type key: :py:class:`str` :param value: value under which nodes are indexed :return: batch request object """ index = self._index(Node, index) uri = index._searcher_stem_for_key(key) + percent_encode(value) return self.append_get(uri)
def _searcher_stem_for_key(self, key): if key not in self.__searcher_stem_cache: stem = self._searcher.uri_template.string.partition("{key}")[0] self.__searcher_stem_cache[key] = stem + percent_encode(key) + "/" return self.__searcher_stem_cache[key]