def create_query_index(
            self,
            design_document_id=None,
            index_name=None,
            index_type='json',
            partitioned=False,
            **kwargs
    ):
        if index_type == JSON_INDEX_TYPE:
            index = Index(self, design_document_id, index_name,
                          partitioned=partitioned, **kwargs)
        elif index_type == TEXT_INDEX_TYPE:
            index = TextIndex(self, design_document_id, index_name,
                              partitioned=partitioned, **kwargs)
        else:
            raise CloudantArgumentError(103, index_type)
        index.create()
        return index