diff options
-rw-r--r-- | python/vespa/notebooks/create-and-deploy-vespa.ipynb | 31 |
1 files changed, 31 insertions, 0 deletions
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 @@ -101,6 +101,37 @@ "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": {}, + "source": [ "## Change the application package and redeploy" ] }, |