コード例 #1
0
ファイル: batch.py プロジェクト: EricEllett/py2neo
    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)
コード例 #2
0
ファイル: batch.py プロジェクト: adampassword/py2neo
    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)
コード例 #3
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]
コード例 #4
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]