Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions en/reference/writing/indexing-language.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,16 @@ <h3 id="other-expressions">Other expressions</h3>
</p>
</td>
</tr>
<tr>
<td><code>documentid [part]</code></td>
<td>
<p id="documentid">
Exposes ID of the document being processed, or, given an optional
argument, a single structural part of it as a string.
Valid <code>part</code> values are: <code>namespace, documenttype, group, number, specific</code>
</p>
</td>
</tr>
<tr>
<td><code>echo</code></td>
<td>
Expand Down
33 changes: 32 additions & 1 deletion en/writing/indexing.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,38 @@ <h2 id="switch-example">Switch example</h2>
</pre>


<h2 id="documentid">documentid example</h2>

<p>
The <code>documentid</code> expression allows taking whole or
a portion of a document ID and making it searchable.
Common uses:
</p>
<ul>
<li>Hashing document ID into a stable value for sorting or a tie-breaker</li>
<li>Making the <a href="../schemas/documents.html#namespace">namespace</a> searchable</li>
<li>Eliminate duplication of document id as a field in feed requests</li>
</ul>
<pre>
Comment thread
kkraune marked this conversation as resolved.
schema doc {
document doc {
}
field stable_hash type int {
indexing: documentid | hash | attribute
}
field namespace type string {
indexing: documentid namespace | attribute
attribute: fast-search
}
field id type string {
indexing: documentid specific | attribute
attribute: fast-search
}
}
</pre>
<p>
Available since {% include version.html version="8.741.10" %}.
</p>
Comment thread
kkraune marked this conversation as resolved.

<h2 id="combine-values-in-indexing-statements">Indexing statements example</h2>
<p>
Expand Down Expand Up @@ -175,4 +207,3 @@ <h2 id="combine-values-in-indexing-statements">Indexing statements example</h2>
<tr><td>field1 and field2</td><td>field1 and field2 are updated</td></tr>
</tbody>
</table>