@@ -1017,7 +1017,7 @@ def search_code(self, query, sort=None, order=None, per_page=None,
10171017 options: ``asc``, ``desc``; default: ``desc``
10181018 :param int per_page: (optional)
10191019 :param bool text_match: (optional), if True, return matching search
1020- terms. See http://git.io/4ct1eQ for more information
1020+ terms. See http://git.io/iRmJxg for more information
10211021 :param int number: (optional), number of repositories to return.
10221022 Default: -1, returns all available repositories
10231023 :param str etag: (optional), previous ETag header value
@@ -1042,6 +1042,70 @@ def search_code(self, query, sort=None, order=None, per_page=None,
10421042 return SearchIterator (number , url , CodeSearchResult , self , params ,
10431043 etag , headers )
10441044
1045+ def search_issues (self , query , sort = None , order = None , per_page = None ,
1046+ text_match = False , number = - 1 , etag = None ):
1047+ """Find issues by state and keyword
1048+
1049+ The query can contain any combination of the following supported
1050+ qualifers:
1051+
1052+ - ``in`` Qualifies which fields are searched. With this qualifier you
1053+ can restrict the search to just the repository name, description,
1054+ readme, or any combination of these.
1055+ - ``type`` With this qualifier you can restrict the search to issues or
1056+ pull request only.
1057+ - ``author`` Finds issues created by a certain user.
1058+ - ``assignee`` Finds issues that are assigned to a certain user.
1059+ - ``mentions`` Finds issues that mention a certain user.
1060+ - ``commenter`` Finds issues that a certain user commented on.
1061+ - ``involves`` Finds issues that were either created by a certain user,
1062+ assigned to that user, mention that user, or were commented on by
1063+ that user.
1064+ - ``created`` or ``updated`` Filters issues based on times of
1065+ creation, or when they were last updated. Format: ``YYYY-MM-DD``.
1066+ Examples: ``created:<2011``, ``pushed:<2013-02``,
1067+ ``pushed:>=2013-03-06``
1068+ - ``user`` or ``repo`` Limits searches to a specific user or repository
1069+ - ``language`` Searches for issues within repositories that match a
1070+ certain language.
1071+ - ``comments`` Filters issues based on the quantity of comments.
1072+ - ``labels`` Filters issues based on their labels.
1073+
1074+ For more information about these qualifiers, see: http://git.io/d1oELA
1075+
1076+ :param str query: (required), a valid query as described above, e.g.,
1077+ ``windows label:bug``
1078+ :param str sort: (optional), how the results should be sorted;
1079+ options: ``created``, ``comments``, ``updated``;
1080+ default: best match
1081+ :param str order: (optional), the direction of the sorted results,
1082+ options: ``asc``, ``desc``; default: ``desc``
1083+ :param int per_page: (optional)
1084+ :param bool text_match: (optional), if True, return matching search
1085+ terms. See http://git.io/QLQuSQ for more information
1086+ :param int number: (optional), number of issues to return.
1087+ Default: -1, returns all available issues
1088+ :param str etag: (optional), previous ETag header value
1089+ :return: generator of :class:`Issue <github3.issues.Issue>`
1090+ """
1091+ params = {'q' : query }
1092+ headers = {}
1093+
1094+ if sort in ('comments' , 'created' , 'updated' ):
1095+ params ['sort' ] = sort
1096+
1097+ if order in ('asc' , 'desc' ):
1098+ params ['order' ] = order
1099+
1100+ if text_match :
1101+ headers = {
1102+ 'Accept' : 'application/vnd.github.v3.full.text-match+json'
1103+ }
1104+
1105+ url = self ._build_url ('search' , 'issues' )
1106+ return SearchIterator (number , url , Issue , self , params , etag ,
1107+ headers )
1108+
10451109 def search_repositories (self , query , sort = None , order = None ,
10461110 per_page = None , text_match = False , number = - 1 ,
10471111 etag = None ):
0 commit comments