Пример #1
0
    def get_indexed_nodes(self, index, key, value):
        """ Fetch all nodes indexed under a given key-value pair.

        :param index: index name or instance
        :param key: key under which nodes are indexed
        :param value: value under which nodes are indexed
        :return: :class:`.Job`
        """
        index = self._index(Node, index)
        uri = index._searcher_stem_for_key(key) + percent_encode(value)
        return self.append_get(uri)
Пример #2
0
    def get_indexed_nodes(self, index, key, value):
        """ Fetch all nodes indexed under a given key-value pair.

        :param index: index name or instance
        :param key: key under which nodes are indexed
        :param value: value under which nodes are indexed
        :return: :class:`.Job`
        """
        index = self._index(Node, index)
        uri = index._searcher_stem_for_key(key) + percent_encode(value)
        return self.append_get(uri)
Пример #3
0
    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)
Пример #4
0
    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)
Пример #5
0
 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]
Пример #6
0
 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]