From 496501f11232e7735575291cd85ecb6013f1d559 Mon Sep 17 00:00:00 2001 From: tmartins Date: Thu, 20 Aug 2020 11:01:35 +0200 Subject: include feed section --- .../vespa/notebooks/create-and-deploy-vespa.ipynb | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'python') diff --git a/python/vespa/notebooks/create-and-deploy-vespa.ipynb b/python/vespa/notebooks/create-and-deploy-vespa.ipynb index 1bb61e91b48..2223765c314 100644 --- a/python/vespa/notebooks/create-and-deploy-vespa.ipynb +++ b/python/vespa/notebooks/create-and-deploy-vespa.ipynb @@ -97,6 +97,37 @@ "app" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Feed data to the app " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To feed data we need to specify the `schema` that we are sending data to. Each data point needs to have a unique `data_id` associated with it, independent of having an id field or not. The `fields` should be a dict containing all the fields in the schema. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "app.feed_data_point(\n", + " schema = \"msmarco\", \n", + " data_id = 1, \n", + " fields = {\n", + " \"id\": \"1\", \n", + " \"title\": \"This is a text\", \n", + " \"body\": \"This is the body of the text\"\n", + " }\n", + ")" + ] + }, { "cell_type": "markdown", "metadata": {}, -- cgit v1.2.3