<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tutorial on INFINI Pizza</title><link>/docs/tutorial/</link><description>Recent content in Tutorial on INFINI Pizza</description><generator>Hugo</generator><language>en</language><atom:link href="/docs/tutorial/index.xml" rel="self" type="application/rss+xml"/><item><title>Lesson 1 — First search</title><link>/docs/tutorial/first-search/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/tutorial/first-search/</guid><description>&lt;h1 id="lesson-1--first-search">
 Lesson 1 — First search
 &lt;a class="anchor" href="#lesson-1--first-search">#&lt;/a>
&lt;/h1>
&lt;p>Start the node, index documents, run your first queries, and watch them
update in real time.&lt;/p>
&lt;p>You need a running node — 
 &lt;a href="/docs/getting-started/installation/">installation&lt;/a>
covers it in one command. With the node up, index your first document:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sh" data-lang="sh">&lt;span class="line">&lt;span class="cl">curl -X POST -H &lt;span class="s2">&amp;#34;Authorization: Bearer &lt;/span>&lt;span class="nv">$KEY&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -H &lt;span class="s1">&amp;#39;Content-Type: application/json&amp;#39;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="s1">&amp;#39;{&amp;#34;message&amp;#34;: &amp;#34;hello pizza&amp;#34;, &amp;#34;level&amp;#34;: &amp;#34;info&amp;#34;}&amp;#39;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> http://localhost:28000/playground-logs/_doc
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>There is no refresh call, no flush step — search for it in the same breath:&lt;/p></description></item><item><title>Lesson 2 — Text search</title><link>/docs/tutorial/text-search/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/tutorial/text-search/</guid><description>&lt;h1 id="lesson-2--text-search">
 Lesson 2 — Text search
 &lt;a class="anchor" href="#lesson-2--text-search">#&lt;/a>
&lt;/h1>
&lt;p>How text actually matches: analysis, exact terms, phrases, and the
error-tolerant family. Everything below runs live on the &lt;code>logs&lt;/code> collection
(150 documents with &lt;code>message&lt;/code>, &lt;code>level&lt;/code>, &lt;code>host&lt;/code>, &lt;code>url.path&lt;/code>).&lt;/p>
&lt;h2 id="exact-terms-vs-analyzed-text">
 Exact terms vs analyzed text
 &lt;a class="anchor" href="#exact-terms-vs-analyzed-text">#&lt;/a>
&lt;/h2>
&lt;p>A 
 &lt;a href="/docs/references/search/term-level/term/">&lt;code>term&lt;/code>&lt;/a> query matches the stored value
exactly — no tokenization, no casing help. A

 &lt;a href="/docs/references/search/full-text/match/">&lt;code>match&lt;/code>&lt;/a> query runs the field&amp;rsquo;s analyzer
first, so casing and punctuation stop mattering:&lt;/p>
&lt;div class="pizza-playground" data-dataset="logs" data-dsl="{
 &amp;#34;query&amp;#34;: { &amp;#34;match&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;message&amp;#34;, &amp;#34;query&amp;#34;: &amp;#34;search&amp;#34; } },
 &amp;#34;size&amp;#34;: 3,
 &amp;#34;track_total_hits&amp;#34;: true
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;p>Compare with a &lt;code>term&lt;/code> on the keyword field &lt;code>level&lt;/code> — exact, and therefore
fast and predictable:&lt;/p></description></item><item><title>Lesson 3 — Structure and numbers</title><link>/docs/tutorial/structure-numbers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/tutorial/structure-numbers/</guid><description>&lt;h1 id="lesson-3--structure-and-numbers">
 Lesson 3 — Structure and numbers
 &lt;a class="anchor" href="#lesson-3--structure-and-numbers">#&lt;/a>
