def _Count(self, node): if node.getType() != ExpressionParser.NAME: raise _ExpressionError( 'The argument to count() must be a simple field name') return search_util.GetFieldCountInDocument( self._doc_pb, query_parser.GetQueryNodeText(node))
def _Count(self, node): if node.getType() != ExpressionParser.NAME: raise _ExpressionError( 'The argument to count() must be a simple field name') if self._is_sort_expression: raise query_parser.QueryException( 'Failed to parse sort expression \'count(' + node.getText() + ')\': count() is not supported in sort expressions') return search_util.GetFieldCountInDocument( self._doc_pb, query_parser.GetQueryNodeText(node))
def _Count(self, node): return search_util.GetFieldCountInDocument( self._doc_pb, query_parser.GetQueryNodeText(node))