diff --git a/examples/training-artifacts/101/ch1/actions.txt b/examples/training-artifacts/101/ch1/actions.txt new file mode 100644 index 000000000..f29abe08d --- /dev/null +++ b/examples/training-artifacts/101/ch1/actions.txt @@ -0,0 +1,44 @@ +actions to take at the start of training: + +- ensure you're able to login using a google + or github account on https://console.vespa-cloud.com/ + +- You do not need to create your own "tenant" + (the organization / billing entity in vespa cloud); + if you contact Radu he will give you access to the + "training1" tenant. + +- we'll assume you have installed standard developer tools: + * git + * curl +- also recommended: + * jq + +- ensure you have the "vespa" CLI tool installed: + https://github.com/vespa-engine/vespa/releases/tag/v8.447.14 + +vespa auth login +vespa auth show +vespa config set target cloud +# replace "myusername" with your user name +vespa config set application training1.myusername-test1 + +git clone https://github.com/vespa-engine/sample-apps.git +cd sample-apps/examples/training-artifacts/101/ch1 +# you are "here" +cd ecommerce +vespa auth cert +vespa deploy --wait 900 +cd .. +vespa document put f1f2-doc.json +vespa document get id:ecommerce:product::1 +vespa visit +vespa query "yql=select * from product where true" +vespa query "yql=select * from product where true" | jq ".root.children" +vespa document remove id:ecommerce:product::1 + +- if you want to see usage of the underlying REST api, try these: +vespa document -v put f1f2-doc.json +vespa document -v get id:ecommerce:product::1 +vespa query -v "yql=select field1 from product where true" +vespa document -v remove id:ecommerce:product::1 diff --git a/examples/training-artifacts/101/ch1/ecommerce/validation-overrides.xml b/examples/training-artifacts/101/ch1/ecommerce/validation-overrides.xml new file mode 100644 index 000000000..1de0d5319 --- /dev/null +++ b/examples/training-artifacts/101/ch1/ecommerce/validation-overrides.xml @@ -0,0 +1,4 @@ + + indexing-change + schema-removal + diff --git a/examples/training-artifacts/101/ch1/f1f2-doc.json b/examples/training-artifacts/101/ch1/f1f2-doc.json new file mode 100644 index 000000000..35c6546e2 --- /dev/null +++ b/examples/training-artifacts/101/ch1/f1f2-doc.json @@ -0,0 +1 @@ +{"id": "id:ecommerce:product::1", "fields": {"field1": "foo", "field2": "and bar"}} diff --git a/examples/training-artifacts/101/ch2/ecommerce/validation-overrides.xml b/examples/training-artifacts/101/ch2/ecommerce/validation-overrides.xml index 4d4cb9f23..1de0d5319 100644 --- a/examples/training-artifacts/101/ch2/ecommerce/validation-overrides.xml +++ b/examples/training-artifacts/101/ch2/ecommerce/validation-overrides.xml @@ -1,3 +1,4 @@ - - \ No newline at end of file + indexing-change + schema-removal + diff --git a/examples/training-artifacts/101/ch3/part-purchase/validation-overrides.xml b/examples/training-artifacts/101/ch3/part-purchase/validation-overrides.xml new file mode 100644 index 000000000..1de0d5319 --- /dev/null +++ b/examples/training-artifacts/101/ch3/part-purchase/validation-overrides.xml @@ -0,0 +1,4 @@ + + indexing-change + schema-removal + diff --git a/examples/training-artifacts/101/ch3/queries.cli b/examples/training-artifacts/101/ch3/queries.cli new file mode 100644 index 000000000..794e50451 --- /dev/null +++ b/examples/training-artifacts/101/ch3/queries.cli @@ -0,0 +1,70 @@ +### group by item. Show first 3 +vespa query "yql=select * from purchase where true | all( + group(item) + max(3) + each( + output(count()) + ) + )" + +vespa query "yql=select * from purchase where true limit 0 | all( + group(item) + order(-count()) + max(3) + each( + output(count() as(count_per_item)) + ) + )" + +### use total $$$ instead of count. But output count as well +vespa query "yql=select * from purchase where true limit 0 | all( + group(item) + order(-sum(price)) + each( + output(sum(price) as(revenue)) + output(count()) + ) + )" + +### sales by day +vespa query "yql=select * from purchase where true limit 0 | all( + group( + time.date(date) + ) + each( + output(sum(price) as(revenue_per_day)) + output(count()) + ) + )" | jq ".root.children[].children[].children[]" + +### sales by day, by item +vespa query "yql=select * from purchase where true limit 0 | all( + group(time.date(date)) + each( + output(sum(price) as(revenue_per_day)) + output(count()) + all( + group(item) + order(-sum(price)) + each( + output(sum(price) as(revenue_per_item_per_day)) + output(count()) + ) + ) + ) + )" | jq ".root.children[].children[].children[]" + + +### top items, but also show 3 sample orders +vespa query "yql=select * from purchase where true limit 0 | all( + group(item) + order(-sum(price)) + each( + output(sum(price) as(revenue)) + output(count()) + max(3) + each( + output(summary()) + ) + ) + )" diff --git a/examples/training-artifacts/101/ch3/queries.http b/examples/training-artifacts/101/ch3/queries.http index dd592a195..ee331ffd3 100644 --- a/examples/training-artifacts/101/ch3/queries.http +++ b/examples/training-artifacts/101/ch3/queries.http @@ -45,7 +45,7 @@ curl -H "Content-Type:application/json" https://ebe5e25b.d78af55d.z.vespa-app.cl time.date(date) ) each( - output(sum(price)) + output(sum(price) as(revenue)) output(count()) ) )" @@ -56,7 +56,7 @@ curl -H "Content-Type:application/json" https://ebe5e25b.d78af55d.z.vespa-app.cl "yql": "select * from purchase where true | all( group(time.date(date)) each( - output(-sum(price)) + output(sum(price)) output(count()) # within each bucket, take all orders @@ -67,7 +67,7 @@ curl -H "Content-Type:application/json" https://ebe5e25b.d78af55d.z.vespa-app.cl # order by revenue descending, like we did before order(-sum(price)) each( - output(sum(price)) + output(sum(price) as(revenue_per_item_per_day)) output(count()) ) ) @@ -102,5 +102,6 @@ curl -H "Content-Type:application/json" https://ebe5e25b.d78af55d.z.vespa-app.cl "yql": "select * from purchase where true | all( group(item) output(count()) + output(max(price)) )" -}' \ No newline at end of file +}' diff --git a/examples/training-artifacts/101/ch4/query-template.json b/examples/training-artifacts/101/ch4/query-template.json new file mode 100644 index 000000000..5915f0225 --- /dev/null +++ b/examples/training-artifacts/101/ch4/query-template.json @@ -0,0 +1,56 @@ +{ + "yql": "select * from product where —--->WHERE QUERY CLAUSE GOES HERE <—-----", + "presentation.summary": "medium", + "ranking.profile": "closeness", + "approximate_query_string": "Face Painting Stencil - QuickEZ/Gears #34", + "input.query(q_embedding)": [ + 0.015, 0.024, 0.046, -0.019, -0.036, -0.023, -0.027, -0.093, + -0.053, 0.055, -0.012, 0.082, 0.024, 0.023, 0.024, -0.038, + 0.037, -0.048, -0.1, -0.037, -0.045, 0.033, 0.023, -0.002, + -0.024, -0.035, -0.021, -0.032, -0.097, -0.187, -0.003, + 0.044, -0.019, -0.021, 0.022, -0.026, 0.002, 0.048, 0.006, + -0.041, 0.007, 0.062, -0.045, 0.019, 0.057, -0.027, 0.036, + 0.0, 0.052, 0.027, 0.0, -0.006, -0.007, -0.032, -0.064, 0.12, + -0.036, -0.004, 0.026, 0.054, -0.037, 0.062, -0.339, -0.007, + 0.05, 0.024, 0.015, -0.009, -0.082, 0.018, 0.038, -0.019, + -0.077, 0.028, 0.06, -0.016, 0.015, -0.02, 0.003, -0.087, + -0.045, 0.052, -0.023, -0.017, -0.019, 0.033, -0.041, -0.056, + 0.006, -0.011, -0.028, -0.02, -0.023, -0.009, -0.054, 0.054, + -0.014, 0.004, 0.062, 0.283, 0.035, 0.038, 0.09, -0.042, + 0.035, 0.012, -0.02, 0.036, -0.023, -0.011, -0.037, 0.008, + -0.072, 0.044, 0.056, 0.029, -0.035, -0.045, 0.026, 0.079, + -0.056, 0.022, -0.052, 0.007, -0.02, -0.013, -0.059, 0.059, + -0.001, 0.02, 0.016, 0.058, -0.053, 0.003, -0.025, -0.002, + 0.052, -0.036, -0.017, 0.019, -0.007, -0.046, 0.154, -0.011, + 0.054, 0.046, 0.025, -0.0, -0.035, -0.059, 0.017, -0.002, + 0.036, 0.059, 0.073, -0.02, -0.05, -0.034, -0.029, 0.001, + 0.042, -0.024, 0.074, 0.149, 0.033, 0.004, 0.064, 0.011, + 0.072, -0.004, -0.028, 0.001, 0.037, 0.018, -0.025, 0.029, + -0.015, 0.015, 0.035, -0.043, 0.018, 0.039, -0.05, -0.031, + -0.025, 0.039, -0.058, 0.015, 0.018, 0.104, -0.025, 0.099, + -0.097, 0.021, 0.036, 0.055, 0.04, 0.02, 0.008, -0.014, + -0.011, -0.033, 0.046, -0.05, 0.004, -0.014, 0.007, 0.026, + -0.024, -0.036, 0.011, -0.042, 0.044, 0.029, 0.032, 0.036, + 0.071, 0.017, 0.053, 0.061, 0.024, 0.006, -0.104, -0.065, + 0.03, 0.02, -0.015, -0.013, -0.014, -0.034, 0.073, 0.029, + 0.016, 0.033, 0.047, -0.009, -0.045, 0.011, -0.011, -0.034, + 0.053, 0.007, -0.058, 0.017, 0.029, -0.07, 0.0, -0.059, + -0.008, 0.121, -0.004, -0.03, 0.078, 0.04, -0.048, -0.005, + -0.147, 0.0, -0.058, 0.092, -0.051, -0.028, 0.007, -0.015, + -0.046, -0.06, -0.06, -0.007, -0.066, -0.001, 0.039, 0.049, + 0.044, 0.012, 0.046, 0.007, 0.008, 0.039, -0.093, 0.01, + -0.002, -0.025, -0.01, 0.055, -0.032, 0.013, -0.049, 0.01, + 0.02, -0.038, -0.016, -0.06, 0.036, -0.0, 0.114, -0.011, + 0.045, 0.028, -0.023, 0.004, -0.057, 0.019, -0.016, -0.002, + -0.103, -0.027, -0.017, 0.026, -0.028, 0.004, -0.005, -0.004, + 0.018, 0.052, 0.029, -0.061, 0.01, 0.069, 0.008, -0.158, + -0.055, 0.075, 0.01, -0.013, -0.042, 0.081, -0.053, 0.024, + -0.033, 0.088, 0.044, 0.014, 0.015, 0.014, 0.047, 0.008, + 0.037, -0.02, -0.108, 0.001, 0.01, 0.11, -0.014, 0.03, 0.0, + -0.016, -0.08, -0.073, 0.006, 0.01, -0.039, 0.064, -0.024, + 0.002, 0.127, 0.029, -0.05, 0.031, -0.01, 0.082, 0.004, + 0.015, -0.029, 0.017, -0.005, -0.007, 0.022, -0.043, -0.004, + 0.041, -0.004, -0.018, 0.018, -0.0, -0.012, 0.035, 0.001, + -0.053, 0.064, -0.019, 0.011, -0.02, -0.097, -0.032 + ] +} diff --git a/examples/training-artifacts/101/ch5/embedder_rrf_rag/validation-overrides.xml b/examples/training-artifacts/101/ch5/embedder_rrf_rag/validation-overrides.xml new file mode 100644 index 000000000..1de0d5319 --- /dev/null +++ b/examples/training-artifacts/101/ch5/embedder_rrf_rag/validation-overrides.xml @@ -0,0 +1,4 @@ + + indexing-change + schema-removal +