Files
doc-exports/docs/css/umn/css_01_0121.html
zhengxiu 93d856d5c5 css umn 25.6.0 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: zhengxiu <zhengxiu@huawei.com>
Co-committed-by: zhengxiu <zhengxiu@huawei.com>
2025-11-25 11:34:43 +00:00

407 lines
47 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="EN-US_TOPIC_0000002319559898"></a><a name="EN-US_TOPIC_0000002319559898"></a>
<h1 class="topictitle1">Creating a Vector Index</h1>
<div id="body0000002319559898"><p id="EN-US_TOPIC_0000002319559898__p20408852103114">Create a vector index in your Elasticsearch cluster and define a mapping that contains vector fields, including vector dimensions, indexing algorithm, and similarity measurement methods. Then store vectors (typically along with the original data or metadata) into this index.</p>
<div class="section" id="EN-US_TOPIC_0000002319559898__section19290611155415"><h4 class="sectiontitle">Logging In to Kibana</h4><p id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_en-us_topic_0000002271391393_p84498183236">Log in to Kibana and go to the command execution page. Elasticsearch clusters support multiple access methods. This topic uses Kibana as an example to describe the operation procedures.</p>
<ol id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_en-us_topic_0000002271391393_ol13172153674611"><li id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_en-us_topic_0000002271391393_en-us_topic_0000001268594549_li5509181942419"><span id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_ph152259618315">Log in to the CSS management console.</span></li><li id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_en-us_topic_0000002271391393_li4250043448">In the navigation pane on the left, choose <span class="uicontrol" id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_uicontrol192689888185117"><b>Clusters &gt; Elasticsearch</b></span>.</li><li id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_en-us_topic_0000002271391393_en-us_topic_0000001268154521_li6012554340">In the cluster list, find the target cluster, and click <strong id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_b18928803044129">Kibana</strong> in the <strong id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_b5255083364129">Operation</strong> column to log in to the Kibana console.</li><li id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_en-us_topic_0000002271391393_li270075935613">In the left navigation pane, choose <strong id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_b3927845824129">Dev Tools</strong>.<p id="EN-US_TOPIC_0000002319559898__en-us_topic_0000002338102386_p1810995434510">The left part of the console is the command input box, and the triangle icon in its upper-right corner is the execution button. The right part shows the execution result.</p>
</li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000002319559898__en-us_topic_0000001309709789_section137344225249"><a name="EN-US_TOPIC_0000002319559898__en-us_topic_0000001309709789_section137344225249"></a><a name="en-us_topic_0000001309709789_section137344225249"></a><h4 class="sectiontitle">Creating a Vector Index</h4><p id="EN-US_TOPIC_0000002319559898__p2584161163510">Run the following command on Kibana to create a vector index.</p>
<p id="EN-US_TOPIC_0000002319559898__en-us_topic_0000001309709789_p201369284315">For example, create an index named <strong id="EN-US_TOPIC_0000002319559898__b10195132110451">my_index</strong>. This index contains a vector field named <strong id="EN-US_TOPIC_0000002319559898__b1285183464511">my_vector</strong> and a text field named <strong id="EN-US_TOPIC_0000002319559898__b4646154119459">my_label</strong>. A graph-based index is created for the vector field, and Euclidean distance is used for similarity measurement.</p>
<pre class="screen" id="EN-US_TOPIC_0000002319559898__en-us_topic_0000001309709789_screen1122662184413">PUT my_index
{
"settings": {
"index": {
"vector": true,
"number_of_shards": 1,
"number_of_replicas": 1
}
},
"mappings": {
"properties": {
"my_vector": {
"type": "vector",
"dimension": 2,
"indexing": true,
"algorithm": "GRAPH",
"metric": "euclidean"
},
"my_label": {
"type": "keyword"
}
}
}
}</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002319559898__table12557446174819" frame="border" border="1" rules="all"><caption><b>Table 1 </b>settings parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002319559898__row6557194614814"><th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.3.5.2.5.1.1"><p id="EN-US_TOPIC_0000002319559898__p45578461488">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.000000000000002%" id="mcps1.3.3.5.2.5.1.2"><p id="EN-US_TOPIC_0000002319559898__p3558184644813">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.5.2.5.1.3"><p id="EN-US_TOPIC_0000002319559898__p1555874617482">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="48%" id="mcps1.3.3.5.2.5.1.4"><p id="EN-US_TOPIC_0000002319559898__p455844611481">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002319559898__row11558114614819"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.5.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p15581465489">index.vector</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.5.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p165581046184816">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.5.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p7558546154810">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.5.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p155884619483">Whether to enable vector indexes.</p>
<p id="EN-US_TOPIC_0000002319559898__p175581046114820">Set this parameter to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue955812466489"><b>true</b></span>. Otherwise, vector indexes cannot be created.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row973618540251"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.5.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p1490185712253">index.number_of_shards</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.5.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p4901185717256">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.5.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p18901457182517">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.5.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p1190175792519">Number of index shards. This value should be divisible by the number of cluster nodes.</p>
<p id="EN-US_TOPIC_0000002319559898__p8901175752517">Value range: 11024</p>
<p id="EN-US_TOPIC_0000002319559898__p367912717278">Default value: <strong id="EN-US_TOPIC_0000002319559898__b144965262510176">1</strong></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row1879805612520"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.5.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p6901105714256">index.number_of_replicas</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.5.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p17901125762513">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.5.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p0901105782519">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.5.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p12901957142519">Number of index replicas. Replicas improve data availability.</p>
<p id="EN-US_TOPIC_0000002319559898__p139015572254">Value range: 0 to the number of nodes minus 1</p>
<p id="EN-US_TOPIC_0000002319559898__p69011457192519">Default value: <strong id="EN-US_TOPIC_0000002319559898__b175147510610176">1</strong></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row1558164654814"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.5.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p1555934664812">index.vector.exact_search_threshold</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.5.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p155914468481">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.5.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p455944614487">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.5.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p2055912466489">Threshold for automatically switching from pre-filtering search to brute-force search. When the size of the intermediate result set in a segment is lower than this threshold, a brute-force search is performed.</p>
<p id="EN-US_TOPIC_0000002319559898__p255915464489">Value range: null (disables auto switchover from pre-filtering search to brute-force search) or a positive integer</p>
<p id="EN-US_TOPIC_0000002319559898__p6559204612482">Default value: null (disables auto switchover from pre-filtering search to brute-force search)</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row3559114614815"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.5.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p5559046164810">index.vector.search.concurrency.enabled</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.5.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p455914463486">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.5.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p17559146144812">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.5.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p6559746124816">Whether to enable concurrent vector searches across segments. In an Elasticsearch cluster, each index shard consists of multiple segments. By default, each segment is searched in sequence. Enabling concurrent searches across segments reduces query latency but does not increase the cluster's maximum query throughput. Furthermore, it may increase the average CPU usage of cluster nodes.</p>
<p id="EN-US_TOPIC_0000002319559898__p2055964604819">This parameter is available only for Elasticsearch 7.10.2 clusters whose image version is 7.10.2_25.3.0_x.x.x or later.</p>
<div class="p" id="EN-US_TOPIC_0000002319559898__p655911467484">Value range:<ul id="EN-US_TOPIC_0000002319559898__ul1855954616486"><li id="EN-US_TOPIC_0000002319559898__li6559546124814"><strong id="EN-US_TOPIC_0000002319559898__b5532341131414">true</strong>: Enables concurrent search.</li><li id="EN-US_TOPIC_0000002319559898__li7559746174816"><strong id="EN-US_TOPIC_0000002319559898__b57374413146">false</strong> (default): Performs serial search.</li></ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002319559898__table20683330174917" frame="border" border="1" rules="all"><caption><b>Table 2 </b>mappings parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002319559898__row18683130184910"><th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.3.6.2.5.1.1"><p id="EN-US_TOPIC_0000002319559898__p186831930124918">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.000000000000002%" id="mcps1.3.3.6.2.5.1.2"><p id="EN-US_TOPIC_0000002319559898__p46831030104916">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.6.2.5.1.3"><p id="EN-US_TOPIC_0000002319559898__p15683230174918">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="48%" id="mcps1.3.3.6.2.5.1.4"><p id="EN-US_TOPIC_0000002319559898__p368323064920">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002319559898__row7685203010496"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.6.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p56850307498">type</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.6.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p11685133014494">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.6.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p96851730124912">String</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.6.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p1068573024916">Data type of a field.</p>
<p id="EN-US_TOPIC_0000002319559898__p25037203910">Set this parameter to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue1450352010917"><b>vector</b></span> to indicate vector fields.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row146851330174920"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.6.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p11685330114918">dimension</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.6.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p1268503010497">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.6.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p568663094910">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.6.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p968683044917">Number of vector dimensions.</p>
<p id="EN-US_TOPIC_0000002319559898__p5686730174914">Value range: 14096</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row12686530134918"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.6.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p1668633012494">indexing</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.6.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p3686193017494">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.6.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p106861930164914">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.6.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p4686173014918">Whether to enable vector index acceleration.</p>
<div class="p" id="EN-US_TOPIC_0000002319559898__p968603016498">Value range:<ul id="EN-US_TOPIC_0000002319559898__ul196861730154919"><li id="EN-US_TOPIC_0000002319559898__li206861308498"><strong id="EN-US_TOPIC_0000002319559898__b872761914250">true</strong>: Enables vector index acceleration. When this parameter is set to <strong id="EN-US_TOPIC_0000002319559898__b3727161915256">true</strong>, an extra vector index is created. The indexing algorithm is specified by the <strong id="EN-US_TOPIC_0000002319559898__b57271919192511">algorithm</strong> field and the index supports vector search.</li><li id="EN-US_TOPIC_0000002319559898__li468612306491"><strong id="EN-US_TOPIC_0000002319559898__b104015762213">false</strong>: Disables vector index acceleration. When this parameter is set to <strong id="EN-US_TOPIC_0000002319559898__b14403742212">false</strong>, vector data is written only to docvalues, and only <strong id="EN-US_TOPIC_0000002319559898__b1040177172216">ScriptScore</strong> and <strong id="EN-US_TOPIC_0000002319559898__b740475222">Rescore</strong> can be used for vector search.</li></ul>
</div>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row66865301495"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.6.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p768611302496">lazy_indexing</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.6.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p2686113074916">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.6.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p9686930154919">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.6.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p1868618308493">Whether to enable delayed vector indexing, where vector indexes are not built immediately when data is ingested. The aim to speed up write operations.</p>
<p id="EN-US_TOPIC_0000002319559898__p13686130124911">The configuration of lazy_indexing takes effect only when: <strong id="EN-US_TOPIC_0000002319559898__b152562706210176">indexing</strong> is set to <strong id="EN-US_TOPIC_0000002319559898__b39007980610176">true</strong>; the cluster version is Elasticsearch 7.10.2; and the cluster image version is no earlier than 7.10.2_24.3.3_x.x.x.</p>
<div class="p" id="EN-US_TOPIC_0000002319559898__p66861630184919">Value range:<ul id="EN-US_TOPIC_0000002319559898__ul13686183020494"><li id="EN-US_TOPIC_0000002319559898__li6686730134912"><strong id="EN-US_TOPIC_0000002319559898__b8604049192511">true</strong>: Enables delayed indexing. Vector indexes (such as graph-based indexes) are not built immediately when data is ingested. Instead, <a href="css_01_0296.html#EN-US_TOPIC_0000002353678449__section164656265118">(Optional) Post-processing after Data Ingestion: Offline Index Building</a> needs to be performed to build vector indexes. The vector indexes can then be used for vector search.</li><li id="EN-US_TOPIC_0000002319559898__li1687193010493"><strong id="EN-US_TOPIC_0000002319559898__b1961205832817">false</strong> (default): Disables delayed indexing.</li></ul>
</div>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row1168773016491"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.6.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p13687830164910">algorithm</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.6.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p4687330174910">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.6.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p26871230194915">String</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.6.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p668717304497">Vector indexing algorithm.</p>
<p id="EN-US_TOPIC_0000002319559898__p176871330164913">This parameter is valid only when <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname17687143017494"><b>indexing</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue5687113024913"><b>true</b></span>. When this parameter is set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue368713302498"><b>IVF_GRAPH</b></span> or <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue868743015499"><b>IVF_GRAPH_PQ</b></span>, <a href="#EN-US_TOPIC_0000002319559898__section1291152903010">(Optional) Pre-Building and Registering Centroid Vectors</a> is required.</p>
<div class="p" id="EN-US_TOPIC_0000002319559898__p15687730194914">Value range:<ul id="EN-US_TOPIC_0000002319559898__ul206871730164919"><li id="EN-US_TOPIC_0000002319559898__li13687123094913"><strong id="EN-US_TOPIC_0000002319559898__b75547281810176">FLAT</strong>: brute-force algorithm that calculates the distance between the target vector and all vectors in sequence. The algorithm relies on sheer computing power and its recall rate can reach 100%. You can use this algorithm if you require high recall accuracy.</li><li id="EN-US_TOPIC_0000002319559898__li156871430174916"><strong id="EN-US_TOPIC_0000002319559898__b49001346253">GRAPH</strong> (default): Hierarchical Navigable Small Worlds (HNSW) algorithm for graph-based indexes. This algorithm is mainly used when high performance and precision are required and the number of documents in a single shard reaches 10 million.</li><li id="EN-US_TOPIC_0000002319559898__li9687103012493"><strong id="EN-US_TOPIC_0000002319559898__b180908218910176">GRAPH_PQ</strong>: a combination of the HNSW algorithm and the PQ algorithm. The PQ algorithm reduces the storage overhead of the original vectors, so that HNSW can easily search through hundreds of millions of records.</li><li id="EN-US_TOPIC_0000002319559898__li1868712309492"><strong id="EN-US_TOPIC_0000002319559898__b16240287610176">GRAPH_SQ8</strong>: a combination of the HNSW algorithm and the scalar quantization (SQ) algorithm. By quantizing float32 values into int8, this algorithm reduces the storage overhead of the original vectors and improves build and query efficiency. The downside is a slightly decreased recall rate. Only Elasticsearch 7.10.2 clusters support this algorithm.</li><li id="EN-US_TOPIC_0000002319559898__li1668715303494"><strong id="EN-US_TOPIC_0000002319559898__b198552539210176">GRAPH_SQ4</strong>: a combination of the HNSW algorithm and the SQ algorithm. By quantizing float32 values into int4, this algorithm reduces the storage overhead of the original vectors and improves build and query efficiency. The downside is a slightly decreased recall rate. SQ4 has a higher quantization/compression ratio and higher computational efficiency than SQ8, but also a large decrease in recall rate. Only Elasticsearch 7.10.2 clusters support this algorithm.</li><li id="EN-US_TOPIC_0000002319559898__li146873303496"><strong id="EN-US_TOPIC_0000002319559898__b142688118910176">IVF_GRAPH</strong>: a combination of IVF and HNSW. The entire space is divided into multiple cluster centroids, which makes search much faster but slightly inaccurate. You can use this algorithm if you require high performance when searching through hundreds of millions of records.</li><li id="EN-US_TOPIC_0000002319559898__li668793064917"><strong id="EN-US_TOPIC_0000002319559898__b64611001710176">IVF_GRAPH_PQ</strong>: a combination of the PQ algorithm with the IVF or HNSW algorithm to further improve the system capacity and reduce the system overhead. This algorithm is applicable when there are more than 1 billion documents in shards and high retrieval performance is required.</li></ul>
</div>
<p id="EN-US_TOPIC_0000002319559898__p125342005816">When the indexing algorithm is set to GRAPH, GRAPH_PQ, GRAPH_SQ8, or GRAPH_SQ4, CSS provides additional parameters, as shown in <a href="#EN-US_TOPIC_0000002319559898__table96225128514">Table 3</a> and <a href="#EN-US_TOPIC_0000002319559898__table119841865016">Table 4</a>, that you can choose to configure to enhance query performance and accuracy.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row56881730134914"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.6.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p4688123064912">dim_type</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.6.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p1868817307495">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.6.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p5688530174920">String</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.6.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p0688530164912">Vector data type.</p>
<div class="p" id="EN-US_TOPIC_0000002319559898__p17688183084915">Value range:<ul id="EN-US_TOPIC_0000002319559898__ul1868817309495"><li id="EN-US_TOPIC_0000002319559898__li568893016497">binary: binary value</li><li id="EN-US_TOPIC_0000002319559898__li18688183013493">float (default): floating-point number</li></ul>
</div>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row15688153034918"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.6.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p1368833010495">metric</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.6.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p168823012491">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.6.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p1868863014495">String</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.6.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p1768816303498">Vector distance metric, which measures the similarity or distance between vectors.</p>
<p id="EN-US_TOPIC_0000002319559898__p1768803024912">Value range:</p>
<ul id="EN-US_TOPIC_0000002319559898__ul1868817308492"><li id="EN-US_TOPIC_0000002319559898__li4688030174916"><strong id="EN-US_TOPIC_0000002319559898__b15685185012477">euclidean</strong> (default): Euclidean distance</li><li id="EN-US_TOPIC_0000002319559898__li146881630194914"><strong id="EN-US_TOPIC_0000002319559898__b37500385010176">inner_product</strong>: inner product distance</li><li id="EN-US_TOPIC_0000002319559898__li20688103054920"><strong id="EN-US_TOPIC_0000002319559898__b197641875110176">cosine</strong>: cosine distance</li><li id="EN-US_TOPIC_0000002319559898__li7688730164915"><strong id="EN-US_TOPIC_0000002319559898__b6140111814485">hamming</strong>: Hamming distance, which can be used only when <strong id="EN-US_TOPIC_0000002319559898__b114071816486">dim_type</strong> is set to <strong id="EN-US_TOPIC_0000002319559898__b1514021874815">binary</strong>.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002319559898__table96225128514"></a><a name="table96225128514"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002319559898__table96225128514" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Optional parameters for the GRAPH indexing algorithm</caption><thead align="left"><tr id="EN-US_TOPIC_0000002319559898__row1062381215119"><th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.3.7.2.5.1.1"><p id="EN-US_TOPIC_0000002319559898__p186231129518">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.000000000000002%" id="mcps1.3.3.7.2.5.1.2"><p id="EN-US_TOPIC_0000002319559898__p8623101275116">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.7.2.5.1.3"><p id="EN-US_TOPIC_0000002319559898__p116237127517">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="48%" id="mcps1.3.3.7.2.5.1.4"><p id="EN-US_TOPIC_0000002319559898__p8623212125112">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002319559898__row136239121513"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.7.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p186243127512">neighbors</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.7.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p762411217516">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.7.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p0624191225120">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.7.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p12624912145110">Number of neighbors of each vector in the graph index. A larger value results in higher query accuracy but slower index building and query.</p>
<p id="EN-US_TOPIC_0000002319559898__p16624111225114">This parameter is available only when <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname206242012115112"><b>indexing</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue662414126511"><b>true</b></span>, and <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname962414123514"><b>algorithm</b></span> is GRAPH, GRAPH_PQ, GRAPH_SQ8, or GRAPH_SQ4.</p>
<p id="EN-US_TOPIC_0000002319559898__p3624112145118">Value range: 20255</p>
<p id="EN-US_TOPIC_0000002319559898__p3624512125110">Default value: <strong id="EN-US_TOPIC_0000002319559898__b3318837910176">64</strong></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row462471216517"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.7.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p17624131213518">shrink</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.7.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p1062416126513">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.7.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p1562461295115">Float</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.7.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p262571213513">How aggressively the HNSW graph removes redundant edges during construction. This setting affects the structure of the HNSW graph.</p>
<p id="EN-US_TOPIC_0000002319559898__p4625912155118">Default value: 1.0f</p>
<p id="EN-US_TOPIC_0000002319559898__p1762561218519">This parameter is available only when <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname1364731414555"><b>indexing</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue14647111405514"><b>true</b></span>, and <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname164720149558"><b>algorithm</b></span> is GRAPH, GRAPH_PQ, GRAPH_SQ8, or GRAPH_SQ4.</p>
<p id="EN-US_TOPIC_0000002319559898__p862571245116">Value range: 0.110</p>
<p id="EN-US_TOPIC_0000002319559898__p6625212105116">Default value: <strong id="EN-US_TOPIC_0000002319559898__b23297918610176">1</strong></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row136251312135115"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.7.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p1862519124519">scaling</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.7.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p46256125514">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.7.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p12625201217516">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.7.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p1262518122516">Scaling ratio for the number of upper-layer graph nodes in the HNSW graph. This setting affects the layers of the HNSW graph.</p>
<p id="EN-US_TOPIC_0000002319559898__p10625312115114">This parameter is available only when <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname8201257155819"><b>indexing</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue32010573584"><b>true</b></span>, and <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname1220135714588"><b>algorithm</b></span> is GRAPH, GRAPH_PQ, GRAPH_SQ8, or GRAPH_SQ4.</p>
<p id="EN-US_TOPIC_0000002319559898__p11626012155119">Value range: 0128</p>
<p id="EN-US_TOPIC_0000002319559898__p1862631295116">Default value: 50</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row96261212115112"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.7.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p12626112105119">efc</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.7.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p186261612135120">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.7.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p11626131285111">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.7.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p1662621215117">How many nearest neighbors to explore when inserting a new vector into the HNSW graph. A larger value results in higher accuracy but slower index building.</p>
<p id="EN-US_TOPIC_0000002319559898__p166261712125115">This parameter is available only when <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname9571170522"><b>indexing</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue257113017210"><b>true</b></span>, and <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname2057117016214"><b>algorithm</b></span> is GRAPH, GRAPH_PQ, GRAPH_SQ8, or GRAPH_SQ4.</p>
<p id="EN-US_TOPIC_0000002319559898__p15626101295114">Value range: 0100000</p>
<p id="EN-US_TOPIC_0000002319559898__p4626101211513">Default value: <strong id="EN-US_TOPIC_0000002319559898__b116678757710176">200</strong></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row106263127512"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.7.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p3626161215516">max_scan_num</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.7.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p176261612205119">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.7.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p6626112115116">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.7.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p762621275119">Maximum number of nodes to be scanned during search or index building. A larger value results in higher query accuracy but slower indexing.</p>
<p id="EN-US_TOPIC_0000002319559898__p156267121517">This parameter is available only when <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname11666192020615"><b>indexing</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue136661820765"><b>true</b></span>, and <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname186669208615"><b>algorithm</b></span> is GRAPH, GRAPH_PQ, GRAPH_SQ8, or GRAPH_SQ4.</p>
<p id="EN-US_TOPIC_0000002319559898__p176272129513">Value range: 0 to 1000000</p>
<p id="EN-US_TOPIC_0000002319559898__p1662720127514">Default value: <strong id="EN-US_TOPIC_0000002319559898__b25213477310176">10000</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002319559898__table119841865016"></a><a name="table119841865016"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002319559898__table119841865016" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Optional parameters for the GRAPH_PQ indexing algorithm</caption><thead align="left"><tr id="EN-US_TOPIC_0000002319559898__row1919917182503"><th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.3.8.2.5.1.1"><p id="EN-US_TOPIC_0000002319559898__p171991184508">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.000000000000002%" id="mcps1.3.3.8.2.5.1.2"><p id="EN-US_TOPIC_0000002319559898__p1119951815019">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.8.2.5.1.3"><p id="EN-US_TOPIC_0000002319559898__p2019951819505">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="48%" id="mcps1.3.3.8.2.5.1.4"><p id="EN-US_TOPIC_0000002319559898__p619991819506">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002319559898__row1221161812502"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.8.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p921151815509">centroid_num</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.8.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p17211101817506">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.8.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p42115189506">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.8.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p72117184503">Number of centroids used during the coarse quantization stage of the algorithm. It affects quantization granularity and storage.</p>
<p id="EN-US_TOPIC_0000002319559898__p3211318165018">This parameter is available only when <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname418316020232"><b>indexing</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue11839020239"><b>true</b></span>, and <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname618318092315"><b>algorithm</b></span> is GRAPH_PQ.</p>
<p id="EN-US_TOPIC_0000002319559898__p2211218135014">Value range: 065535</p>
<p id="EN-US_TOPIC_0000002319559898__p1821114180505">Default value: 255</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row22116189502"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.8.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p17211161818509">fragment_num</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.8.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p192117185504">No</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.8.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p1021101875019">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.3.8.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p6211131815014">Number of fragments each vector is split into. It affects the PQ quantization granularity.</p>
<p id="EN-US_TOPIC_0000002319559898__p192121718125013">The default value is <strong id="EN-US_TOPIC_0000002319559898__b122552267610176">0</strong>. The plug-in automatically sets the number of fragments based on the vector length.</p>
<p id="EN-US_TOPIC_0000002319559898__p11212418185018">This parameter is available only when <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname1252812615256"><b>indexing</b></span> is set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue9528761251"><b>true</b></span>, and <span class="parmname" id="EN-US_TOPIC_0000002319559898__parmname652814612514"><b>algorithm</b></span> is GRAPH_PQ.</p>
<p id="EN-US_TOPIC_0000002319559898__p8212181817507">Value range: 04096</p>
<p id="EN-US_TOPIC_0000002319559898__p16212201845016">Default value: <strong id="EN-US_TOPIC_0000002319559898__b5643132403013">0</strong>. The plug-in automatically sets the number of fragments based on the vector length.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002319559898__section1291152903010"><a name="EN-US_TOPIC_0000002319559898__section1291152903010"></a><a name="section1291152903010"></a><h4 class="sectiontitle">(Optional) Pre-Building and Registering Centroid Vectors</h4><p id="EN-US_TOPIC_0000002319559898__p1691182953014">When the IVF_GRAPH or IVF_GRAPH_PQ algorithm is used for vector indexing, you need to pre-build and register centroid vectors.</p>
<p id="EN-US_TOPIC_0000002319559898__p291110291302">IVF_GRAPH and IVF_GRAPH_PQ help to accelerate indexing and queries in ultra-large-scale clusters. They allow you to narrow down the query scope by dividing a vector space into subspaces through clustering or random sampling. Before pre-build, you need to obtain all centroid vectors through clustering or random sampling. Centroid vectors are pre-built into a GRAPH or GRAPH_PQ index and then registered with the Elasticsearch cluster. All nodes in the cluster can share this index. Reuse of the centroid index among shards can effectively reduce the training overhead and the number of centroid index queries, improving write and query performance.</p>
<ol id="EN-US_TOPIC_0000002319559898__ol13172153674611"><li id="EN-US_TOPIC_0000002319559898__en-us_topic_0000001268154521_li6012554340">Create a centroid index.<p id="EN-US_TOPIC_0000002319559898__p164311817181115"><a name="EN-US_TOPIC_0000002319559898__en-us_topic_0000001268154521_li6012554340"></a><a name="en-us_topic_0000001268154521_li6012554340"></a>For example, run the following command on Kibana to create a centroid index named <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue17575534161118"><b>my_dict</b></span>:</p>
<pre class="screen" id="EN-US_TOPIC_0000002319559898__screen13912142913014">PUT my_dict
{
"settings": {
"index": {
"vector": true
},
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"properties": {
"my_vector": {
"type": "vector",
"dimension": 2,
"indexing": true,
"algorithm": "GRAPH",
"metric": "euclidean"
}
}
}
}</pre>
<div class="p" id="EN-US_TOPIC_0000002319559898__p255233013315">For detailed parameter configuration, see <a href="#EN-US_TOPIC_0000002319559898__en-us_topic_0000001309709789_section137344225249">Creating a Vector Index</a>. Pay attention to the following mandatory parameters:<ul id="EN-US_TOPIC_0000002319559898__ul13622924191116"><li id="EN-US_TOPIC_0000002319559898__li14622202414115"><strong id="EN-US_TOPIC_0000002319559898__b1779532912482">index.number_of_shards</strong>: The number of index shards must be set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue16861414171117"><b>1</b></span>. Otherwise, the centroid index cannot be registered.</li><li id="EN-US_TOPIC_0000002319559898__li1752055491115"><strong id="EN-US_TOPIC_0000002319559898__b846925054913">indexing</strong>: This parameter must be set to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue1050396161212"><b>true</b></span> to enable vector index acceleration.</li><li id="EN-US_TOPIC_0000002319559898__li4302165911315"><strong id="EN-US_TOPIC_0000002319559898__b967735415498">algorithm</strong>: Set the indexing algorithm. Set it to <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue77661435121515"><b>GRAPH</b></span> for the IVF_GRAPH algorithm, and GRAPH_PQ if the IVF_GRAPH_PQ algorithm is used.</li></ul>
</div>
</li><li id="EN-US_TOPIC_0000002319559898__li47651935101411">Write centroid vectors to the created index. Write the centroid vectors obtained through sampling or clustering into the newly created index <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue1552918204155"><b>my_dict</b></span>.</li><li id="EN-US_TOPIC_0000002319559898__li12569182513161">Call the registration API.<p id="EN-US_TOPIC_0000002319559898__p20245172720170"><a name="EN-US_TOPIC_0000002319559898__li12569182513161"></a><a name="li12569182513161"></a>Run the following command on Kibana to register the centroid index as a Dict object with a globally unique name (<strong id="EN-US_TOPIC_0000002319559898__b32331916125316">dict_name</strong>):</p>
<pre class="screen" id="EN-US_TOPIC_0000002319559898__screen5245427171711">PUT _vector/register/my_dict
{
"dict_name": "my_dict"
}</pre>
</li><li id="EN-US_TOPIC_0000002319559898__li15751123416162">Create an IVF_GRAPH or IVF_GRAPH_PQ vector index.<p id="EN-US_TOPIC_0000002319559898__p33716716454"><a name="EN-US_TOPIC_0000002319559898__li15751123416162"></a><a name="li15751123416162"></a>When creating the vector index, you do not need to specify <strong id="EN-US_TOPIC_0000002319559898__b1772411325416">dimension</strong> or <strong id="EN-US_TOPIC_0000002319559898__b1428381895414">metric</strong>. Rather, you specify the registered Dict object. <a href="#EN-US_TOPIC_0000002319559898__table3711163717243">Table 5</a> describes key parameters for specifying a Dict object. For details about other parameters, see <a href="#EN-US_TOPIC_0000002319559898__en-us_topic_0000001309709789_section137344225249">Creating a Vector Index</a>.</p>
<p id="EN-US_TOPIC_0000002319559898__p79515305195">For example, run the following command to create an IVF_GRAPH vector index:</p>
<pre class="screen" id="EN-US_TOPIC_0000002319559898__screen7162121882411">PUT my_index
{
"settings": {
"index": {
"vector": true,
"sort.field": "my_vector.centroid" # Set the centroid subfield of each vector field as a ranking field.
}
},
"mappings": {
"properties": {
"my_vector": {
"type": "vector",
"indexing": true,
"algorithm": "IVF_GRAPH",
<strong id="EN-US_TOPIC_0000002319559898__b763755244717"> "dict_name": "my_dict", </strong>
<strong id="EN-US_TOPIC_0000002319559898__b1763925224719"> "offload_ivf": true </strong>
}
}
}
}</pre>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002319559898__table3711163717243"></a><a name="table3711163717243"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002319559898__table3711163717243" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Field mappings parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002319559898__row47123370244"><th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.4.4.4.4.2.5.1.1"><p id="EN-US_TOPIC_0000002319559898__p0712113716246">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.000000000000002%" id="mcps1.3.4.4.4.4.2.5.1.2"><p id="EN-US_TOPIC_0000002319559898__p169365154477">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.4.4.4.4.2.5.1.3"><p id="EN-US_TOPIC_0000002319559898__p432613161473">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="48%" id="mcps1.3.4.4.4.4.2.5.1.4"><p id="EN-US_TOPIC_0000002319559898__p1871283772412">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002319559898__row571293719243"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.4.4.4.4.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p8712143719245">dict_name</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.4.4.4.4.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p199361415144718">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.4.4.4.4.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p1632618169477">String</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.4.4.4.4.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p2712123713243">Name of the centroid index. For example, <span class="parmvalue" id="EN-US_TOPIC_0000002319559898__parmvalue18271636112"><b>my_dict</b></span>. The vector dimensions and metrics of the index must be the same as those of the Dict index.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002319559898__row14712143717248"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.4.4.4.4.2.5.1.1 "><p id="EN-US_TOPIC_0000002319559898__p171223762413">offload_ivf</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.4.4.4.4.2.5.1.2 "><p id="EN-US_TOPIC_0000002319559898__p1936141511472">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.4.4.4.4.2.5.1.3 "><p id="EN-US_TOPIC_0000002319559898__p2032611165472">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.4.4.4.4.2.5.1.4 "><p id="EN-US_TOPIC_0000002319559898__p113941855319">Whether to offload the IVF inverted index to Elasticsearch.</p>
<div class="p" id="EN-US_TOPIC_0000002319559898__p57121837132413">Value: <strong id="EN-US_TOPIC_0000002319559898__b181098030710176">true</strong> or <strong id="EN-US_TOPIC_0000002319559898__b50190822610176">false</strong>.<ul id="EN-US_TOPIC_0000002319559898__ul15334141313315"><li id="EN-US_TOPIC_0000002319559898__li183343133314"><strong id="EN-US_TOPIC_0000002319559898__b94283429272">true</strong> (recommended value): Offloads the IVF inverted index implemented by the underlying index to Elasticsearch. This reduces the use of off-heap memory and the overhead of write and merge operations.</li><li id="EN-US_TOPIC_0000002319559898__li1633416131132"><strong id="EN-US_TOPIC_0000002319559898__b763333822716">false</strong> (default value): Not to offload the IVF inverted index.</li></ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0117.html">Configuring Vector Search for Elasticsearch Clusters</a></div>
</div>
</div>