diff options
author | tmartins <thigm85@gmail.com> | 2020-08-20 11:01:35 +0200 |
---|---|---|
committer | tmartins <thigm85@gmail.com> | 2020-08-20 11:01:35 +0200 |
commit | 496501f11232e7735575291cd85ecb6013f1d559 (patch) | |
tree | e709df0e2aa1fcdf026e3161dd17db10c4cea8f5 | |
parent | 9b8710ca2d04f53cae557229ed2cae32aece17ae (diff) |
include feed section
-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" ] }, |