&lt;/h1>
&lt;p>Ranges, sorts, and cursor pagination over the &lt;code>sales&lt;/code> collection (120
documents: &lt;code>type&lt;/code>, &lt;code>price&lt;/code>, &lt;code>qty&lt;/code>, &lt;code>amount&lt;/code>, &lt;code>merchant&lt;/code>, &lt;code>status&lt;/code>, &lt;code>date&lt;/code>).&lt;/p>
&lt;h2 id="the-types-behind-the-data">
 The types behind the data
 &lt;a class="anchor" href="#the-types-behind-the-data">#&lt;/a>
&lt;/h2>
&lt;p>Numbers are indexed as their real types (&lt;code>float&lt;/code> for &lt;code>price&lt;/code>, integers for
&lt;code>qty&lt;/code>), dates as epoch millis. That is what makes the queries below precise
— see the 
 &lt;a href="/docs/references/schema/field-types/">field types&lt;/a> reference for the
full catalog.&lt;/p>
&lt;h2 id="ranges">
 Ranges
 &lt;a class="anchor" href="#ranges">#&lt;/a>
&lt;/h2>
&lt;p>A 
 &lt;a href="/docs/references/search/term-level/range/">&lt;code>range&lt;/code>&lt;/a> query takes any combination of
&lt;code>gt/gte/lt/lte&lt;/code>:&lt;/p></description></item><item><title>Lesson 4 — Aggregations</title><link>/docs/tutorial/aggregations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/tutorial/aggregations/</guid><description>&lt;h1 id="lesson-4--aggregations">
 Lesson 4 — Aggregations
 &lt;a class="anchor" href="#lesson-4--aggregations">#&lt;/a>
&lt;/h1>
&lt;p>From counts to histograms to composite paging — over &lt;code>sales&lt;/code> and &lt;code>logs&lt;/code>,
with known answers you can verify by hand.&lt;/p>
&lt;h2 id="metric-aggregations">
 Metric aggregations
 &lt;a class="anchor" href="#metric-aggregations">#&lt;/a>
&lt;/h2>
&lt;p>One number out: 
 &lt;a href="/docs/references/aggregation/metric/sum/">&lt;code>sum&lt;/code>&lt;/a>,

 &lt;a href="/docs/references/aggregation/metric/avg/">&lt;code>avg&lt;/code>&lt;/a>, &lt;code>min&lt;/code>, &lt;code>max&lt;/code>,

 &lt;a href="/docs/references/aggregation/metric/stats/">&lt;code>stats&lt;/code>&lt;/a> (all of them at once),

 &lt;a href="/docs/references/aggregation/metric/cardinality/">&lt;code>cardinality&lt;/code>&lt;/a> (distinct
values):&lt;/p>
&lt;div class="pizza-playground" data-dataset="sales" data-dsl="{
 &amp;#34;size&amp;#34;: 0,
 &amp;#34;aggs&amp;#34;: {
 &amp;#34;price_stats&amp;#34;: { &amp;#34;stats&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;price&amp;#34; } },
 &amp;#34;distinct_types&amp;#34;: { &amp;#34;cardinality&amp;#34;: { &amp;#34;field&amp;#34;: &amp;#34;type&amp;#34; } }
 }
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;p>Four distinct product types; &lt;code>stats&lt;/code> gives you min/max/sum/avg/count in one
round trip.&lt;/p></description></item><item><title>Lesson 5 — Relations and hybrid search</title><link>/docs/tutorial/relations-hybrid/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/tutorial/relations-hybrid/</guid><description>&lt;h1 id="lesson-5--relations-and-hybrid-search">
 Lesson 5 — Relations and hybrid search
 &lt;a class="anchor" href="#lesson-5--relations-and-hybrid-search">#&lt;/a>
&lt;/h1>
&lt;p>The two features that most distinguish Pizza from a plain text index:
relations as first-class query targets, and retrieval pipelines you compose
explicitly.&lt;/p>
&lt;h2 id="relations">
 Relations
 &lt;a class="anchor" href="#relations">#&lt;/a>
