aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authortmartins <thigm85@gmail.com>2020-08-20 13:02:26 +0200
committertmartins <thigm85@gmail.com>2020-08-20 13:02:26 +0200
commit31f6a239d000bb12470299a5bced329185b9abc6 (patch)
tree236fc6ba0b23b08e6d5b3ec4be2aa8a88ac5aa8f /python
parente39dbe58deb9886ec43da7c77482408cb0251b01 (diff)
add simple query section
Diffstat (limited to 'python')
-rw-r--r--python/vespa/notebooks/create-and-deploy-vespa.ipynb44
1 files changed, 44 insertions, 0 deletions
diff --git a/python/vespa/notebooks/create-and-deploy-vespa.ipynb b/python/vespa/notebooks/create-and-deploy-vespa.ipynb
index e899696794f..334b39e21ee 100644
--- a/python/vespa/notebooks/create-and-deploy-vespa.ipynb
+++ b/python/vespa/notebooks/create-and-deploy-vespa.ipynb
@@ -134,6 +134,15 @@
"metadata": {},
"outputs": [],
"source": [
+ "response.status_code"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
"response.json()"
]
},
@@ -141,6 +150,41 @@
"cell_type": "markdown",
"metadata": {},
"source": [
+ "## Make a simple query"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from vespa.query import Query, OR, RankProfile\n",
+ "\n",
+ "results = app.query(\n",
+ " query=\"Where is my text?\", \n",
+ " query_model = Query(\n",
+ " match_phase=OR(), \n",
+ " rank_profile=RankProfile(name=\"default\")\n",
+ " )\n",
+ ")\n",
+ "\n",
+ "results.number_documents_retrieved"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "results.hits"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
"## Change the application package and redeploy"
]
},