def resolve_full_claim_search(self, info, **args): searchResultsFuture = PointModel.search(user=info.context.current_user, searchTerms="\"" + (args['q'] or "") + "\"") searchResults = searchResultsFuture.get_result( ) if searchResultsFuture else [] return PagedPoints(points=searchResults, hasMore=False)
def post(self): resultJSON = json.dumps({'result': False}) searchResultsFuture = Point.search( searchTerms=self.request.get('searchTerms'), user=self.current_user, excludeURL=self.request.get('exclude'), linkType=self.request.get('linkType')) searchResults = None if searchResultsFuture: searchResults = searchResultsFuture.get_result() template_values = { 'points': searchResults, 'linkType': self.request.get('linkType'), } resultsHTML = self.template_render('pointBoxList.html', template_values) if searchResults: resultJSON = json.dumps({ 'result': True, 'resultsHTML': resultsHTML, 'searchString': self.request.get('searchTerms') }) self.response.headers[ "Content-Type"] = 'application/json; charset=utf-8' self.response.out.write(resultJSON)
def resolve_search(self, info, **args): searchResultsFuture = PointModel.search(user=info.context.current_user, searchTerms="\"" + (args['query'] or "") + "\"") searchResults = searchResultsFuture.get_result( ) if searchResultsFuture else [] return searchResults
def post(self): resultJSON = json.dumps({'result': False}) searchResultsFuture = Point.search( searchTerms=self.request.get('searchTerms'), user=self.current_user, excludeURL=self.request.get('exclude'), linkType=self.request.get('linkType') ) searchResults = None if searchResultsFuture: searchResults = searchResultsFuture.get_result() template_values = { 'points': searchResults, 'linkType': self.request.get('linkType'), } resultsHTML = self.template_render('pointBoxList.html', template_values) if searchResults: resultJSON = json.dumps({ 'result': True, 'resultsHTML': resultsHTML, 'searchString': self.request.get('searchTerms') }) self.response.headers["Content-Type"] = 'application/json; charset=utf-8' self.response.out.write(resultJSON)
def post(self): searchString = self.request.get('searchTerms') searchResults = Point.search(searchString, nodeType=None) result = len(searchResults) if searchResults else 0 template_values = { 'searchResults': searchResults, 'searchString': searchString, } path = os.path.join(constants.ROOT, 'templates/searchResults.html') self.response.headers.add_header('content-type', 'application/json', charset='utf-8') html = template.render(path, template_values) json_values = {'html':html, 'searchString': searchString, 'result':result } self.response.out.write(json.dumps(json_values))
def post(self): resultJSON = json.dumps({'result': False}) searchResults = Point.search(searchTerms=self.request.get('searchTerms'), excludeURL=self.request.get('exclude'), linkType=self.request.get('linkType'), nodeType=self.request.get('nodetype')) template_values = { 'points': searchResults, 'linkType': self.request.get('linkType'), 'thresholds': constants.SCORETHRESHOLDS } path = os.path.join(constants.ROOT, 'templates/pointBoxList.html') resultsHTML = template.render(path, template_values) if searchResults: resultJSON = json.dumps({ 'result': True, 'resultsHTML': resultsHTML, 'searchString': self.request.get('searchTerms') }) self.response.headers.add_header('content-type', 'application/json', charset='utf-8') self.response.out.write(resultJSON)
def post(self): searchString = self.request.get('searchTerms') searchResultsFuture = Point.search(user=self.current_user, searchTerms=searchString) searchResults = None if searchResultsFuture: searchResults = searchResultsFuture.get_result() result = len(searchResults) if searchResults else 0 template_values = { 'searchResults': searchResults, 'searchString': searchString, } self.response.headers[ "Content-Type"] = 'application/json; charset=utf-8' html = self.template_render('searchResults.html', template_values) json_values = { 'html': html, 'searchString': searchString, 'result': result } self.response.out.write(json.dumps(json_values))
def post(self): searchString = self.request.get('searchTerms') searchResultsFuture = Point.search( user=self.current_user, searchTerms=searchString ) searchResults = None if searchResultsFuture: searchResults = searchResultsFuture.get_result() result = len(searchResults) if searchResults else 0 template_values = { 'searchResults': searchResults, 'searchString': searchString, } self.response.headers["Content-Type"] = 'application/json; charset=utf-8' html = self.template_render('searchResults.html', template_values) json_values = {'html':html, 'searchString': searchString, 'result':result } self.response.out.write(json.dumps(json_values))