&lt;/h2>
&lt;p>The &lt;code>articles&lt;/code> collection (44 documents) carries a &lt;code>related_to&lt;/code> field of
type &lt;code>relation&lt;/code> — each document declares the articles it points at. A

 &lt;a href="/docs/references/search/relational/traverse/">&lt;code>traverse&lt;/code>&lt;/a> query walks those edges:&lt;/p>
&lt;div class="pizza-playground" data-dataset="articles" data-dsl="{
 &amp;#34;query&amp;#34;: {
 &amp;#34;traverse&amp;#34;: {
 &amp;#34;field&amp;#34;: &amp;#34;related_to&amp;#34;,
 &amp;#34;seed&amp;#34;: { &amp;#34;keys&amp;#34;: [&amp;#34;A01&amp;#34;, &amp;#34;A05&amp;#34;] },
 &amp;#34;max_depth&amp;#34;: 1,
 &amp;#34;direction&amp;#34;: &amp;#34;both&amp;#34;
 }
 },
 &amp;#34;size&amp;#34;: 5,
 &amp;#34;track_total_hits&amp;#34;: true
}">
 &lt;noscript>JavaScript is disabled — use the curl form of this example instead.&lt;/noscript>
&lt;/div>
&lt;p>Two documents are reachable at depth 0 (the seeds themselves), 17 at depth
1 — the known answer for this dataset. Change &lt;code>max_depth&lt;/code> to 2 and watch the
circle grow.&lt;/p></description></item><item><title>Lesson 6 — Operations</title><link>/docs/tutorial/operations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/tutorial/operations/</guid><description>&lt;h1 id="lesson-6--operations">
 Lesson 6 — Operations
 &lt;a class="anchor" href="#lesson-6--operations">#&lt;/a>
&lt;/h1>
&lt;p>Keeping a node healthy: partial updates in place, compaction, the change
feed, and reading cluster state. This lesson is server-side — start a node
as in 
 &lt;a href="/docs/tutorial/#lesson-1-first-search">Lesson 1&lt;/a> and run the curls
against it.&lt;/p>
&lt;h2 id="partial-updates-in-place">
 Partial updates in place
 &lt;a class="anchor" href="#partial-updates-in-place">#&lt;/a>
&lt;/h2>
&lt;p>The document update API takes &lt;code>doc&lt;/code> (merge), &lt;code>ops&lt;/code> (arithmetic), or both:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-sh" data-lang="sh">&lt;span class="line">&lt;span class="cl">curl -X POST -H &lt;span class="s2">&amp;#34;Authorization: Bearer &lt;/span>&lt;span class="nv">$KEY&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -H &lt;span class="s1">&amp;#39;Content-Type: application/json&amp;#39;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="s1">&amp;#39;{
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;ops&amp;#34;: [
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> { &amp;#34;op&amp;#34;: &amp;#34;incr&amp;#34;, &amp;#34;field&amp;#34;: &amp;#34;qty&amp;#34;, &amp;#34;value&amp;#34;: -1 },
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> { &amp;#34;op&amp;#34;: &amp;#34;min&amp;#34;, &amp;#34;field&amp;#34;: &amp;#34;price&amp;#34;, &amp;#34;value&amp;#34;: 9.9 }
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> ]
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> }&amp;#39;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> http://localhost:28000/sales/_update/&amp;lt;doc_id&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Eleven operators — &lt;code>set, unset, incr, mul, min, max, toggle, append, add_to_set, rename, current_date&lt;/code> — each a column-level write, not a
read-modify-write of the whole document. Fields mapped with &lt;code>&amp;quot;inplace&amp;quot;: true&lt;/code> apply as O(1) column writes; the full semantics (visibility,
arithmetic, mixed updates) are in the

 &lt;a href="/docs/references/document/partial_update/">partial update reference&lt;/a> and

 &lt;a href="/docs/highlightings/inplace-columns/">in-place columns&lt;/a>.&lt;/p></description></item></channel></rss>