<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Relational queries on INFINI Pizza</title><link>/docs/references/search/relational/</link><description>Recent content in Relational queries on INFINI Pizza</description><generator>Hugo</generator><language>en</language><atom:link href="/docs/references/search/relational/index.xml" rel="self" type="application/rss+xml"/><item><title>Nested query</title><link>/docs/references/search/relational/nested/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/search/relational/nested/</guid><description>&lt;h1 id="nested-query">
 Nested query
 &lt;a class="anchor" href="#nested-query">#&lt;/a>
&lt;/h1>
&lt;p>Matches parent documents whose &lt;strong>nested&lt;/strong> sub-documents — objects mapped
with &lt;code>&amp;quot;nested&amp;quot;: true&lt;/code> — satisfy a query &lt;strong>within one element at a time&lt;/strong>.&lt;/p>
&lt;h2 id="the-cross-element-problem">
 The cross-element problem
 &lt;a class="anchor" href="#the-cross-element-problem">#&lt;/a>
&lt;/h2>
&lt;p>A flattened index correlates across array &lt;em>elements&lt;/em>, not within them:
&lt;code>variants.color = blue AND variants.size = L&lt;/code> matches a document as soon
as &lt;em>some&lt;/em> element is blue and &lt;em>some&lt;/em> element is L — not necessarily the
same one. The teaching dataset&amp;rsquo;s &lt;code>products&lt;/code> makes the difference visible
(each element pairs blue with L, never with M):&lt;/p></description></item><item><title>Join query</title><link>/docs/references/search/relational/join/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/search/relational/join/</guid><description>&lt;h1 id="join-query">
 Join query
 &lt;a class="anchor" href="#join-query">#&lt;/a>
&lt;/h1>
&lt;blockquote>
&lt;p>&lt;strong>Status: not yet functional.&lt;/strong> The join query parses and its wire
format is stable, but execution currently returns no matches — the
&lt;code>rewrite_joins&lt;/code> machinery exists in the engine yet no production
caller resolves the inner index. Do not rely on it; use

 &lt;a href="/docs/references/search/relational/traverse/">traverse&lt;/a> (graph edges) or application-side lookups
until a release note declares joins operational. There is no live
playground demo for this reason.&lt;/p>
&lt;/blockquote>
&lt;p>Matches documents in the current index whose &lt;code>target_field&lt;/code> values
intersect the &lt;code>join_on&lt;/code> values of documents matching a query on another
(inner) index — a semi-join. Use &lt;code>&amp;quot;_key&amp;quot;&lt;/code> as the field name to join on
document primary keys.&lt;/p></description></item><item><title>Traverse query</title><link>/docs/references/search/relational/traverse/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/search/relational/traverse/</guid><description>&lt;h1 id="traverse-query">
 Traverse query
 &lt;a class="anchor" href="#traverse-query">#&lt;/a>
&lt;/h1>
&lt;p>A bounded graph traversal over a &lt;code>relation&lt;/code>-typed edge field: starting
from seed documents, walk the edges up to &lt;code>max_depth&lt;/code> hops and emit
every reached node as a hit.&lt;/p>
&lt;p>Scores encode distance — &lt;code>1.0 / (1.0 + depth)&lt;/code> — so seeds outrank
1-hop neighbors, which outrank 2-hop neighbors, and the standard top-K
collector orders the results.&lt;/p>
&lt;h2 id="examples">
 Examples
 &lt;a class="anchor" href="#examples">#&lt;/a>
&lt;/h2>
&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;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">POST /my-collection/_search
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;query&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;traverse&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;field&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;related_to&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;seed&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;query&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span> &lt;span class="s2">&amp;#34;term&amp;#34;&lt;/span>: &lt;span class="o">{&lt;/span> &lt;span class="s2">&amp;#34;field&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;topic&amp;#34;&lt;/span>, &lt;span class="s2">&amp;#34;value&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;search-engines&amp;#34;&lt;/span> &lt;span class="o">}&lt;/span> &lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>,
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;max_depth&amp;#34;&lt;/span>: 2,
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;direction&amp;#34;&lt;/span>: &lt;span class="s2">&amp;#34;outgoing&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Seeds by document &lt;code>_key&lt;/code> (the string ids you index with):&lt;/p></description></item><item><title>Graph projection block</title><link>/docs/references/search/relational/graph/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/references/search/relational/graph/</guid><description>&lt;h1 id="graph-projection-block">
 Graph projection block
 &lt;a class="anchor" href="#graph-projection-block">#&lt;/a>
&lt;/h1>
&lt;p>Add a &lt;code>graph&lt;/code> block to any search request and the response carries a
graph — &lt;code>nodes&lt;/code> and &lt;code>edges&lt;/code> — built from the hit set, alongside the
normal &lt;code>hits&lt;/code>. Where the 
 &lt;a href="/docs/references/search/relational/traverse/">&lt;code>traverse&lt;/code>&lt;/a> query &lt;em>searches&lt;/em>
by walking edges, the &lt;code>graph&lt;/code> block &lt;em>renders&lt;/em>: it takes the documents
a query already found and projects them into a node/edge structure a
UI (or a GraphRAG pipeline) can consume directly.&lt;/p>
&lt;p>Live over the &lt;code>articles&lt;/code> teaching dataset (44 documents with a
&lt;code>related_to&lt;/code> relation field) — a term query picks the seeds, the graph
block renders everything they reach:&lt;/p></description></item></channel></rss>