<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Document on Lucille</title><link>https://kmwtechnology.github.io/lucille/docs-0.11.0/architecture/components/document/</link><description>Recent content in Document on Lucille</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 23 Oct 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://kmwtechnology.github.io/lucille/docs-0.11.0/architecture/components/document/index.xml" rel="self" type="application/rss+xml"/><item><title>Overview</title><link>https://kmwtechnology.github.io/lucille/docs-0.11.0/architecture/components/document/overview/</link><pubDate>Thu, 23 Oct 2025 00:00:00 +0000</pubDate><guid>https://kmwtechnology.github.io/lucille/docs-0.11.0/architecture/components/document/overview/</guid><description>&lt;p&gt;A Document is an ordered, named set of fields. Each field may hold a &lt;strong&gt;single value&lt;/strong&gt; or a &lt;strong&gt;list of values&lt;/strong&gt; (multi-valued). All field values are ultimately represented in JSON. Every Document has a unique &lt;code&gt;id&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="creating-a-document"&gt;Creating a Document&lt;/h2&gt;
&lt;p&gt;Use the static factory methods on the &lt;code&gt;Document&lt;/code&gt; interface:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#8f5902;font-style:italic"&gt;// Create with an explicit ID&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000"&gt;Document&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;doc&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;=&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;Document&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;.&lt;/span&gt;&lt;span style="color:#c4a000"&gt;create&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;my-doc-123&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;);&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#8f5902;font-style:italic"&gt;// Create with an auto-generated UUID&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000"&gt;Document&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;doc&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;=&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;Document&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;.&lt;/span&gt;&lt;span style="color:#c4a000"&gt;create&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;();&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Connectors typically create Documents and call &lt;code&gt;publisher.publish(doc)&lt;/code&gt; to send them into the pipeline.&lt;/p&gt;</description></item><item><title>Document IDs</title><link>https://kmwtechnology.github.io/lucille/docs-0.11.0/architecture/components/document/document-ids/</link><pubDate>Mon, 09 Jun 2025 00:00:00 +0000</pubDate><guid>https://kmwtechnology.github.io/lucille/docs-0.11.0/architecture/components/document/document-ids/</guid><description>&lt;h2 id="why-ids-must-be-deterministic"&gt;Why IDs Must Be Deterministic&lt;/h2&gt;
&lt;p&gt;In search ingestion, the document ID serves as the &lt;strong&gt;primary key in the search index&lt;/strong&gt;. When you index a document with ID &amp;ldquo;ABC&amp;rdquo;, the search engine either creates a new record or updates the existing record with that ID (upsert semantics). This has a critical implication:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If you run the same ingest twice, you want the same documents to get the same IDs.&lt;/strong&gt; Otherwise, the second run creates duplicates instead of updating existing records. A search index with 100,000 documents would become 200,000 documents after a re-run — all duplicates.&lt;/p&gt;</description></item><item><title>Document Model</title><link>https://kmwtechnology.github.io/lucille/docs-0.11.0/architecture/components/document/document-model/</link><pubDate>Mon, 09 Jun 2025 00:00:00 +0000</pubDate><guid>https://kmwtechnology.github.io/lucille/docs-0.11.0/architecture/components/document/document-model/</guid><description>&lt;h2 id="why-the-document-api-matters"&gt;Why the Document API Matters&lt;/h2&gt;
&lt;p&gt;At first glance, the idea of a &amp;ldquo;document&amp;rdquo; in a search ingestion system seems simple: it&amp;rsquo;s a bag of named fields with values. A &lt;code&gt;Map&amp;lt;String, Object&amp;gt;&lt;/code&gt; would seem to suffice. In practice, a well-designed Document API turns out to be one of the most important practical considerations in a search ETL framework, for reasons that only become apparent when you&amp;rsquo;ve written dozens of pipeline stages and dealt with the realities of search engine field models.&lt;/p&gt;</description></item></channel></rss>