doc-exports/docs/css/umn/css_01_0123.html
Wuwan, Qi 050b395397 CSS UMN 23.2.1 20230926
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-committed-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
2024-01-10 14:23:15 +00:00

298 lines
22 KiB
HTML

<a name="css_01_0123"></a><a name="css_01_0123"></a>
<h1 class="topictitle1">Querying Vectors</h1>
<div id="body0000001245354483"><div class="section" id="css_01_0123__en-us_topic_0000001268154489_section344710865418"><h4 class="sectiontitle">Standard Query</h4><p id="css_01_0123__en-us_topic_0000001268154489_p10699133014548">Standard vector query syntax is provided for vector fields with vector indexes. The following command will return <em id="css_01_0123__en-us_topic_0000001268154489_i6193191024117">n</em> (specified by <strong id="css_01_0123__en-us_topic_0000001268154489_b524152410413">size</strong>/<strong id="css_01_0123__en-us_topic_0000001268154489_b7169626174118">topk</strong>) data records that are most close to the query vector.</p>
<pre class="screen" id="css_01_0123__en-us_topic_0000001268154489_screen1466920229569">POST my_index/_search
{
"size":2,
"_source": false,
"query": {
"vector": {
"my_vector": {
"vector": [1, 1],
"topk":2
}
}
}
}</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0123__en-us_topic_0000001268154489_table112016411577" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters for standard query</caption><thead align="left"><tr id="css_01_0123__en-us_topic_0000001268154489_row120119417572"><th align="left" class="cellrowborder" valign="top" width="24.12%" id="mcps1.3.1.4.2.3.1.1"><p id="css_01_0123__en-us_topic_0000001268154489_p152017415713">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="75.88000000000001%" id="mcps1.3.1.4.2.3.1.2"><p id="css_01_0123__en-us_topic_0000001268154489_p02013445711">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_01_0123__en-us_topic_0000001268154489_row1420184205713"><td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.1.4.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p102012475715">vector (the first one)</p>
</td>
<td class="cellrowborder" valign="top" width="75.88000000000001%" headers="mcps1.3.1.4.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p6201742577">Indicates that the query type is <strong id="css_01_0123__en-us_topic_0000001268154489_b257724474217">VectorQuery</strong>.</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row1120194155720"><td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.1.4.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p42011645578">my_vector</p>
</td>
<td class="cellrowborder" valign="top" width="75.88000000000001%" headers="mcps1.3.1.4.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p920110435711">Indicates the name of the vector field you want to query.</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row39015465716"><td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.1.4.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p17901854135712">vector (the second one)</p>
</td>
<td class="cellrowborder" valign="top" width="75.88000000000001%" headers="mcps1.3.1.4.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p290145445715">Indicates the vector value you want to query, which can be an array or a Base64 string</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row0480125417579"><td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.1.4.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p24811654135718">topk</p>
</td>
<td class="cellrowborder" valign="top" width="75.88000000000001%" headers="mcps1.3.1.4.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p11481554155712">Same as the value of <strong id="css_01_0123__en-us_topic_0000001268154489_b560421614493">size</strong> generally.</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row1271143335915"><td class="cellrowborder" valign="top" width="24.12%" headers="mcps1.3.1.4.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p971133385920"><a href="#css_01_0123__en-us_topic_0000001268154489_table172381842595">Table 2</a></p>
</td>
<td class="cellrowborder" valign="top" width="75.88000000000001%" headers="mcps1.3.1.4.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p27143355918">Indicates optional query parameters. You can adjust the vector index parameters to achieve higher query performance or precision.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="css_01_0123__en-us_topic_0000001268154489_table172381842595"></a><a name="en-us_topic_0000001268154489_table172381842595"></a><table cellpadding="4" cellspacing="0" summary="" id="css_01_0123__en-us_topic_0000001268154489_table172381842595" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Optional query parameters</caption><thead align="left"><tr id="css_01_0123__en-us_topic_0000001268154489_row223811465915"><th align="left" class="cellrowborder" valign="top" width="15.15%" id="mcps1.3.1.5.2.4.1.1"><p id="css_01_0123__en-us_topic_0000001268154489_p17238114195911">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.46%" id="mcps1.3.1.5.2.4.1.2"><p id="css_01_0123__en-us_topic_0000001268154489_p19238194195920">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60.39%" id="mcps1.3.1.5.2.4.1.3"><p id="css_01_0123__en-us_topic_0000001268154489_p182381943596">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_01_0123__en-us_topic_0000001268154489_row623816413595"><td class="cellrowborder" rowspan="2" valign="top" width="15.15%" headers="mcps1.3.1.5.2.4.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p523844115912">Graph index configuration parameters</p>
</td>
<td class="cellrowborder" valign="top" width="24.46%" headers="mcps1.3.1.5.2.4.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p1723812465912">ef</p>
</td>
<td class="cellrowborder" valign="top" width="60.39%" headers="mcps1.3.1.5.2.4.1.3 "><p id="css_01_0123__en-us_topic_0000001268154489_p174132034174514">Queue size of the neighboring node during the query. A larger value indicates a higher query precision and slower query speed. The default value is <strong id="css_01_0123__en-us_topic_0000001268154489_b7905614124620">200</strong>.</p>
<p id="css_01_0123__en-us_topic_0000001268154489_p12238249592">Value range: (0, 100000]</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row9238341594"><td class="cellrowborder" valign="top" headers="mcps1.3.1.5.2.4.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p102381543592">max_scan_num</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.1.5.2.4.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p1502203510457">Maximum number of scanned nodes. A larger value indicates a higher query precision and slower query speed. The default value is <strong id="css_01_0123__en-us_topic_0000001268154489_b11210116477">10000</strong>.</p>
<p id="css_01_0123__en-us_topic_0000001268154489_p15239184195911">Value range: (0, 1000000]</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row2023913425914"><td class="cellrowborder" valign="top" width="15.15%" headers="mcps1.3.1.5.2.4.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p15239124155914">IVF index configuration parameters</p>
</td>
<td class="cellrowborder" valign="top" width="24.46%" headers="mcps1.3.1.5.2.4.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p12239164185913">nprobe</p>
</td>
<td class="cellrowborder" valign="top" width="60.39%" headers="mcps1.3.1.5.2.4.1.3 "><p id="css_01_0123__en-us_topic_0000001268154489_p11820136184520">Number of center points. A larger value indicates a higher query precision and slower query speed. The default value is <strong id="css_01_0123__en-us_topic_0000001268154489_b265764411479">100</strong>.</p>
<p id="css_01_0123__en-us_topic_0000001268154489_p142399412593">Value range: (0, 100000]</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="css_01_0123__en-us_topic_0000001268154489_section102341611718"><h4 class="sectiontitle">Compound Query</h4><p id="css_01_0123__en-us_topic_0000001268154489_p364401311819">Vector search can be used together with other Elasticsearch subqueries, such as Boolean query and post-filtering, for compound query.</p>
<p id="css_01_0123__en-us_topic_0000001268154489_p56045118417">In the following two examples, top 10 (<strong id="css_01_0123__en-us_topic_0000001268154489_b811313115145">topk</strong>) results closest to the query vector are queried first. <strong id="css_01_0123__en-us_topic_0000001268154489_b1237654816519">filter</strong> retains only the results whose <strong id="css_01_0123__en-us_topic_0000001268154489_b14577846617">my_label</strong> field is <strong id="css_01_0123__en-us_topic_0000001268154489_b11671616165">red</strong>.</p>
<ul id="css_01_0123__en-us_topic_0000001268154489_ul136443131682"><li id="css_01_0123__en-us_topic_0000001268154489_li36446139815">Example of a Boolean query<pre class="screen" id="css_01_0123__en-us_topic_0000001268154489_screen6703123515212">POST my_index/_search
{
"size": 10,
"query": {
"bool": {
"must": {
"vector": {
"my_vector": {
"vector": [1, 2],
"topk": 10
}
}
},
"filter": {
"term": { "my_label": "red" }
}
}
}
}</pre>
</li><li id="css_01_0123__en-us_topic_0000001268154489_li26447138816">Example of post-filtering<pre class="screen" id="css_01_0123__en-us_topic_0000001268154489_screen36446137818">GET my_index/_search
{
"size": 10,
"query": {
"vector": {
"my_vector": {
"vector": [1, 2],
"topk": 10
}
}
},
"post_filter": {
"term": { "my_label": "red" }
}
}</pre>
</li></ul>
</div>
<div class="section" id="css_01_0123__en-us_topic_0000001268154489_section4946246546"><h4 class="sectiontitle">ScriptScore Query</h4><p id="css_01_0123__en-us_topic_0000001268154489_p191338162050">You can use <strong id="css_01_0123__en-us_topic_0000001268154489_b10212131312154">script_score</strong> to perform Nearest Neighbor Search (NSS) on vectors. The query syntax is provided below.</p>
<p id="css_01_0123__en-us_topic_0000001268154489_p1512359042">The pre-filtering condition can be any query. <strong id="css_01_0123__en-us_topic_0000001268154489_b11388750131013">script_score</strong> traverses only the pre-filtered results, calculates the vector similarity, and sorts and returns the results. The performance of this query depends on the size of the intermediate result set after the pre-filtering. If the pre-filtering condition is set to <strong id="css_01_0123__en-us_topic_0000001268154489_b11385181114112">match_all</strong>, brute-force search is performed on all data.</p>
<pre class="screen" id="css_01_0123__en-us_topic_0000001268154489_screen3512185915411">POST my_index/_search
{
"size":2,
"query": {
"script_score": {
"query": {
"match_all": {}
},
"script": {
"source": "vector_score",
"lang": "vector",
"params": {
"field": "my_vector",
"vector": [1.0, 2.0],
"metric": "euclidean"
}
}
}
}
}</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0123__en-us_topic_0000001268154489_table95121659546" frame="border" border="1" rules="all"><caption><b>Table 3 </b>script_score parameters</caption><thead align="left"><tr id="css_01_0123__en-us_topic_0000001268154489_row1451214594419"><th align="left" class="cellrowborder" valign="top" width="30.3%" id="mcps1.3.3.5.2.3.1.1"><p id="css_01_0123__en-us_topic_0000001268154489_p551216591840">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="69.69999999999999%" id="mcps1.3.3.5.2.3.1.2"><p id="css_01_0123__en-us_topic_0000001268154489_p105128591413">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_01_0123__en-us_topic_0000001268154489_row135121591243"><td class="cellrowborder" valign="top" width="30.3%" headers="mcps1.3.3.5.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p651218591747">source</p>
</td>
<td class="cellrowborder" valign="top" width="69.69999999999999%" headers="mcps1.3.3.5.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p1351225910417">Script description. Its value is <strong id="css_01_0123__en-us_topic_0000001268154489_b247465910117">vector_score</strong> if the vector similarity is used for scoring.</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row175123599411"><td class="cellrowborder" valign="top" width="30.3%" headers="mcps1.3.3.5.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p75121759143">lang</p>
</td>
<td class="cellrowborder" valign="top" width="69.69999999999999%" headers="mcps1.3.3.5.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p1651235910417">Script syntax description. Its value is <strong id="css_01_0123__en-us_topic_0000001268154489_b187361212623">vector</strong>.</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row1651219599413"><td class="cellrowborder" valign="top" width="30.3%" headers="mcps1.3.3.5.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p1451211592047">field</p>
</td>
<td class="cellrowborder" valign="top" width="69.69999999999999%" headers="mcps1.3.3.5.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p1351218596418">Vector field name</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row1551285917417"><td class="cellrowborder" valign="top" width="30.3%" headers="mcps1.3.3.5.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p165129591342">vector</p>
</td>
<td class="cellrowborder" valign="top" width="69.69999999999999%" headers="mcps1.3.3.5.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p16512195915416">Vector data to be queried</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row751218591947"><td class="cellrowborder" valign="top" width="30.3%" headers="mcps1.3.3.5.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p18512659244">metric</p>
</td>
<td class="cellrowborder" valign="top" width="69.69999999999999%" headers="mcps1.3.3.5.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p75126591544">Measurement method, which can be <strong id="css_01_0123__en-us_topic_0000001268154489_b8193126124912">euclidean</strong>, <strong id="css_01_0123__en-us_topic_0000001268154489_b184521131114911">inner_product</strong>, <strong id="css_01_0123__en-us_topic_0000001268154489_b392818339492">cosine</strong>, and <strong id="css_01_0123__en-us_topic_0000001268154489_b6805153644910">hamming</strong>.</p>
<p id="css_01_0123__en-us_topic_0000001268154489_p35122592420">Default value: <strong id="css_01_0123__en-us_topic_0000001268154489_b47131738114915">euclidean</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="css_01_0123__en-us_topic_0000001268154489_section107953451661"><h4 class="sectiontitle">Re-Score Query</h4><p id="css_01_0123__en-us_topic_0000001268154489_p147213301172">If the <strong id="css_01_0123__en-us_topic_0000001268154489_b19947215207">GRAPH_PQ</strong> or <strong id="css_01_0123__en-us_topic_0000001268154489_b16658223132017">IVF_GRAPH_PQ</strong> index is used, the query results are sorted based on the asymmetric distance calculated by PQ. CSS supports re-scoring and ranking of query results to improve the recall rate.</p>
<p id="css_01_0123__en-us_topic_0000001268154489_p1567411217323">Assuming that <strong id="css_01_0123__en-us_topic_0000001268154489_b8942142419315">my_index</strong> is a PQ index, an example of re-scoring the query results is as follows:</p>
<pre class="screen" id="css_01_0123__en-us_topic_0000001268154489_screen1639814155510">GET my_index/_search
{
"size": 10,
"query": {
"vector": {
"my_vector": {
"vector": [1.0, 2.0],
"topk": 100
}
}
},
"rescore": {
"window_size": 100,
"vector_rescore": {
"field": "my_vector",
"vector": [1.0, 2.0],
"metric": "euclidean"
}
}
}</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0123__en-us_topic_0000001268154489_table165271512103218" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Rescore parameter description</caption><thead align="left"><tr id="css_01_0123__en-us_topic_0000001268154489_row96748123320"><th align="left" class="cellrowborder" valign="top" width="30.3%" id="mcps1.3.4.5.2.3.1.1"><p id="css_01_0123__en-us_topic_0000001268154489_p467481273214">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="69.69999999999999%" id="mcps1.3.4.5.2.3.1.2"><p id="css_01_0123__en-us_topic_0000001268154489_p7674111213212">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_01_0123__en-us_topic_0000001268154489_row4674161215326"><td class="cellrowborder" valign="top" width="30.3%" headers="mcps1.3.4.5.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p136741112123210">window_size</p>
</td>
<td class="cellrowborder" valign="top" width="69.69999999999999%" headers="mcps1.3.4.5.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p116742129325">Vector retrieval returns <em id="css_01_0123__en-us_topic_0000001268154489_i1196913103618">topk</em> search results and ranks the first <em id="css_01_0123__en-us_topic_0000001268154489_i3963141519619">window_size</em> results.</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row19674612133213"><td class="cellrowborder" valign="top" width="30.3%" headers="mcps1.3.4.5.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p16674171213212">field</p>
</td>
<td class="cellrowborder" valign="top" width="69.69999999999999%" headers="mcps1.3.4.5.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p667431253217">Vector field name</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row6674151212329"><td class="cellrowborder" valign="top" width="30.3%" headers="mcps1.3.4.5.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p14674171273210">vector</p>
</td>
<td class="cellrowborder" valign="top" width="69.69999999999999%" headers="mcps1.3.4.5.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p176748125322">Vector data to be queried</p>
</td>
</tr>
<tr id="css_01_0123__en-us_topic_0000001268154489_row7674121216327"><td class="cellrowborder" valign="top" width="30.3%" headers="mcps1.3.4.5.2.3.1.1 "><p id="css_01_0123__en-us_topic_0000001268154489_p167419129328">metric</p>
</td>
<td class="cellrowborder" valign="top" width="69.69999999999999%" headers="mcps1.3.4.5.2.3.1.2 "><p id="css_01_0123__en-us_topic_0000001268154489_p1767451253213">Measurement method, which can be <strong id="css_01_0123__en-us_topic_0000001268154489_b1555915506358">euclidean</strong>, <strong id="css_01_0123__en-us_topic_0000001268154489_b156085018355">inner_product</strong>, <strong id="css_01_0123__en-us_topic_0000001268154489_b1556018501357">cosine</strong>, and <strong id="css_01_0123__en-us_topic_0000001268154489_b175601850103512">hamming</strong>.</p>
<p id="css_01_0123__en-us_topic_0000001268154489_p5674131217326">Default value: <strong id="css_01_0123__en-us_topic_0000001268154489_b761714314614">euclidean</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="css_01_0123__section102071126171611"><h4 class="sectiontitle">Painless Syntax Extension</h4><p id="css_01_0123__p177861335101615">CSS extension supports multiple vector distance calculation functions, which can be directly used in customized painless scripts to build flexible re-score formulas.</p>
<p id="css_01_0123__p18965620112713">The following is an example:</p>
<pre class="screen" id="css_01_0123__screen11315195710305">POST my_index/_search
{
"size": 10,
"query": {
"script_score": {
"query": {
"match_all": {}
},
"script": {
"source": "1 / (1 + euclidean(params.vector, doc[params.field]))",
"params": {
"field": "my_vector",
"vector": [1, 2]
}
}
}
}
}</pre>
<p id="css_01_0123__p51518357321">The following table lists the distance calculation functions supported by the CSS.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0123__table17610185023516" frame="border" border="1" rules="all"><thead align="left"><tr id="css_01_0123__row461012507354"><th align="left" class="cellrowborder" valign="top" width="34.32%" id="mcps1.3.5.6.1.3.1.1"><p id="css_01_0123__p196101850203512">Function Signature</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="65.68%" id="mcps1.3.5.6.1.3.1.2"><p id="css_01_0123__p1061095020358">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_01_0123__row1261045014357"><td class="cellrowborder" valign="top" width="34.32%" headers="mcps1.3.5.6.1.3.1.1 "><p id="css_01_0123__p13610450103520">euclidean(Float[], DocValues)</p>
</td>
<td class="cellrowborder" valign="top" width="65.68%" headers="mcps1.3.5.6.1.3.1.2 "><p id="css_01_0123__p2610125033511">Euclidean distance function</p>
</td>
</tr>
<tr id="css_01_0123__row961085053513"><td class="cellrowborder" valign="top" width="34.32%" headers="mcps1.3.5.6.1.3.1.1 "><p id="css_01_0123__p1610205014351">cosine(Float[], DocValues)</p>
</td>
<td class="cellrowborder" valign="top" width="65.68%" headers="mcps1.3.5.6.1.3.1.2 "><p id="css_01_0123__p6610750143515">Cosine similarity function</p>
</td>
</tr>
<tr id="css_01_0123__row1961015501351"><td class="cellrowborder" valign="top" width="34.32%" headers="mcps1.3.5.6.1.3.1.1 "><p id="css_01_0123__p46101950163517">innerproduct(Float[], DocValues)</p>
</td>
<td class="cellrowborder" valign="top" width="65.68%" headers="mcps1.3.5.6.1.3.1.2 "><p id="css_01_0123__p461015012354">Inner product function</p>
</td>
</tr>
<tr id="css_01_0123__row98852044174013"><td class="cellrowborder" valign="top" width="34.32%" headers="mcps1.3.5.6.1.3.1.1 "><p id="css_01_0123__p13885174412404">hamming(String, DocValues)</p>
</td>
<td class="cellrowborder" valign="top" width="65.68%" headers="mcps1.3.5.6.1.3.1.2 "><p id="css_01_0123__p18852044114019">Hamming distance function Only vectors whose <strong id="css_01_0123__b144391029103117">dim_type</strong> is <strong id="css_01_0123__b9490931163116">binary</strong> are supported. The input query vector must be a Base64-encoded character string.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0117.html">Vector Retrieval</a></div>
</div>
</div>