def test_zero_vectors_search(self):
        """This is to test an edge case where the query is a 0-vector, 1 shard, 0 replicas"""
        index_name = "zero_vectors_search_index"

        try:
            tensor_search.delete_index(config=self.config, index_name=index_name)
        except IndexNotFoundError:
            pass

        index_settings = {
            IndexSettingsField.index_defaults: {
                "treat_urls_and_pointers_as_images": True,
                "model": "random/small"
            },
            'number_of_shards': 1,
            'number_of_replicas': 0,
        }

        tensor_search.create_vector_index(config=self.config, index_name=index_name, index_settings=index_settings)

        add_docs_caller(
            config=self.config, index_name=index_name, docs=[
                {"abc": "Exact match hehehe", "other field": "baaadd"},
                {"abc": "random text", "other field": "Close match hehehe"},
            ], auto_refresh=True)

        query = {"A rider riding a horse": 0}

        mock_create_dummy_query = mock.MagicMock()
        mock_create_dummy_query.side_effect = _create_dummy_query_for_zero_vector_search

        mock_vector_text_search_verbose = mock.MagicMock()
        mock_vector_text_search_verbose.side_effect = _vector_text_search_query_verbose

        @mock.patch('marqo.tensor_search.tensor_search._create_dummy_query_for_zero_vector_search',
                    mock_create_dummy_query)
        @mock.patch('marqo.tensor_search.tensor_search._vector_text_search_query_verbose',
                    mock_vector_text_search_verbose)
        def run():
            for verbose in [0, 1, 2]:
                res = tensor_search.search(config=self.config, text=query, index_name=index_name, verbose=verbose)
                mock_create_dummy_query.assert_called_once()
                assert res["hits"] == []
                mock_create_dummy_query.reset_mock()
                if verbose == 0:
                    mock_vector_text_search_verbose.assert_not_called()
                elif verbose > 0:
                    args, kwargs = mock_vector_text_search_verbose.call_args
                    assert kwargs["verbose"] == verbose
                    assert kwargs["body"][0]["index"] == index_name
                    assert kwargs["body"][1] == {"query": {"match_none": {}}}
                mock_vector_text_search_verbose.reset_mock()
            return True

        assert run()
This is to test an edge case where the query is a 0-vector, 1 shard, 0 replicas
tests/integ_tests/tensor_search/test_search.py