diff --git a/modules/search/partials/nav.adoc b/modules/search/partials/nav.adoc index 5573ffeab..aa3236a50 100644 --- a/modules/search/partials/nav.adoc +++ b/modules/search/partials/nav.adoc @@ -1,69 +1,69 @@ -* xref:8.0@server:search:search.adoc[] - ** xref:8.0@server:search:create-search-indexes.adoc[] - *** xref:8.0@server:search:create-search-index-ui.adoc[] - *** xref:8.0@server:search:create-search-index-rest-api.adoc[] - **** xref:8.0@server:search:search-index-params.adoc[] - *** xref:8.0@server:search:create-quick-index.adoc[] - **** xref:8.0@server:search:quick-index-field-options.adoc[] - **** xref:8.0@server:search:field-data-types-reference.adoc[] - **** xref:8.0@server:search:quick-index-supported-languages.adoc[] - **** xref:8.0@server:search:synonyms/synonyms-search-quick.adoc[] - ***** xref:8.0@server:search:synonyms/create-synonym-collection-docs-quick.adoc[] - ***** xref:8.0@server:search:synonyms/add-synonym-source-quick.adoc[] - *** xref:8.0@server:search:import-search-index.adoc[] - ** xref:8.0@server:search:view-index-details.adoc[] - ** xref:8.0@server:search:run-searches.adoc[] - *** xref:8.0@server:search:simple-search-ui.adoc[] - *** xref:8.0@server:search:geo-search-ui.adoc[] - *** xref:8.0@server:search:simple-search-rest-api.adoc[] - **** xref:8.0@server:search:search-request-params.adoc[] - **** xref:8.0@server:fts:fts-search-response.adoc[Search Response] - *** xref:8.0@server:search:geo-search-rest-api.adoc[] - ** xref:8.0@server:search:search-query-auto-complete.adoc[] - *** xref:8.0@server:search:search-query-auto-complete-ui.adoc[] - *** xref:8.0@server:search:search-query-auto-complete-code.adoc[] - ** xref:8.0@server:search:index-aliases.adoc[] - *** xref:8.0@server:search:create-search-index-alias.adoc[] - *** xref:8.0@server:search:create-search-index-alias-rest-api.adoc[] - ** xref:8.0@server:search:customize-index.adoc[] - *** xref:8.0@server:search:set-type-identifier.adoc[] - *** xref:8.0@server:search:create-type-mapping.adoc[] - *** xref:8.0@server:search:create-child-field.adoc[] - **** xref:8.0@server:search:child-field-options-reference.adoc[] - *** xref:8.0@server:search:create-child-mapping.adoc[] - *** xref:8.0@server:search:create-xattrs-mapping.adoc[] - *** xref:8.0@server:search:create-custom-analyzer.adoc[] - *** xref:8.0@server:search:create-custom-character-filter.adoc[] - *** xref:8.0@server:search:create-custom-tokenizer.adoc[] - *** xref:8.0@server:search:create-custom-token-filter.adoc[] - *** xref:8.0@server:search:create-custom-wordlist.adoc[] - *** xref:8.0@server:search:create-custom-date-time-parser.adoc[] - *** xref:8.0@server:search:synonyms/synonyms-search.adoc[] - **** xref:8.0@server:search:synonyms/create-synonym-collection-docs.adoc[] - **** xref:8.0@server:search:synonyms/add-synonym-source.adoc[] - *** xref:8.0@server:search:set-advanced-settings.adoc[] - *** xref:8.0@server:search:default-analyzers-reference.adoc[] - *** xref:8.0@server:search:default-character-filters-reference.adoc[] - *** xref:8.0@server:search:default-date-time-parsers-reference.adoc[] - *** xref:8.0@server:search:default-token-filters-reference.adoc[] - *** xref:8.0@server:search:default-tokenizers-reference.adoc[] - *** xref:8.0@server:search:default-wordlists-reference.adoc[] - *** xref:8.0@server:search:field-data-types-reference.adoc[] - *** xref:8.0@server:search:date-time-parser-layout-styles.adoc[] - ** xref:8.0@server:fts:fts-high-availability-for-search.adoc[High Availability for Search] - ** xref:8.0@server:fts:fts-architecture.adoc[Search Service Architecture] - *** xref:8.0@server:fts:fts-architecture-scatter-gather.adoc[Scatter Gather] - *** xref:8.0@server:fts:fts-architecture-ports-used.adoc[Ports Used By FTS] - *** xref:8.0@server:fts:fts-rebalance-failover.adoc[Rebalance/Failover] - ** xref:8.0@server:fts:fts-cluster-options.adoc[Cluster Level Options] - *** xref:8.0@server:fts:fts-advanced-settings-bleveMaxResultWindow.adoc[bleveMaxResultWindow] - *** xref:8.0@server:fts:fts-advanced-settings-bleveMaxClauseCount.adoc[bleveMaxClauseCount] - *** xref:8.0@server:fts:fts-advanced-settings-maxFeedsPerDCPAgent.adoc[maxFeedsPerDCPAgent] - *** xref:8.0@server:fts:fts-advance-settings-maxConcurrentPartitionMovesPerNode.adoc[maxConcurrentPartitionMovesPerNode] - *** xref:8.0@server:fts:fts-advanced-settings-enableVerboseLogging.adoc[enableVerboseLogging] - *** xref:8.0@server:fts:fts-advanced-settings-ftsMemoryQuota.adoc[ftsMemoryQuota] - *** xref:8.0@server:fts:fts-advanced-settings-maxReplicasAllowed.adoc[maxReplicasAllowed] - *** xref:8.0@server:fts:fts-advanced-settings-slowQueryLogTimeout.adoc[slowQueryLogTimeout] - *** xref:8.0@server:fts:fts-advanced-settings-CBFT-ENV-OPTIONS.adoc[CBFT_ENV_OPTIONS] - ** xref:8.0@server:fts:fts-monitor.adoc[Statistics and Monitoring] - ** xref:8.0@server:fts:fts-troubleshooting.adoc[Troubleshooting and FAQs] +* xref:search:search.adoc[] + ** xref:search:create-search-indexes.adoc[] + *** xref:search:create-search-index-ui.adoc[] + *** xref:search:create-search-index-rest-api.adoc[] + **** xref:search:search-index-params.adoc[] + *** xref:search:create-quick-index.adoc[] + **** xref:search:quick-index-field-options.adoc[] + **** xref:search:field-data-types-reference.adoc[] + **** xref:search:quick-index-supported-languages.adoc[] + **** xref:search:synonyms/synonyms-search-quick.adoc[] + ***** xref:search:synonyms/create-synonym-collection-docs-quick.adoc[] + ***** xref:search:synonyms/add-synonym-source-quick.adoc[] + *** xref:search:import-search-index.adoc[] + ** xref:search:view-index-details.adoc[] + ** xref:search:run-searches.adoc[] + *** xref:search:simple-search-ui.adoc[] + *** xref:search:geo-search-ui.adoc[] + *** xref:search:simple-search-rest-api.adoc[] + **** xref:search:search-request-params.adoc[] + **** xref:fts:fts-search-response.adoc[Search Response] + *** xref:search:geo-search-rest-api.adoc[] + ** xref:search:search-query-auto-complete.adoc[] + *** xref:search:search-query-auto-complete-ui.adoc[] + *** xref:search:search-query-auto-complete-code.adoc[] + ** xref:search:index-aliases.adoc[] + *** xref:search:create-search-index-alias.adoc[] + *** xref:search:create-search-index-alias-rest-api.adoc[] + ** xref:search:customize-index.adoc[] + *** xref:search:set-type-identifier.adoc[] + *** xref:search:create-type-mapping.adoc[] + *** xref:search:create-child-field.adoc[] + **** xref:search:child-field-options-reference.adoc[] + *** xref:search:create-child-mapping.adoc[] + *** xref:search:create-xattrs-mapping.adoc[] + *** xref:search:create-custom-analyzer.adoc[] + *** xref:search:create-custom-character-filter.adoc[] + *** xref:search:create-custom-tokenizer.adoc[] + *** xref:search:create-custom-token-filter.adoc[] + *** xref:search:create-custom-wordlist.adoc[] + *** xref:search:create-custom-date-time-parser.adoc[] + *** xref:search:synonyms/synonyms-search.adoc[] + **** xref:search:synonyms/create-synonym-collection-docs.adoc[] + **** xref:search:synonyms/add-synonym-source.adoc[] + *** xref:search:set-advanced-settings.adoc[] + *** xref:search:default-analyzers-reference.adoc[] + *** xref:search:default-character-filters-reference.adoc[] + *** xref:search:default-date-time-parsers-reference.adoc[] + *** xref:search:default-token-filters-reference.adoc[] + *** xref:search:default-tokenizers-reference.adoc[] + *** xref:search:default-wordlists-reference.adoc[] + *** xref:search:field-data-types-reference.adoc[] + *** xref:search:date-time-parser-layout-styles.adoc[] + ** xref:fts:fts-high-availability-for-search.adoc[High Availability for Search] + ** xref:fts:fts-architecture.adoc[Search Service Architecture] + *** xref:fts:fts-architecture-scatter-gather.adoc[Scatter Gather] + *** xref:fts:fts-architecture-ports-used.adoc[Ports Used By FTS] + *** xref:fts:fts-rebalance-failover.adoc[Rebalance/Failover] + ** xref:fts:fts-cluster-options.adoc[Cluster Level Options] + *** xref:fts:fts-advanced-settings-bleveMaxResultWindow.adoc[bleveMaxResultWindow] + *** xref:fts:fts-advanced-settings-bleveMaxClauseCount.adoc[bleveMaxClauseCount] + *** xref:fts:fts-advanced-settings-maxFeedsPerDCPAgent.adoc[maxFeedsPerDCPAgent] + *** xref:fts:fts-advance-settings-maxConcurrentPartitionMovesPerNode.adoc[maxConcurrentPartitionMovesPerNode] + *** xref:fts:fts-advanced-settings-enableVerboseLogging.adoc[enableVerboseLogging] + *** xref:fts:fts-advanced-settings-ftsMemoryQuota.adoc[ftsMemoryQuota] + *** xref:fts:fts-advanced-settings-maxReplicasAllowed.adoc[maxReplicasAllowed] + *** xref:fts:fts-advanced-settings-slowQueryLogTimeout.adoc[slowQueryLogTimeout] + *** xref:fts:fts-advanced-settings-CBFT-ENV-OPTIONS.adoc[CBFT_ENV_OPTIONS] + ** xref:fts:fts-monitor.adoc[Statistics and Monitoring] + ** xref:fts:fts-troubleshooting.adoc[Troubleshooting and FAQs] diff --git a/modules/vector-index/assets/images/cosine-similarity-example.svg b/modules/vector-index/assets/images/cosine-similarity-example.svg new file mode 100644 index 000000000..3c88ede3c --- /dev/null +++ b/modules/vector-index/assets/images/cosine-similarity-example.svg @@ -0,0 +1,1097 @@ + + + + + + + + 2025-01-16T14:23:50.569388 + image/svg+xml + + + Matplotlib v3.10.0, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/vector-index/assets/images/dot-product-example.svg b/modules/vector-index/assets/images/dot-product-example.svg new file mode 100644 index 000000000..e43e36c59 --- /dev/null +++ b/modules/vector-index/assets/images/dot-product-example.svg @@ -0,0 +1,1462 @@ + + + + + + + + 2025-01-16T11:01:53.235124 + image/svg+xml + + + Matplotlib v3.10.0, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/vector-index/assets/images/embedding-vectors.svg b/modules/vector-index/assets/images/embedding-vectors.svg new file mode 100644 index 000000000..bdfc5c963 --- /dev/null +++ b/modules/vector-index/assets/images/embedding-vectors.svg @@ -0,0 +1,443 @@ + + + +’Twas brillig, and the slithy toves + Did gyre and gimble in the wabe: +All mimsy were the borogoves, + And the mome raths outgrabe. + +“Beware the Jabberwock, my son! + The jaws that bite, the claws that catch! +Beware the Jubjub bird, and shun + The frumious Bandersnatch!” DataEmbedding ModelsVectors +all-MiniLM-L6-v2Resnet50OpenL3[ -3.3394, -2.3334, -3.0436, -3.3161, -1.9979, ... ][ -0.34820265, 0.6125417 -0.13429512, 0.25497625, ... ][ 0.00599869 -0.0045266 -0.0341841 -0.04532388 -0.03882601, ... ]TextImageAudio diff --git a/modules/vector-index/assets/images/euclidean-distance-example.svg b/modules/vector-index/assets/images/euclidean-distance-example.svg new file mode 100644 index 000000000..2727227de --- /dev/null +++ b/modules/vector-index/assets/images/euclidean-distance-example.svg @@ -0,0 +1,1185 @@ + + + + + + + + 2025-01-15T15:53:22.729761 + image/svg+xml + + + Matplotlib v3.10.0, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/vector-index/assets/images/euclidean-example.svg b/modules/vector-index/assets/images/euclidean-example.svg new file mode 100644 index 000000000..a797a01a0 --- /dev/null +++ b/modules/vector-index/assets/images/euclidean-example.svg @@ -0,0 +1,779 @@ + + + + + + + + 2025-01-15T13:58:48.604022 + image/svg+xml + + + Matplotlib v3.10.0, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/vector-index/assets/images/hypserscale-w-scalar-plan.svg b/modules/vector-index/assets/images/hypserscale-w-scalar-plan.svg new file mode 100644 index 000000000..d97f91b3a --- /dev/null +++ b/modules/vector-index/assets/images/hypserscale-w-scalar-plan.svg @@ -0,0 +1,1101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Main Query + + + + + + + + Sub Queries + + + + + + + + Stream + 00:00.002 (9.3%) + 3 in / 3 out + + + + + + Subquery + select raw ((((`rgb-questions`.`cou... + + + + + + + Limit + 3 + 00:00.000 + 3 in / 3 out + + + + + Collect + 1 in + + + + + + + Project + 3 terms + 00:00.000 (0.2%) + 3 in / 3 out + + + + + Project + 1 terms + 1 in / 1 out + + + + + + Filter + (170 < (`b`.`brightness`)) + 00:00.000 (0.1%) + 3 in / 3 out + + + + + Filter + ((meta(`rgb-questions`).`id`) = "#8... + 1 in / 1 out + + + + + + Fetch + rgb as b + 00:00.003 (12.3%) + 3 in / 3 out + + + + + Fetch + rgb-questions + 1 in / 1 out + + + + + + IndexScan3 + rgb.color_desc_hyperscale_brightnes... + as: b + 3 + 00:00.022 (77%) + + + + IndexScan3 + rgb-questions.#sequentialscan + 1 in / 1 out + + + + + + With + 00:00.000 (1.2%) + + + + + + + Authorize + 00:00.000 + + + + + + + + + + + + + + + + diff --git a/modules/vector-index/assets/images/ivf-centroid-diagram.png b/modules/vector-index/assets/images/ivf-centroid-diagram.png new file mode 100644 index 000000000..d31cd36cf Binary files /dev/null and b/modules/vector-index/assets/images/ivf-centroid-diagram.png differ diff --git a/modules/vector-index/assets/images/ivf-centroid-diagram.svg b/modules/vector-index/assets/images/ivf-centroid-diagram.svg new file mode 100644 index 000000000..b5fa25b68 --- /dev/null +++ b/modules/vector-index/assets/images/ivf-centroid-diagram.svg @@ -0,0 +1,174743 @@ + + + + + + + + 2025-01-21T11:22:36.926818 + image/svg+xml + + + Matplotlib v3.10.0, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/vector-index/assets/images/ivf-diagram-with-vectors.svg b/modules/vector-index/assets/images/ivf-diagram-with-vectors.svg new file mode 100644 index 000000000..2aab94227 --- /dev/null +++ b/modules/vector-index/assets/images/ivf-diagram-with-vectors.svg @@ -0,0 +1,773 @@ + + + +Inverted File[0.6112, 0.8848, 0.8647, ... ][0.7873, 0.5196, 0.7417, ... ][0.7582, 0.1887, 0.3127, ... ]Centroids[0.5310, 0.8713, 0.9366, ... ][0.6948, 0.8841, 0.9403, ... ][0.6086, 0.8479, 0.9275, ... ] ... [0.9351, 0.4427, 0.6946, ... ][0.9070, 0.3921, 0.8074, ... ][0.6943, 0.3971, 0.6288, ... ] ... [0.5971, 0.3632, 0.2923, ... ][0.9355, 0.3466, 0.3779, ... ][0.6862, 0.0993, 0.4445, ... ] ... Vectors diff --git a/modules/vector-index/assets/images/pq-centroid-diagram.png b/modules/vector-index/assets/images/pq-centroid-diagram.png new file mode 100644 index 000000000..2b3761f65 Binary files /dev/null and b/modules/vector-index/assets/images/pq-centroid-diagram.png differ diff --git a/modules/vector-index/assets/images/pq-centroid-diagram.svg b/modules/vector-index/assets/images/pq-centroid-diagram.svg new file mode 100644 index 000000000..9c7fe7304 --- /dev/null +++ b/modules/vector-index/assets/images/pq-centroid-diagram.svg @@ -0,0 +1,174443 @@ + + + + + + + + 2025-01-21T14:44:37.531670 + image/svg+xml + + + Matplotlib v3.10.0, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/vector-index/assets/images/pq-diagram.svg b/modules/vector-index/assets/images/pq-diagram.svg new file mode 100644 index 000000000..dc9892172 --- /dev/null +++ b/modules/vector-index/assets/images/pq-diagram.svg @@ -0,0 +1,1432 @@ + + + +1Subspace 1Subspace 2Subspace X. . .[0.2113, 0.3594, ..., 0.1787, 0.7915, 0.1175, ..., 0.2543, [0.6404, 0.3555, ..., 0.2011, 0.8088, 0.1800, ..., 0.2837,0.8855, 0.6129, ..., 0.1616][0.6502, 0.6809, ..., 0.8088, 0.5766, 0.2704, ..., 0.4346, 0.1050, 0.8578, ..., 0.6275]. . .0.9007, 0.0672, ..., 0.2275]. . .Subspace 1Subspace 2Subspace X. . .. . .134214. . .CentroidIndex[0.6212, 0.6790, ..., 0.8101 ]1[0.7873, 0.5196, 0.7417, ... ]2[0.7582, 0.1887, 0.3127, ... ]3Codebook[0.6212, 0.6790, ..., 0.8101 ][0.7873, 0.5196, 0.7417, ... ][0.7582, 0.1887, 0.3127, ... ]CentroidIndex123Codebook1485314. . .11162102. . .Product QuantizationRaw VectorsQuantized Vectors diff --git a/modules/vector-index/assets/images/sq-diagram.svg b/modules/vector-index/assets/images/sq-diagram.svg new file mode 100644 index 000000000..c4ef0deda --- /dev/null +++ b/modules/vector-index/assets/images/sq-diagram.svg @@ -0,0 +1,1288 @@ + + + +1. . .[162,[60,[10,57,241,19,...]...]...]. . .Scalar QuantizationRaw VectorsQuantized Vectors[0.0421, 0.1594, ...] [0.2404, 0.8555, ...][0.6502, 0.2809, ...] . . .. . .0 0.0021 0.0000 - 0.0040 1 0.0067 0.0041 - 0.0080 Bin #CentroidDimensionValue Range162 0.6507 0.6480 - 0.6520 163 0.6534 0.6521 - 0.6560 . . .. . .CentroidBin#DimensionValue Range0 0.1016 0.1000 - 0.1031 1 0.1049 0.1032 - 0.1063 57 0.2799 0.2781 - 0.2812 58 0.2831 0.2813 - 0.2844 diff --git a/modules/vector-index/assets/images/vector-space-example.svg b/modules/vector-index/assets/images/vector-space-example.svg new file mode 100644 index 000000000..cdf4d3bd5 --- /dev/null +++ b/modules/vector-index/assets/images/vector-space-example.svg @@ -0,0 +1,1411 @@ + + + + + + + + 2025-01-15T13:56:45.816393 + image/svg+xml + + + Matplotlib v3.10.0, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/vector-index/assets/source/draw-centroid-ivf-diagram.py b/modules/vector-index/assets/source/draw-centroid-ivf-diagram.py new file mode 100644 index 000000000..0e80e3de0 --- /dev/null +++ b/modules/vector-index/assets/source/draw-centroid-ivf-diagram.py @@ -0,0 +1,86 @@ +# Illustrates how euclidean distance works +import matplotlib.pyplot as plt +from mpl_toolkits.mplot3d import Axes3D +from matplotlib.patches import FancyArrowPatch +from mpl_toolkits.mplot3d.proj3d import proj_transform +import numpy as np +import random + + +# Draws a cluster of random points around a point in space, labels the center with a star, and draws a +# sphere around the area. +def draw_cluster(x, y, z, color, dist=0.4, numpoints=10): + point_list = '' + # Draw some random points around the area + my_xs = [] + my_ys = [] + my_zs = [] + for point in range(numpoints): + my_x = random.uniform(x-dist, x+dist) + my_y = random.uniform(y-dist, y+dist) + my_z = random.uniform(z-dist, z+dist) + ax.scatter(my_x, my_y, my_z, color=color, s=20, alpha=0.8, edgecolors='black') + point_list += f' {point}: [{my_x:.4f}, {my_y:.4f}, {my_z:.4f}]\n' + my_xs.append(my_x) + my_ys.append(my_y) + my_zs.append(my_z) + + # Find center of all random points getting average of points + cx = np.mean(my_xs) + cy = np.mean(my_ys) + cz = np.mean(my_zs) + + # Plot centroid as a star + ax.scatter(cx, cy, cz, color=color, marker='*', s=100, edgecolors='black') + + # Draw a sphere to highlight the area + radius = dist + 0.1 + u = np.linspace(0, 2 * np.pi, 100) + v = np.linspace(0, np.pi, 100) + sx = radius * np.outer(np.cos(u), np.sin(v)) + cx + sy = radius * np.outer(np.sin(u), np.sin(v)) + cy + sz = radius * np.outer(np.ones(np.size(u)), np.cos(v)) + cz + # Add the sphere as a transparent surface + ax.plot_surface(sx, sy, sz, color=color, alpha=0.2) + point_list = f'centroid [{cx:.4f}, {cy:.4f}, {cz:.4f}] ({color})\n' + point_list + return point_list + +# Set up the 3D plot +fig = plt.figure(figsize=(12, 6)) +ax = fig.add_subplot(111, projection='3d') + +# Move the 3D plot to the left +ax.set_position([0.05, 0.1, 0.5, 0.8]) # [left, bottom, width, height] + +# Adjust size of 3d plot +fig.subplots_adjust(left=0.0, right=0.5, top=0.9, bottom=0.1) + +point_list = 'All points:\n' + +# Call to create a bunch of regions +point_list += draw_cluster(0.8, 0.5, 0.7, 'red', 0.15, 20) +point_list += draw_cluster(0.1, 0.1, 0.5, 'blue', 0.1, 20) +point_list += draw_cluster(0.75, 0.2, 0.3, 'green', 0.2, 30) +point_list += draw_cluster(0.2, 0.8, 0.6, 'orange', 0.15, 20) +point_list += draw_cluster(0.1, 0.7, 0.15, 'purple', 0.1, 10) +point_list += draw_cluster(0.25, 0.3, 0.1, 'maroon', 0.1, 10) +point_list += draw_cluster(0.6, 0.9, 0.85, 'cyan', 0.1, 10) + +print(point_list) + +# Set axis limits for better visibility +ax.set_xlim(0, 1) +ax.set_ylim(0, 1) +ax.set_zlim(0, 1) + +# Suppress numeric labels +ax.set_xticklabels([]) +ax.set_yticklabels([]) +ax.set_zticklabels([]) + + +# Show plot + +plt.savefig('ivf-centroid-diagram.svg') # Save as an image +plt.savefig('ivf-centroid-diagram.png') # Save as an image +plt.show() \ No newline at end of file diff --git a/modules/vector-index/assets/source/draw-centroid-pq-diagram.py b/modules/vector-index/assets/source/draw-centroid-pq-diagram.py new file mode 100644 index 000000000..44c30455c --- /dev/null +++ b/modules/vector-index/assets/source/draw-centroid-pq-diagram.py @@ -0,0 +1,86 @@ +# Illustrates how euclidean distance works +import matplotlib.pyplot as plt +from mpl_toolkits.mplot3d import Axes3D +from matplotlib.patches import FancyArrowPatch +from mpl_toolkits.mplot3d.proj3d import proj_transform +import numpy as np +import random + + +# Draws a cluster of random points around a point in space, labels the center with a star, and draws a +# sphere around the area. +def draw_cluster(x, y, z, color, dist=0.4, numpoints=10): + point_list = '' + # Draw some random points around the area + my_xs = [] + my_ys = [] + my_zs = [] + for point in range(numpoints): + my_x = random.uniform(x-dist, x+dist) + my_y = random.uniform(y-dist, y+dist) + my_z = random.uniform(z-dist, z+dist) + ax.scatter(my_x, my_y, my_z, color=color, s=40, alpha=0.8) + point_list += f' {point}: [{my_x:.4f}, {my_y:.4f}, {my_z:.4f}]\n' + my_xs.append(my_x) + my_ys.append(my_y) + my_zs.append(my_z) + + # Find center of all random points getting average of points + cx = np.mean(my_xs) + cy = np.mean(my_ys) + cz = np.mean(my_zs) + + # Plot centroid as a star + ax.scatter(cx, cy, cz, color=color, marker='*', s=100, edgecolors='black') + + # Draw a sphere to highlight the area + radius = dist + 0.1 + u = np.linspace(0, 2 * np.pi, 100) + v = np.linspace(0, np.pi, 100) + sx = radius * np.outer(np.cos(u), np.sin(v)) + cx + sy = radius * np.outer(np.sin(u), np.sin(v)) + cy + sz = radius * np.outer(np.ones(np.size(u)), np.cos(v)) + cz + # Add the sphere as a transparent surface + ax.plot_surface(sx, sy, sz, color=color, alpha=0.2) + point_list = f'centroid [{cx:.4f}, {cy:.4f}, {cz:.4f}] ({color})\n' + point_list + return point_list + +# Set up the 3D plot +fig = plt.figure(figsize=(12, 6)) +ax = fig.add_subplot(111, projection='3d') + +# Move the 3D plot to the left +ax.set_position([0.05, 0.1, 0.5, 0.8]) # [left, bottom, width, height] + +# Adjust size of 3d plot +fig.subplots_adjust(left=0.0, right=0.5, top=0.9, bottom=0.1) + +point_list = 'All points:\n' + +# Call to create a bunch of regions +point_list += draw_cluster(0.8, 0.5, 0.7, 'red', 0.15, 10) +point_list += draw_cluster(0.1, 0.1, 0.5, 'blue', 0.1, 10) +point_list += draw_cluster(0.75, 0.2, 0.3, 'green', 0.2, 15) +point_list += draw_cluster(0.2, 0.8, 0.6, 'orange', 0.15, 10) +point_list += draw_cluster(0.1, 0.7, 0.15, 'purple', 0.1, 5) +point_list += draw_cluster(0.25, 0.3, 0.1, 'maroon', 0.1, 5) +point_list += draw_cluster(0.6, 0.9, 0.85, 'cyan', 0.1, 5) + +print(point_list) + +# Set axis limits for better visibility +ax.set_xlim(0, 1) +ax.set_ylim(0, 1) +ax.set_zlim(0, 1) + +# Suppress numeric labels +ax.set_xticklabels([]) +ax.set_yticklabels([]) +ax.set_zticklabels([]) + + +# Show plot + +plt.savefig('pq-centroid-diagram.svg') # Save as an image +plt.savefig('pq-centroid-diagram.png') # Save as an image +plt.show() \ No newline at end of file diff --git a/modules/vector-index/assets/source/draw-cosine-diagram.py b/modules/vector-index/assets/source/draw-cosine-diagram.py new file mode 100644 index 000000000..9aa892bbc --- /dev/null +++ b/modules/vector-index/assets/source/draw-cosine-diagram.py @@ -0,0 +1,155 @@ +import matplotlib.pyplot as plt +import numpy as np + + +def calculate_midpoint(origin, vector): + """ + Calculate the midpoint of a vector given an origin. + + Parameters: + origin (array-like): The coordinates of the origin (x, y, z). + vector (array-like): The components of the vector (vx, vy, vz). + + Returns: + numpy array: The coordinates of the midpoint. + """ + origin = np.array(origin) + vector = np.array(vector) + endpoint = origin + vector + midpoint = (origin + endpoint) / 2 + return midpoint + + +def calculate_endpoint(origin, vector): + """ + Calculate the midpoint of a vector given an origin. + + Parameters: + origin (array-like): The coordinates of the origin (x, y, z). + vector (array-like): The components of the vector (vx, vy, vz). + + Returns: + numpy array: The coordinates of the midpoint. + """ + origin = np.array(origin) + vector = np.array(vector) + endpoint = origin + vector + return endpoint + +def vector_magnitude(origin, vector): + # Convert origin and vector to numpy arrays + origin = np.array(origin) + vector = np.array(vector) + + # Calculate the difference between the origin and vector + diff = vector - origin + + # Calculate the magnitude (Euclidean distance) + magnitude = np.linalg.norm(diff) + + return magnitude + +def normalize(vector, origin=None): + if origin is not None: + # Subtract origin from the vector + vector = np.array(vector) - np.array(origin) + # Calculate the magnitude of the vector + magnitude = np.linalg.norm(vector) + # Normalize the vector + return vector / magnitude + +# Define two vectors in 3D space +v1 = np.array([2, 3, 5]) +v2 = np.array([6, 4, 6]) + +v1_origin = np.array([0, 0, 0]) +v2_origin = np.array([1, 0, 0]) + +v1_norm = normalize(v1, v1_origin) +v2_norm = normalize(v2, v2_origin) + +# Define two points in 3D space +#point1 = np.array([2, 3, 5]) +#point2 = np.array([6, 7, 2]) +point1 = calculate_endpoint(v1_origin, v1_norm) +point2 = calculate_endpoint(v2_origin, v2_norm) + + +# Compute a vector from point1 to point2 +vector = point2 - point1 +midpoint = (point1 + point2) / 2 + +# Find a perpendicular vector (normal to the line connecting the two points) +arbitrary_vector = np.array([1, 0, 0]) if vector[0] == 0 else np.array([0, 1, 0]) +normal_vector = np.cross(vector, arbitrary_vector).astype(float) # Convert to float +normal_vector /= np.linalg.norm(normal_vector) # Normalize the normal vector + +# Control the "height" of the arc (smaller values for a shallower arc) +arc_height = 0.5 + +# Generate points on the arc +t = np.linspace(0, 1, 100) +arc_points = (1 - t)[:, None] * point1 + t[:, None] * point2 + arc_height * np.sin(np.pi * t)[:, None] * normal_vector + +# Set up the plot +fig = plt.figure() +ax = fig.add_subplot(111, projection='3d') + +# Plot the vectors +ax.quiver(0, 0, 0, v1_norm[0], v1_norm[1], v1_norm[2], color='b', linewidth=2) +ax.quiver(1, 0, 0, v2_norm[0], v2_norm[1], v2_norm[2], color='r', linewidth=2) + +# Plot the original points +ax.scatter(*point1, color='b', s=100) +ax.scatter(*point2, color='r', s=100) + +# Plot the arc +ax.plot3D(arc_points[:, 0], arc_points[:, 1], arc_points[:, 2], 'g', linestyle='dotted', linewidth=2) + +# Label the arc +ax.text(*midpoint, r'$\theta$', color='k', fontsize=14) + +# Move the lables showing the vector magnitude a bit. +# text_offset = np.array([-1.3, 0, 2]) + +# Add vector magnitudes +#ax.text(*(point1 + text_offset), r'$\left| \mathbf{v_1} \right| = $' + "{:.2f}".format(vector_magnitude(v1_origin, v1)), color='b', fontsize=14) + + +#ax.text(*(point2 + text_offset), r'$\left| \mathbf{v_2} \right| = $' + "{:.2f}".format(vector_magnitude(v2_origin, v2)), color='r', fontsize=14) + + + + +# Set axis limits and labels +ax.set_xlim(0, 2) +ax.set_ylim(0, 2) +ax.set_zlim(0, 2) + +# The values on the axes were too close together, so this will filter out +# half of them. + +# Get the current ticks +x_ticks = ax.get_xticks() +y_ticks = ax.get_yticks() +z_ticks = ax.get_zticks() + +# Filter the ticks to show every other tick +x_ticks_custom = x_ticks[::2] +y_ticks_custom = y_ticks[::2] +z_ticks_custom = z_ticks[::2] + +# Set the custom ticks +ax.set_xticks(x_ticks_custom) +ax.set_yticks(y_ticks_custom) +ax.set_zticks(z_ticks_custom) + + +ax.set_xlabel('X-axis') +ax.set_ylabel('Y-axis') +ax.set_zlabel('Z-axis') +ax.set_title('Cosine Similarity') + +# Show plot +#plt.show() +plt.savefig('cosine-similarity-example.svg') # Save as an image diff --git a/modules/vector-index/assets/source/draw-dot-product-diagram.py b/modules/vector-index/assets/source/draw-dot-product-diagram.py new file mode 100644 index 000000000..11a8f0df4 --- /dev/null +++ b/modules/vector-index/assets/source/draw-dot-product-diagram.py @@ -0,0 +1,125 @@ +import matplotlib.pyplot as plt +import numpy as np + + +def calculate_midpoint(origin, vector): + """ + Calculate the midpoint of a vector given an origin. + + Parameters: + origin (array-like): The coordinates of the origin (x, y, z). + vector (array-like): The components of the vector (vx, vy, vz). + + Returns: + numpy array: The coordinates of the midpoint. + """ + origin = np.array(origin) + vector = np.array(vector) + endpoint = origin + vector + midpoint = (origin + endpoint) / 2 + return midpoint + + +def calculate_endpoint(origin, vector): + """ + Calculate the midpoint of a vector given an origin. + + Parameters: + origin (array-like): The coordinates of the origin (x, y, z). + vector (array-like): The components of the vector (vx, vy, vz). + + Returns: + numpy array: The coordinates of the midpoint. + """ + origin = np.array(origin) + vector = np.array(vector) + endpoint = origin + vector + return endpoint + +def vector_magnitude(origin, vector): + # Convert origin and vector to numpy arrays + origin = np.array(origin) + vector = np.array(vector) + + # Calculate the difference between the origin and vector + diff = vector - origin + + # Calculate the magnitude (Euclidean distance) + magnitude = np.linalg.norm(diff) + + return magnitude + +# Define two vectors in 3D space +v1 = np.array([2, 3, 5]) +v2 = np.array([6, 4, 6]) + +v1_origin = np.array([0, 0, 0]) +v2_origin = np.array([1, 0, 0]) + + + +# Define two points in 3D space +#point1 = np.array([2, 3, 5]) +#point2 = np.array([6, 7, 2]) +point1 = calculate_endpoint(v1_origin, v1) +point2 = calculate_endpoint(v2_origin, v2) + +midpoint1 = calculate_midpoint(v1_origin, v1) +midpoint2 = calculate_midpoint(v2_origin, v2) + + +# Compute a vector from point1 to point2 +vector = point2 - point1 +midpoint = (point1 + point2) / 2 + +# Find a perpendicular vector (normal to the line connecting the two points) +arbitrary_vector = np.array([1, 0, 0]) if vector[0] == 0 else np.array([0, 1, 0]) +normal_vector = np.cross(vector, arbitrary_vector).astype(float) # Convert to float +normal_vector /= np.linalg.norm(normal_vector) # Normalize the normal vector + +# Control the "height" of the arc (smaller values for a shallower arc) +arc_height = 1 + +# Generate points on the arc +t = np.linspace(0, 1, 100) +arc_points = (1 - t)[:, None] * point1 + t[:, None] * point2 + arc_height * np.sin(np.pi * t)[:, None] * normal_vector + +# Set up the plot +fig = plt.figure() +ax = fig.add_subplot(111, projection='3d') + +# Plot the vectors +ax.quiver(0, 0, 0, v1[0], v1[1], v1[2], color='b', linewidth=2) +ax.quiver(1, 0, 0, v2[0], v2[1], v2[2], color='r', linewidth=2) + +# Plot the original points +ax.scatter(*point1, color='b', s=100) +ax.scatter(*point2, color='r', s=100) + +# Plot the arc +ax.plot3D(arc_points[:, 0], arc_points[:, 1], arc_points[:, 2], 'g', linestyle='dotted', linewidth=2) + +# Label the arc +ax.text(*midpoint, r'$\theta$', color='k', fontsize=14) + +# Move the lables showing the vector magnitude a bit. +text_offset = np.array([-1.3, 0, 2]) + +# Add vector magnitudes +ax.text(*(point1 + text_offset), r'$\left| \mathbf{v_1} \right| = $' + "{:.2f}".format(vector_magnitude(v1_origin, v1)), color='b', fontsize=14) + + +ax.text(*(point2 + text_offset), r'$\left| \mathbf{v_2} \right| = $' + "{:.2f}".format(vector_magnitude(v2_origin, v2)), color='r', fontsize=14) + +# Set axis limits and labels +ax.set_xlim(0, 8) +ax.set_ylim(0, 8) +ax.set_zlim(0, 8) +ax.set_xlabel('X-axis') +ax.set_ylabel('Y-axis') +ax.set_zlabel('Z-axis') +ax.set_title('Dot Product') + +# Show plot +# plt.show() +plt.savefig('dot-product-example.svg') # Save as an image diff --git a/modules/vector-index/assets/source/draw-euclidean-distance-diagram.py b/modules/vector-index/assets/source/draw-euclidean-distance-diagram.py new file mode 100644 index 000000000..3f2dbdda4 --- /dev/null +++ b/modules/vector-index/assets/source/draw-euclidean-distance-diagram.py @@ -0,0 +1,67 @@ +# Illustrates how euclidean distance works +import matplotlib.pyplot as plt +from mpl_toolkits.mplot3d import Axes3D +import numpy as np + +# Define two vectors in 3D space +v1 = np.array([2, 3, 5]) +v2 = np.array([6, 4, 6]) + +v1_one_third = (1/3) * v1 +v2_one_third = (1/3) * v2 + +v1_two_third = (2/3) * v1 +v2_two_third = (2/3) * v2 + + + +# Set up the 3D plot +fig = plt.figure(figsize=(10, 7)) +ax = fig.add_subplot(111, projection='3d') + +# Plot the vectors +ax.quiver(0, 0, 0, v1[0], v1[1], v1[2], color='b', linewidth=2) +ax.quiver(1, 1, 1, v2[0], v2[1], v2[2], color='r', linewidth=2) + +# Plot points +ax.scatter(0,0,0, color='r', s=100) +ax.scatter(1,1,1, color='r', s=100) + +ax.scatter(v1_one_third[0],v1_one_third[1],v1_one_third[2], color='r', s=100) +ax.scatter(v2_one_third[0]+1,v2_one_third[1]+1,v2_one_third[2]+1, color='r', s=100) + +ax.scatter(v1_two_third[0],v1_two_third[1],v1_two_third[2], color='r', s=100) +ax.scatter(v2_two_third[0]+1,v2_two_third[1]+1,v2_two_third[2]+1, color='r', s=100) + +# Draw dotted lines connecting corresponding points on the two vectors + +ax.plot([0,1], [0,1], [0,1], linestyle='dotted', color='k') + +ax.plot([v1_one_third[0], v2_one_third[0]+1], [v1_one_third[1], v2_one_third[1]+1], [v1_one_third[2], v2_one_third[2]+1], linestyle='dotted', color='k') + +ax.plot([v1_two_third[0], v2_two_third[0]+1], [v1_two_third[1], v2_two_third[1]+1], [v1_two_third[2], v2_two_third[2]+1], linestyle='dotted', color='k') + + + +#ax.plot([v1[0], v2[0]], [v1[1], v1[1]], [v1[2], v1[2]], linestyle='dotted', color='k') # X-axis difference +#ax.plot([v2[0], v2[0]], [v1[1], v2[1]], [v1[2], v1[2]], linestyle='dotted', color='k') # Y-axis difference +#ax.plot([v2[0], v2[0]], [v2[1], v2[1]], [v1[2], v2[2]], linestyle='dotted', color='k') # Z-axis difference + +# Highlight the Euclidean distance with a line between the vector endpoints +ax.plot([v1[0], v2[0]+1], [v1[1], v2[1]+1], [v1[2], v2[2]+1], color='k', linestyle='dotted') + +# Set axis limits for better visibility +ax.set_xlim(0, 7) +ax.set_ylim(0, 7) +ax.set_zlim(0, 7) + +# Labels and title +ax.set_xlabel('X-axis') +ax.set_ylabel('Y-axis') +ax.set_zlabel('Z-axis') +ax.set_title('Euclidean Distance') +ax.legend() + +# Show plot +#plt.show() +plt.savefig('euclidean-distance-example.svg') # Save as an image \ No newline at end of file diff --git a/modules/vector-index/assets/source/draw-vector-space-diagram.py b/modules/vector-index/assets/source/draw-vector-space-diagram.py new file mode 100644 index 000000000..f53a75586 --- /dev/null +++ b/modules/vector-index/assets/source/draw-vector-space-diagram.py @@ -0,0 +1,41 @@ +# Script to generate the 3D vector diagram in +# This mainly came about because ChatGPT lied to me about Kroki supporting +# Matplotlib. It does not. Instead of throwing away the work to generate this +# diagram, I'll just check in the source code and include the SVG file in the document. +# +# If You need to update this diagram, you will need to install Python 3, numpy and +# matplotlib. On MacOS, this can be done via the brew command. + +import numpy as np +import matplotlib.pyplot as plt +from mpl_toolkits.mplot3d import Axes3D + +# Define the AI embedded vectors for feral cats, domestic cats, and Linux command line cat tool +feral_cats_vector = np.array([0.13, 0.21, 0.34]) +domestic_cats_vector = np.array([0.1, 0.27, 0.30]) +linux_cat_vector = np.array([0.4, 0.4, 0.3]) + +# Create a figure and a 3D axis +fig = plt.figure() +ax = fig.add_subplot(111, projection='3d') + +# Plot the vectors +ax.quiver(0, 0, 0.1, feral_cats_vector[0], feral_cats_vector[1], feral_cats_vector[2], color='indianred', label='Feral Cats') +ax.quiver(0, 0.1, 0, domestic_cats_vector[0], domestic_cats_vector[1], domestic_cats_vector[2], color='darkred', label='Domestic Cats') +ax.quiver(0.4, 0.3, 0.1, linux_cat_vector[0], linux_cat_vector[1], linux_cat_vector[2], color='green', label='Linux Cat Command') + +# Set the plot labels +ax.set_xlabel('X') +ax.set_ylabel('Y') +ax.set_zlabel('Z') + +# Set the plot limits +ax.set_xlim([0.0, 0.8]) +ax.set_ylim([0.0, 0.8]) +ax.set_zlim([0.0, 0.8]) + +# Add a legend +ax.legend() + +plt.savefig('vector-space-example.svg') # Save as an image +plt.close() diff --git a/modules/vector-index/examples/composite-vector-data.json b/modules/vector-index/examples/composite-vector-data.json new file mode 100644 index 000000000..95d494f73 --- /dev/null +++ b/modules/vector-index/examples/composite-vector-data.json @@ -0,0 +1,66 @@ +// tag::sample-doc[] +[{ + "brightness": 240.82, + "color": "papaya whip", + "colorvect_l2": [ + 255, + 239, + 213 + ], + "description": "Papaya whip is a soft and mellow color that can be + described as a light shade of peach or coral. It has + a calming and soothing effect, similar to the tropical + fruit it is named after. This color is perfect for + creating a warm and inviting atmosphere, and it pairs + well with other pastel shades or neutral tones. Papaya + whip is a versatile color that can be used in both fashion + and interior design, adding a touch of elegance and + sophistication to any space.", + "embedding_model": "text-embedding-ada-002-v2", + "embedding_vector_dot": [ + -0.014644118957221508, + 0.017003899440169334, + -0.013450744561851025, + 0.0021356006618589163, + "..." + ], + "id": "#FFEFD5", + "verbs": [ + "soften", + "mellow", + "lighten" + ], + "wheel_pos": "other" +}] +// end::sample-doc[] + +// tag::sample-doc-question[] +[{ + "couchbase_search_query": { + "fields": [ + "*" + ], + "knn": [{ + "field": "embedding_vector_dot", + "k": 3, + "vector": [ + 0.005115953739732504, + 0.004331615287810564, + 0.014279481954872608, + 0.000619320897385478, + "..." + ] + }], + "query": { + "match_none": {} + }, + "sort": [ + "-_score" + ] + }, + "embedding_model": "text-embedding-ada-002-v2", + "id": "#FFEFD5", + "question": "What is the name of the color that is reminiscent of a tropical fruit and has a calming effect, often used in fashion and interior design?", + "wanted_similar_color_from_search": "papaya whip" +}] +// end::sample-doc-question[] diff --git a/modules/vector-index/examples/find-reranking-cases.py b/modules/vector-index/examples/find-reranking-cases.py new file mode 100644 index 000000000..30fae2822 --- /dev/null +++ b/modules/vector-index/examples/find-reranking-cases.py @@ -0,0 +1,75 @@ +# This script just iterates over all of the colors in the example dataset to find cases +# where reranking improved the search results. + +import sys +from couchbase.cluster import Cluster, ClusterOptions +from couchbase.auth import PasswordAuthenticator +from couchbase.options import QueryOptions +from datetime import timedelta + + +# --- Configuration --- +COUCHBASE_URL = "couchbase://localhost" +USERNAME = "Administrator" +PASSWORD = "password" +BUCKET_NAME = "vector-sample" + +# --- Connect to Cluster --- +cluster = Cluster(COUCHBASE_URL, ClusterOptions(PasswordAuthenticator(USERNAME, PASSWORD))) +cluster.wait_until_ready(timedelta(seconds=10)) + +# --- Get all search-color IDs --- +get_ids_query = "SELECT META().id AS id FROM `vector-sample`.`color`.`rgb`" +search_colors = cluster.query(get_ids_query) +search_color_ids = [row["id"] for row in search_colors] + +# --- Function to run vector queries --- +def run_vector_query(search_color_id, use_rerank=False, limit=10): + rerank_str = "TRUE" if use_rerank else "FALSE" + query = f""" + WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "{search_color_id}") + SELECT b.color, b.description, b.id + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, question_vec[0], "l2", 4, {rerank_str}) + LIMIT {limit}; + """ + return list(cluster.query(query)) + +# --- Analyze and compare results --- +for search_color_id in search_color_ids: + # print(f"\n🔍 Search Color: {search_color_id}") + + try: + # Run both queries + results1 = run_vector_query(search_color_id, use_rerank=False) + results2 = run_vector_query(search_color_id, use_rerank=True) + except Exception as e: + print(f"⚠️ Query error for {search_color_id}: {e}") + continue + + ids1 = [doc["id"] for doc in results1] + ids2 = [doc["id"] for doc in results2] + + in_both = search_color_id in ids1 and search_color_id in ids2 + + if in_both: + idx1 = ids1.index(search_color_id) + idx2 = ids2.index(search_color_id) + if idx2 < idx1: + print(f"✅ Reranking improved rank for {search_color_id}: {idx1} ➜ {idx2}") + # sys.exit(0) + # else: + # print(f"→ No improvement (Rank: {idx1} ➜ {idx2})") + # else: + # if search_color_id in ids1: + # print("⚠️ Present only in first query, not in reranked results.") + # elif search_color_id in ids2: + # print("⚠️ Present only in reranked results, not in first query.") + # else: + # print("❌ Not present in either result set.") + +# --- Final Message --- +# print("\n❌ Reranking did not improve the rank of any search-color.") diff --git a/modules/vector-index/examples/gsi-vector-idx-examples.sqlpp b/modules/vector-index/examples/gsi-vector-idx-examples.sqlpp new file mode 100644 index 000000000..5cbd1303e --- /dev/null +++ b/modules/vector-index/examples/gsi-vector-idx-examples.sqlpp @@ -0,0 +1,3184 @@ +/* tag::get-sample-doc[] */ +SELECT RAW OBJECT_PUT(d, "embedding_vector_dot", + ARRAY_CONCAT(d.embedding_vector_dot[0:4], ["..."]) +) +FROM `vector-sample`.`color`.`rgb` AS d +USE KEYS ["#FFEFD5"]; +/* end::get-sample-doc[] */ + +/* tag::get-sample-doc-question[] */ +SELECT RAW OBJECT_PUT(d, "couchbase_search_query", + OBJECT_PUT(d.couchbase_search_query, "knn", + ARRAY OBJECT_PUT(k, "vector", + ARRAY_CONCAT(k.vector[0:4], ["..."]) + ) + FOR k IN d.couchbase_search_query.knn END + ) +) +FROM `vector-sample`.`color`.`rgb-questions` AS d +USE KEYS ["#FFEFD5"]; +/* end::get-sample-doc-question[] */ + + +/* tag::create-rgb-idx[] */ +CREATE INDEX `color_vectors_idx` ON `vector-sample`.`color`.`rgb` + (`colorvect_l2` VECTOR, color, brightness) + WITH { "dimension":3 , "similarity":"L2", "description":"IVF,SQ8"}; +/* end::create-rgb-idx[] */ + +/* tag::create-vectors-idx[] */ +CREATE INDEX `color_desc_idx` ON `vector-sample`.`color`.`rgb` + (`embedding_vector_dot` VECTOR, color, brightness) + WITH { "dimension":1536, "similarity":"DOT", "description":" IVF,SQ8" } +/* end::create-vectors-idx[] */ + +/* tag::query-rgb-idx[] */ +SELECT b.color, b.colorvect_l2, b.brightness from `rgb` AS b +ORDER BY APPROX_VECTOR_DISTANCE(b.colorvect_l2,[128,128,128],"L2") +LIMIT 5; +/* end::query-rgb-idx[] */ + +/* tag::query-rgb-idx-w-predicate[] */ +SELECT b.color, b.colorvect_l2, b.brightness from `rgb` AS b +WHERE b.brightness > 128 +ORDER BY APPROX_VECTOR_DISTANCE(b.colorvect_l2,[128,128,128],"L2") +LIMIT 5; +/* end::query-rgb-idx-w-predicate[] */ + +/* tag::query-vectors-idx-subquery[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + from `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#FFEFD5") +SELECT b.color, b.description from `rgb` AS b +order by APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, +question_vec[0], "DOT") LIMIT 3; +/* end::query-vectors-idx-subquery[] */ + +/* tag::query-vectors-idx-truncated[] */ +SELECT b.color, b.description from `rgb` AS b +order by APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, +[ + 0.005115953739732504, + 0.004331615287810564, + 0.014279481954872608, + /* long list of vector values omitted */ + -0.005022349301725626, + 0.002007648814469576, + -0.03757078945636749 + ], "DOT") LIMIT 3; +/* end::query-vectors-idx-truncated[] */ + +/* tag::query-vectors-idx-subquery-filtered[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + from `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#FFEFD5") +SELECT b.color, b.description, b.brightness from `rgb` AS b +WHERE b.brightness > 190.0 +order by APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, +question_vec[0], "DOT") LIMIT 3; +/* end::query-vectors-idx-subquery-filtered[] */ + +/* tag::query-vectors-idx-whole[] */ +SELECT b.color, b.description from `rgb` AS b +order by APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, +[ + 0.005115953739732504, + 0.004331615287810564, + 0.014279481954872608, + 0.000619320897385478, + 0.006700769532471895, + 0.018410978838801384, + -0.010367471724748611, + -0.019805356860160828, + 0.013059400022029877, + -0.011271236464381218, + -0.011251870542764664, + -0.004915834404528141, + -0.0031744735315442085, + 0.00843728892505169, + -0.01706824265420437, + 0.013362806290388107, + 0.04694411903619766, + 0.011258325539529324, + 0.01298193447291851, + -0.01080644316971302, + -0.01744265854358673, + 0.0044155362993478775, + -0.00742378132417798, + 0.014214927330613136, + -0.01248486340045929, + 0.0009481459856033325, + 0.027293693274259567, + -0.029204510152339935, + 0.006355402525514364, + 0.016254853457212448, + 0.02933361940085888, + -0.017352283000946045, + 0.007236572913825512, + -0.017094064503908157, + 0.002293302910402417, + -0.018139848485589027, + 0.007811109069734812, + 0.015028315596282482, + -0.008785883896052837, + -0.013453182764351368, + -8.422360406257212e-05, + 0.010896819643676281, + 0.002246500924229622, + -0.010586957447230816, + -0.0011482653208076954, + -0.003537593176588416, + 0.02017977461218834, + -0.013491915538907051, + -0.00977356918156147, + 0.01215563528239727, + 0.032122381031513214, + 0.02827492356300354, + 0.002995334332808852, + -0.027396980673074722, + 0.004583378322422504, + 0.0007577098440378904, + 0.00016683334251865745, + 0.025731472298502922, + 0.006158510688692331, + -0.008288813754916191, + 0.00016885067452676594, + 0.01956005021929741, + -0.01309813279658556, + 0.009934956207871437, + -0.007920851930975914, + 0.008721329271793365, + -0.032354775816202164, + -0.0031050771940499544, + -0.0049997554160654545, + 0.029178688302636147, + 0.0075980788096785545, + 0.024995548650622368, + 0.018165670335292816, + -0.008463110774755478, + 0.025292500853538513, + -0.0031518794130533934, + -0.01706824265420437, + -0.00925713311880827, + -0.013375717215240002, + 0.0066749476827681065, + 0.015144513919949532, + -0.0011805426329374313, + -0.037312570959329605, + 0.015092870220541954, + 0.01786871999502182, + 0.015002493746578693, + -0.020631656050682068, + 0.0021415995433926582, + -0.004912606440484524, + -0.004880329128354788, + -0.012523596175014973, + 0.024246715009212494, + 0.02413051761686802, + 0.0008162125013768673, + -0.02077367715537548, + 0.005419360473752022, + 0.008508299477398396, + 0.010470759123563766, + 0.0004575308703351766, + -0.01443441305309534, + -0.00852766539901495, + 0.017326461151242256, + -0.03674449026584625, + -0.009579905308783054, + -0.018643373623490334, + -0.0009473390528000891, + 0.00832109060138464, + -0.0016057961620390415, + 0.023614080622792244, + -0.024272536858916283, + -0.042502760887145996, + 0.03207073733210564, + 0.009534717537462711, + -0.041082561016082764, + -0.010651512071490288, + -0.01997319981455803, + 0.016306497156620026, + 0.015648040920495987, + -0.00894081499427557, + -0.03473038598895073, + -0.00884398352354765, + 0.018010739237070084, + 0.019004879519343376, + -0.015970813110470772, + 0.01914690062403679, + 0.0008166159386746585, + -0.006232748739421368, + -0.033568404614925385, + -0.03416230529546738, + -0.02494390495121479, + 0.02163870818912983, + 0.01701659895479679, + -0.004396169912070036, + 0.003786128479987383, + -0.008372734300792217, + 0.014563522301614285, + -0.01029646210372448, + 0.005622707307338715, + 0.010270640254020691, + 0.0004607586015481502, + 0.032096557319164276, + 0.021096449345350266, + -0.00034355162642896175, + -0.007966040633618832, + -0.004928745329380035, + 0.02806834876537323, + 0.010528858751058578, + 0.013349895365536213, + -0.006629759445786476, + -0.01913398876786232, + 0.02205185778439045, + -0.015480197966098785, + 0.02580893784761429, + 0.013362806290388107, + 0.010244818404316902, + 0.024246715009212494, + -0.0043122489005327225, + 0.0009594430448487401, + -0.02948855049908161, + 0.005044943653047085, + -0.004499457310885191, + -0.010373927652835846, + 0.0007040488417260349, + 0.012032981030642986, + 0.02039925940334797, + 0.02788759581744671, + 0.01807529479265213, + 0.008695507422089577, + 0.0015170335536822677, + 0.02059292420744896, + -0.012291199527680874, + 0.02706129662692547, + -0.009663826785981655, + 0.01101301796734333, + -0.013336984440684319, + 0.025705650448799133, + 0.006765324156731367, + 0.007197840139269829, + 0.024156339466571808, + -0.012975478544831276, + -0.03098621778190136, + -0.004870646167546511, + -0.000659667537547648, + -0.01186513900756836, + -0.007849842309951782, + -0.005797004792839289, + 0.022310076281428337, + -0.02099316194653511, + 0.0013346667401492596, + -0.011600465513765812, + -0.002236817730590701, + 0.020825320854783058, + 0.0010651513002812862, + -0.022826513275504112, + -0.6420344114303589, + 8.150020585162565e-05, + -0.014214927330613136, + -0.015841703861951828, + 0.02079949900507927, + 0.020205596461892128, + 0.037544965744018555, + 0.012265377677977085, + 0.0005870435852557421, + -0.01665509305894375, + 0.005919658578932285, + 0.013349895365536213, + 0.016577627509832382, + -0.01664218120276928, + 0.0006382837891578674, + -0.013969619758427143, + -0.017326461151242256, + -0.00033669269760139287, + -0.013027122244238853, + 0.00042283275979571044, + -0.00431870436295867, + 0.02161288633942604, + -0.007572256959974766, + 0.007262394763529301, + 0.019469672814011574, + 0.01372431218624115, + 0.001147458446212113, + -0.013479004614055157, + 0.014279481954872608, + 0.043587278574705124, + -0.027138762176036835, + 0.015118692070245743, + 8.61400694702752e-05, + 0.00968319270759821, + 0.04738309234380722, + 0.01579006016254425, + -0.026544859632849693, + 0.03506607189774513, + -0.022348809987306595, + 0.05510382354259491, + -0.01931474171578884, + 0.011671475134789944, + 0.02081240899860859, + -0.03098621778190136, + 0.0003318511007819325, + 0.021574154496192932, + 0.024272536858916283, + -0.015854615718126297, + 0.028378210961818695, + -0.015467287041246891, + 0.019689159467816353, + 0.005471004173159599, + 0.014718453399837017, + 0.0048641907051205635, + 0.00894081499427557, + 0.010845175944268703, + 0.030056631192564964, + -0.016538893803954124, + 0.012317021377384663, + 0.009366875514388084, + -0.003025997895747423, + 0.0029791956767439842, + -0.01434403657913208, + -0.019185632467269897, + -0.014976671896874905, + 0.03465292230248451, + -0.013788866810500622, + -0.013091676868498325, + -0.0024353230837732553, + -0.028791360557079315, + -0.005522647872567177, + -0.008630952797830105, + -0.02286524698138237, + 0.009418519213795662, + 0.00011145758617203683, + -0.0103932935744524, + 0.012342843227088451, + 0.017584679648280144, + -0.008288813754916191, + 0.009754203259944916, + 0.0016525982646271586, + -0.00712683005258441, + -0.005467776209115982, + 0.0034956326708197594, + 0.0353759340941906, + 0.013324073515832424, + -0.03535011038184166, + -0.04258022829890251, + 0.01322078611701727, + 0.011193770915269852, + 0.023756099864840508, + 0.030934574082493782, + 0.0018236680189147592, + -0.0009667054400779307, + -0.012588150799274445, + 0.003983020316809416, + -0.02369154617190361, + -0.015234890393912792, + -0.026299552991986275, + -0.007107463665306568, + 0.00779174268245697, + -0.015389821492135525, + -0.012310566380620003, + 0.008262991905212402, + 0.02664814703166485, + -0.0017284499481320381, + -0.0297467689961195, + 0.022607028484344482, + 0.023575346916913986, + -0.017326461151242256, + 0.020115219056606293, + -0.026751434430480003, + 0.0026580365374684334, + 0.003090552520006895, + 0.03596983477473259, + -0.02451784536242485, + 0.02471150830388069, + -0.003347157035022974, + -0.007533524185419083, + -0.02556362934410572, + 0.02933361940085888, + -0.013298251666128635, + -0.014279481954872608, + 0.007507702335715294, + 0.017571767792105675, + 0.00280489819124341, + -0.008424378000199795, + -0.0010514333844184875, + -0.0030469780322164297, + -0.0012862507719546556, + 0.021161004900932312, + -0.0022755505051463842, + -0.0011644039768725634, + 0.0031744735315442085, + -0.00047205566079355776, + -0.014576433226466179, + 0.004460724536329508, + -0.010031787678599358, + 0.008256535977125168, + -0.04513658955693245, + -0.019288919866085052, + -0.013233697041869164, + 0.00965091586112976, + 0.0026709474623203278, + -0.021884016692638397, + -0.03516935929656029, + -0.03281956911087036, + 0.008663230575621128, + -0.038784414529800415, + -0.010322283953428268, + -0.016474340111017227, + -0.013788866810500622, + -0.022568294778466225, + 0.03183833882212639, + 0.025834759697318077, + -0.0028807499911636114, + -0.02100607380270958, + -0.02249082922935486, + -0.01434403657913208, + -0.007365682162344456, + 0.01994737796485424, + 0.02972094714641571, + -0.008837527595460415, + -0.009457251988351345, + -0.013595202937722206, + -0.04121166840195656, + -0.009605727158486843, + 0.013111043721437454, + -0.010877453722059727, + -0.023368772119283676, + 0.012420308776199818, + -0.012820547446608543, + -0.006842789705842733, + 0.012523596175014973, + -0.005935797467827797, + 0.013646846637129784, + -0.006868611555546522, + -0.021264292299747467, + -0.002252956386655569, + -0.007681999821215868, + 0.00020627219055313617, + 0.009089291095733643, + -0.005713083781301975, + -0.005212785676121712, + 0.03496278449892998, + 0.001072413637302816, + 0.022090591490268707, + 0.07266268134117126, + -0.02431127056479454, + 0.032974500209093094, + -0.0030485920142382383, + 0.009289409965276718, + -0.01660344935953617, + 0.001254780450835824, + -0.01340153906494379, + 0.01103238482028246, + 0.010199629701673985, + -0.0026919275987893343, + -0.012142724357545376, + -0.005038488190621138, + 0.031709231436252594, + 0.023562436923384666, + 0.011781218461692333, + -0.003963653929531574, + 0.016164477914571762, + -0.02034761570394039, + 0.016745468601584435, + 0.0006649125716648996, + 0.008069328032433987, + 0.022168057039380074, + -0.0036215141881257296, + -0.03199326992034912, + -0.008366279304027557, + -0.014576433226466179, + 0.006668492220342159, + 0.0007762692985124886, + 0.00029594259103760123, + 0.010864542797207832, + -0.0174555703997612, + 0.013349895365536213, + 0.017984917387366295, + 0.010993652045726776, + 0.01976662501692772, + -0.013956708833575249, + -0.00499007198959589, + 0.007546435110270977, + 0.014498967677354813, + -0.0032164340373128653, + -0.01974080316722393, + -0.03395573049783707, + -0.013853421434760094, + -0.0065393829718232155, + -0.005961619317531586, + 0.0028016704600304365, + -0.005122409202158451, + 0.005061082076281309, + 0.01603536866605282, + -0.024595310911536217, + 0.03449799120426178, + 0.008217803202569485, + 0.01891450397670269, + 0.031683407723903656, + 0.005170824937522411, + 0.006481283809989691, + 0.04433611407876015, + -0.02637701854109764, + 0.0172231737524271, + 0.005474231671541929, + 0.0028710667975246906, + 0.0050417156890034676, + -0.026351196691393852, + -0.007681999821215868, + -0.04808028042316437, + 0.009780025109648705, + 0.011619831435382366, + -0.013982530683279037, + 0.014576433226466179, + -0.0004478476766962558, + 0.020864052698016167, + 0.017545945942401886, + 0.02428544871509075, + -0.019043613225221634, + 0.009986599907279015, + -0.01952131651341915, + 0.00379258394241333, + 0.008004773408174515, + 0.004909378942102194, + 0.003116374369710684, + -0.018785394728183746, + -0.008095149882137775, + 0.008701963350176811, + -0.0237173680216074, + 0.009082835167646408, + -0.02453075535595417, + -0.0049674781039357185, + 0.0127753596752882, + -0.003941059578210115, + -0.018165670335292816, + -0.00499007198959589, + 0.00441230833530426, + -0.010193174704909325, + -0.032328955829143524, + 0.004309020936489105, + 0.0170553307980299, + -0.005080448463559151, + -0.018630463629961014, + -0.00671368045732379, + 0.030237384140491486, + -0.026958009228110313, + 0.0016606675926595926, + 0.024375824257731438, + 0.033800799399614334, + 0.022619938477873802, + -0.0027839180547744036, + -0.0024272536393254995, + -0.02493099495768547, + 0.017829986289143562, + 0.004564011935144663, + 0.010690244846045971, + -0.00247244187630713, + 0.006426412612199783, + -0.006271481513977051, + -0.024220893159508705, + 0.008295268751680851, + 0.02227134443819523, + 0.017300639301538467, + 0.002096411306411028, + -0.00018418239778839052, + 0.00420250603929162, + -0.019430940970778465, + -0.010774166323244572, + -0.011903871782124043, + 0.0039023268036544323, + -0.00925713311880827, + 0.009276499040424824, + 0.015118692070245743, + -0.016383962705731392, + -0.018359335139393806, + 0.042270366102457047, + -0.013582292012870312, + 0.0026806306559592485, + -0.011206681840121746, + -0.014821740798652172, + 0.007075186353176832, + 0.05422588065266609, + -0.006026173941791058, + -0.010412660427391529, + 0.0015331722097471356, + 0.019676247611641884, + 0.012058802880346775, + -0.021303024142980576, + -0.02076076529920101, + 0.00893435999751091, + 0.004357437137514353, + -0.0068105123937129974, + 0.003177701262757182, + -0.014770097099244595, + 0.008469566702842712, + 0.0034052561968564987, + 0.001760727260261774, + -0.0002231169055448845, + -0.02892046980559826, + -0.006868611555546522, + -0.028326567262411118, + -0.014369858428835869, + 0.014395680278539658, + -0.005064310040324926, + 0.015467287041246891, + -0.010787077248096466, + 0.010832265019416809, + 0.038242157548666, + 0.018785394728183746, + 0.006449006497859955, + -0.020463814958930016, + 0.014679720625281334, + 0.0031486516818404198, + -0.007694910746067762, + 0.001307231024838984, + -0.030237384140491486, + -0.003976564854383469, + -0.020902786403894424, + -0.005809915717691183, + -0.01404708530753851, + -0.003650563769042492, + -0.003025997895747423, + 0.015660950914025307, + -0.014176194556057453, + -0.0116262873634696, + 0.01331116259098053, + -0.010535313747823238, + -0.014085818082094193, + 0.003834544448181987, + -0.013956708833575249, + 0.01422783825546503, + 0.007656177971512079, + -0.0012346070725470781, + -0.0008440516539849341, + -0.006145599763840437, + 0.0010465917875990272, + 0.0094766179099679, + -0.023188019171357155, + -0.0028339477721601725, + 0.01321433112025261, + -0.019689159467816353, + -0.0012321863323450089, + -0.022335898131132126, + 0.0003241852391511202, + 0.008256535977125168, + -0.011613376438617706, + -0.04136659950017929, + 0.005361261311918497, + -0.038242157548666, + -0.01059341337531805, + -0.014576433226466179, + -0.005667895544320345, + -0.027319515123963356, + -0.012704349122941494, + 0.01828186959028244, + 0.02349788136780262, + 0.02330421842634678, + 0.007236572913825512, + 0.00861804187297821, + 0.01975371316075325, + 0.01621612161397934, + -0.0014678107108920813, + -0.009424974210560322, + -0.006681403145194054, + -0.018772482872009277, + -0.0005394345498643816, + -0.0009868787601590157, + 0.0320449136197567, + -0.015635129064321518, + -0.01580297201871872, + 0.010122164152562618, + 0.016177387908101082, + -0.013259518891572952, + 0.03413648530840874, + -0.021057717502117157, + -0.00473508145660162, + 0.018152760341763496, + 0.011000107042491436, + 0.015919169411063194, + -0.004273516125977039, + -0.027758486568927765, + 0.008914993144571781, + -0.026983831077814102, + -0.0003104673814959824, + -0.02206476964056492, + 0.012168546207249165, + -0.00358600914478302, + -0.009308775886893272, + 0.0029097995720803738, + -0.018979057669639587, + -0.007385048549622297, + 0.010464304126799107, + -0.005532330833375454, + 0.004405852872878313, + 0.023562436923384666, + -0.006629759445786476, + 0.007101008202880621, + -0.023536615073680878, + 0.030857108533382416, + -0.00613914430141449, + -0.028817182406783104, + 0.012213733978569508, + -0.05587847903370857, + 0.0013596817152574658, + -0.0006209347629919648, + -0.022168057039380074, + 0.0028807499911636114, + 0.006303758826106787, + -0.00539999408647418, + 0.00671368045732379, + -0.0013120726216584444, + 0.002383679384365678, + 0.013149776495993137, + -0.007772376295179129, + -0.022568294778466225, + -0.04898404702544212, + -0.004215416964143515, + 0.011019473895430565, + 0.016345230862498283, + -0.004915834404528141, + -0.020463814958930016, + -0.01891450397670269, + 0.03300032392144203, + -0.015209068544209003, + -0.02121264860033989, + -0.03568579629063606, + -0.030624711886048317, + 0.033129431307315826, + 0.0057485890574753284, + -0.009941411204636097, + 0.02680307812988758, + -0.026364106684923172, + -0.00288559147156775, + -0.013995441608130932, + 0.014369858428835869, + -7.84742078394629e-05, + -0.014447323977947235, + -0.03196744993329048, + -0.017804164439439774, + 0.018385156989097595, + -0.005532330833375454, + 0.01112921629101038, + 0.015480197966098785, + 0.032742105424404144, + 0.011000107042491436, + -0.017197351902723312, + -0.010212540626525879, + -0.015441465191543102, + 0.002488580532371998, + -0.01600954681634903, + 0.012859280221164227, + 0.02429835870862007, + 0.014692631550133228, + 0.00968319270759821, + 0.00819843728095293, + 0.03116697072982788, + 0.022297166287899017, + 0.008689052425324917, + -0.01892741397023201, + -0.008863349445164204, + -0.02413051761686802, + -0.014653898775577545, + 0.005671123508363962, + -0.009625094011425972, + -0.00072664296021685, + 0.02493099495768547, + 0.009786480106413364, + 0.0253828763961792, + 0.017106974497437477, + -0.009689648635685444, + 0.004954567179083824, + 0.029798412695527077, + 0.010244818404316902, + 0.024569489061832428, + -0.005290251225233078, + 0.01206525880843401, + -0.03989475592970848, + -0.032948680222034454, + 0.0032067508436739445, + -0.024827707558870316, + -0.007230117451399565, + 0.0014653898542746902, + 0.009005369618535042, + 0.011961971409618855, + -0.0028016704600304365, + 0.011903871782124043, + 0.022374631837010384, + 0.014279481954872608, + 0.002787145785987377, + 0.008256535977125168, + -0.007920851930975914, + -0.0590287446975708, + -0.008179070428013802, + -0.04596288874745369, + -0.04172810539603233, + 0.0019027474336326122, + 0.006784690544009209, + -0.038552019745111465, + 0.026570681482553482, + 0.010012421756982803, + -0.002772620879113674, + -0.008153248578310013, + -0.0035827814135700464, + 0.00415731780230999, + -0.020334705710411072, + 0.0441037155687809, + -0.004292882513254881, + -0.00043211248703300953, + -0.009115112945437431, + 0.001920499955303967, + -0.016074100509285927, + -0.011755396611988544, + 0.03496278449892998, + 0.019418029114603996, + -0.001509771216660738, + -0.020864052698016167, + 0.022710315883159637, + 0.005758272018283606, + -0.015015404671430588, + -0.009192578494548798, + 0.004983616527169943, + 0.040230438113212585, + 0.0032842163927853107, + -0.039817288517951965, + 0.030185740441083908, + -0.02413051761686802, + 0.03341347351670265, + 0.0032083645928651094, + -0.018036561086773872, + 0.016732558608055115, + -0.02183237299323082, + 0.0003052223182749003, + 0.022723225876688957, + -0.017106974497437477, + 0.022568294778466225, + -0.00087632896611467, + 0.014176194556057453, + -0.01289155799895525, + 0.008753607049584389, + -0.022193878889083862, + -0.004238010849803686, + -0.0060584512539207935, + 0.0023304217029362917, + 0.01770087704062462, + 0.003155107144266367, + 0.011581098660826683, + 0.014628076925873756, + 0.0070170871913433075, + 0.01621612161397934, + 0.011774762533605099, + 0.027810130268335342, + -0.010141531005501747, + 0.014318214729428291, + -0.013737223111093044, + 0.0001642108109081164, + 0.0021545104682445526, + -0.0005850262241438031, + 0.0009626707760617137, + -0.0011571416398510337, + -0.0033891175407916307, + -0.015919169411063194, + 0.03881023824214935, + -0.00852766539901495, + -0.0292819757014513, + 0.01413746178150177, + 0.001689717173576355, + 0.009986599907279015, + -0.030908752232789993, + -0.017326461151242256, + 0.02330421842634678, + 0.0007924079545773566, + -0.03119279257953167, + -0.020257240161299706, + 3.0058245101827197e-05, + 0.018578819930553436, + 0.001744588604196906, + -0.012471952475607395, + -0.005761499982327223, + -0.0022077681496739388, + -0.020915696397423744, + 0.03488531708717346, + -0.007688455283641815, + 0.010548224672675133, + -0.009818757884204388, + 0.012323477305471897, + -0.0036150587256997824, + -0.04596288874745369, + 0.026983831077814102, + -0.01952131651341915, + -0.035453397780656815, + -0.011807040311396122, + 0.01847553253173828, + 0.014240749180316925, + -0.009547628462314606, + -0.0049707056023180485, + 0.0062262932769954205, + 0.006449006497859955, + -0.006158510688692331, + 0.0026919275987893343, + -0.016913311555981636, + 0.012736626900732517, + -0.008146793581545353, + -0.01372431218624115, + 0.015518930740654469, + -0.006048767827451229, + -0.005877698305994272, + -0.031915806233882904, + -0.005909975618124008, + -0.007139740977436304, + -0.031244436278939247, + -0.003595692338421941, + -0.0068105123937129974, + 0.036873601377010345, + -0.007165562827140093, + -0.014150372706353664, + -0.015183246694505215, + 0.0006019718130119145, + -0.01622903160750866, + 0.01874666102230549, + 0.012020070105791092, + -0.01619029976427555, + -0.017403926700353622, + 0.029462728649377823, + 0.022180967032909393, + 0.0210189837962389, + -0.007572256959974766, + -0.01644851826131344, + -0.01825604774057865, + -0.018385156989097595, + -0.01466680970042944, + -0.00905055832117796, + -0.0055839745327830315, + 0.027371158823370934, + 0.02597677893936634, + -0.04059194400906563, + -0.030857108533382416, + 0.023781921714544296, + -0.023420415818691254, + -0.025834759697318077, + 0.016371052712202072, + 0.004722170531749725, + -0.0015210682759061456, + 0.01724899560213089, + -0.004993299953639507, + 0.018991969525814056, + 0.004809319041669369, + -0.01748139224946499, + -0.019237276166677475, + 0.0008916606893762946, + 0.012743081897497177, + -0.030934574082493782, + 0.03842290863394737, + -0.025615273043513298, + -0.03036649338901043, + -0.005680806469172239, + 0.01932765357196331, + -0.0033923452720046043, + 0.0026725612115114927, + 0.004583378322422504, + 0.010361016727983952, + 0.019882822409272194, + -0.004883557092398405, + 0.033129431307315826, + -0.0001690524077275768, + 0.003650563769042492, + 0.009011825546622276, + -0.020063575357198715, + -0.02286524698138237, + -0.02081240899860859, + 0.03661538287997246, + -0.036073122173547745, + 0.013750134035944939, + 0.023162197321653366, + 0.012846369296312332, + -0.026958009228110313, + -0.019392207264900208, + -0.006219837814569473, + 0.006013263016939163, + -0.019043613225221634, + -0.001880153315141797, + 0.003411711659282446, + -0.014305303804576397, + -0.008359823375940323, + -0.011897416785359383, + -0.015867525711655617, + -0.006100411526858807, + -0.025499075651168823, + -0.013995441608130932, + -0.0001231581118190661, + 0.021483777090907097, + -0.0021464412566274405, + -0.0072236619889736176, + -0.016525983810424805, + 0.016061190515756607, + -0.01829477958381176, + -0.018578819930553436, + -0.02680307812988758, + -0.02726787142455578, + -0.01600954681634903, + 0.028972113505005836, + 0.016371052712202072, + -0.014382769353687763, + 0.007843386381864548, + -0.014692631550133228, + -0.007055819965898991, + 0.0005442761466838419, + -0.0042799715884029865, + 0.005874470341950655, + -0.04758966714143753, + 0.010361016727983952, + 0.009818757884204388, + -0.02969512529671192, + -0.003356840228661895, + -0.003760306630283594, + 0.007772376295179129, + 0.01788162998855114, + 0.03176087513566017, + 0.22434021532535553, + 0.022206788882613182, + -0.0009489529184065759, + 0.039171744138002396, + 0.0189532358199358, + 0.022387541830539703, + 0.02620917558670044, + 0.022168057039380074, + -0.0061326888389885426, + 0.026570681482553482, + 0.0018317373469471931, + 0.016990777105093002, + 0.0008521209820173681, + 0.00717201828956604, + 0.008237170055508614, + -0.007778831757605076, + -0.04635021835565567, + -0.00758516788482666, + -0.02014104090631008, + 0.0025369965005666018, + 0.005935797467827797, + -0.024453289806842804, + -0.021767817437648773, + -0.008986003696918488, + 0.0469699427485466, + 0.013530648313462734, + -0.004231555387377739, + 0.011878049932420254, + 0.004512368235737085, + -0.006113322451710701, + -0.002269095042720437, + 0.006681403145194054, + 0.00701063172891736, + -0.0016316180117428303, + -0.02034761570394039, + -0.0013120726216584444, + -0.012181457132101059, + -0.031657587736845016, + 0.02450493350625038, + 0.022916890680789948, + -0.025938047096133232, + 0.006946077104657888, + -0.018436800688505173, + 0.0010780622251331806, + -0.02056710235774517, + 0.01331116259098053, + -0.025912225246429443, + -0.018139848485589027, + 0.030082453042268753, + 0.006636214908212423, + -0.018862860277295113, + -0.0018220541533082724, + 0.032922856509685516, + 0.027164584025740623, + 0.0049674781039357185, + 0.004890012554824352, + 0.013375717215240002, + 0.001705855829641223, + -0.0007004176150076091, + 0.022826513275504112, + -0.016525983810424805, + 0.019172722473740578, + -0.014602255076169968, + 0.027371158823370934, + -0.010109253227710724, + -0.009250677190721035, + -0.027319515123963356, + -0.0037570788990706205, + 0.015699684619903564, + -0.006100411526858807, + -9.284770203521475e-05, + -0.006997720804065466, + 0.0019172722240909934, + 0.02329130657017231, + -0.00461565563455224, + -0.013685579411685467, + 0.005170824937522411, + -0.0017203806200996041, + 0.011639198288321495, + 0.016964955255389214, + -0.008856894448399544, + -0.013788866810500622, + -0.022206788882613182, + 0.013027122244238853, + -0.008327546529471874, + -0.012026526033878326, + 0.00020344792574178427, + 0.00208027265034616, + 0.001817212556488812, + -0.00914738979190588, + 0.002096411306411028, + 0.024801885709166527, + -0.006571660283952951, + -0.006784690544009209, + 0.014279481954872608, + 0.014150372706353664, + 0.0026709474623203278, + 0.008559943176805973, + -0.009076380170881748, + 0.01402126345783472, + -0.0292819757014513, + -0.004083079751580954, + 0.020283062011003494, + 0.012194368056952953, + -0.01624194346368313, + 0.008689052425324917, + -0.011761851608753204, + 0.003563415026292205, + 0.04289009049534798, + -0.0017591133946552873, + -0.009747747331857681, + 0.00556138064712286, + 0.018656285479664803, + -0.014382769353687763, + -0.0028823637403547764, + -0.005170824937522411, + -0.0009061854798346758, + -0.016138656064867973, + 0.003221275517717004, + -0.00014050716708879918, + -0.007094552740454674, + -0.022180967032909393, + -0.03075382113456726, + 0.01372431218624115, + -0.017403926700353622, + -0.007966040633618832, + -0.03653791546821594, + 0.013052944093942642, + 0.020115219056606293, + -0.03119279257953167, + 0.00556138064712286, + -0.0019156583584845066, + 0.02409178391098976, + -0.03305196762084961, + -0.01537691056728363, + 0.016500161960721016, + 0.015854615718126297, + -0.014008352532982826, + 0.014537700451910496, + -0.018036561086773872, + -0.01507995929569006, + -0.03488531708717346, + 0.02494390495121479, + -0.013763044960796833, + 0.005593657959252596, + -0.030289027839899063, + -0.024788973852992058, + 0.003569870488718152, + -0.015893347561359406, + -0.031115327030420303, + 0.007966040633618832, + -0.0341106615960598, + -0.009812301956117153, + -0.014524789527058601, + 0.016461428254842758, + -0.0013120726216584444, + -0.003531137714162469, + 0.004305793438106775, + 0.023988496512174606, + 0.014886295422911644, + -0.023846477270126343, + 0.0060584512539207935, + 0.027319515123963356, + 0.008185526356101036, + -0.01665509305894375, + -0.011871594935655594, + -0.16247107088565826, + 0.04035954922437668, + 0.017003687098622322, + -0.0315801203250885, + 0.0046995761804282665, + 0.011096939444541931, + -0.007197840139269829, + 0.012000704184174538, + -0.010193174704909325, + 0.016099922358989716, + 0.016500161960721016, + 0.004973933566361666, + -0.01971498131752014, + -0.029798412695527077, + -0.01080644316971302, + -0.0011305127991363406, + -0.032509706914424896, + 0.009599272161722183, + 0.03225148841738701, + 0.0255507193505764, + 0.003721573855727911, + -0.015454376116394997, + 0.022929800674319267, + 0.0010328739881515503, + 4.037815870105987e-06, + 0.005090131890028715, + -0.01528653409332037, + -0.004086307715624571, + 0.016964955255389214, + -0.014718453399837017, + -0.011671475134789944, + 0.005903520155698061, + 0.016706736758351326, + 0.01484756264835596, + 0.001228151610121131, + 0.0060294014401733875, + 0.009754203259944916, + 0.005745361093431711, + -0.0023772239219397306, + 0.02664814703166485, + -0.0033051965292543173, + 0.0022109958808869123, + 0.003171245800331235, + 0.02409178391098976, + -0.016745468601584435, + 0.02391103096306324, + 0.020502546802163124, + -0.01203943695873022, + -0.01030291710048914, + -0.018824126571416855, + 0.006219837814569473, + -0.01620320975780487, + 0.008772972971200943, + -0.004564011935144663, + 0.004709259606897831, + 0.015131602995097637, + 0.03558250889182091, + 0.00420250603929162, + 0.005432271398603916, + -0.014176194556057453, + -0.007094552740454674, + -0.007417325861752033, + 0.018772482872009277, + 0.0015840090345591307, + 0.017158618196845055, + -0.015196157619357109, + 0.0010005966760218143, + -0.0034407612401992083, + -0.022710315883159637, + 0.024840617552399635, + -0.025899313390254974, + -0.025279588997364044, + 0.003889415878802538, + -0.01059986837208271, + 0.0070493645034730434, + 0.009786480106413364, + 0.0005386276170611382, + -0.005629162769764662, + -0.017765432596206665, + -0.006481283809989691, + -0.04260604828596115, + 0.0211868267506361, + -0.015699684619903564, + 0.02015395276248455, + 0.005109498277306557, + 0.010193174704909325, + -0.015325266867876053, + 0.00905055832117796, + -0.017003687098622322, + -0.018630463629961014, + 0.032303132116794586, + -0.036279696971178055, + 0.01810111664235592, + -0.03912010043859482, + 0.025060104206204414, + 0.021741995587944984, + -0.0008488932508043945, + 0.01870792917907238, + -0.006171421613544226, + -0.0001905370008898899, + 0.017726698890328407, + -0.013763044960796833, + 0.0060907285660505295, + -0.0021157776936888695, + 0.030108274891972542, + 0.015712594613432884, + -0.012491319328546524, + 0.026067156344652176, + 0.03757078945636749, + 0.004628566559404135, + -0.027990883216261864, + 0.005409677047282457, + 0.036692846566438675, + 0.027500268071889877, + -0.02289106883108616, + 0.008275902830064297, + 0.013801777735352516, + -0.018036561086773872, + 0.01994737796485424, + 0.003921693190932274, + 0.05012020841240883, + -0.028972113505005836, + -0.011878049932420254, + 0.009670281782746315, + -0.0016542121302336454, + -0.004651160445064306, + -0.09636713564395905, + 0.013298251666128635, + 0.02558945119380951, + -0.008656774647533894, + 0.0031841567251831293, + 0.026880543678998947, + 0.010722522623836994, + 0.014731364324688911, + 0.011167949065566063, + 0.014989582821726799, + 0.00011952691420447081, + -0.015118692070245743, + -0.015351088717579842, + -0.014615166001021862, + -0.004676982294768095, + 0.007178473751991987, + -0.01321433112025261, + -0.0021851740311831236, + -0.034394703805446625, + 0.0041766841895878315, + -0.0012846369063481688, + -0.02619626559317112, + -0.016900399699807167, + -0.011309969238936901, + -0.01496376097202301, + -0.0008892398909665644, + -0.024698598310351372, + 0.011548821814358234, + 0.006468372885137796, + 0.02830074541270733, + -0.0017558856634423137, + -0.025873491540551186, + -0.007081641815602779, + -0.012032981030642986, + -0.026751434430480003, + -0.028145814314484596, + -0.0124590415507555, + 0.007075186353176832, + -0.0004353402182459831, + -0.020670389756560326, + 0.004770586267113686, + -0.014860473573207855, + 0.017829986289143562, + -0.013905065134167671, + 0.024982638657093048, + -0.020954430103302002, + -0.016125744208693504, + 0.018837038427591324, + 0.02428544871509075, + -0.003297127317637205, + -0.01994737796485424, + 0.006875067017972469, + -0.003363295691087842, + -0.0033277906477451324, + 0.030314849689602852, + -0.02930779755115509, + 0.012284744530916214, + 0.007184929214417934, + -0.014731364324688911, + -0.0052805677987635136, + -0.01622903160750866, + 0.027706842869520187, + -0.007468969561159611, + 0.018875770270824432, + -0.0013758203713223338, + 0.0021916294936090708, + -0.005780866369605064, + 0.008889171294867992, + 0.020915696397423744, + -0.022193878889083862, + -0.04263187199831009, + 0.005548469722270966, + -0.019004879519343376, + 0.0062262932769954205, + -0.032561350613832474, + 0.0063715409487485886, + -0.034807853400707245, + 0.009734836407005787, + -0.003019542433321476, + 0.0006003579474054277, + -0.014524789527058601, + -0.011251870542764664, + -0.014331125654280186, + -0.005874470341950655, + 0.0014960533007979393, + 0.043561458587646484, + 0.010348105803132057, + -0.006694314070045948, + -0.0012450972571969032, + -0.03240641951560974, + -0.01913398876786232, + 0.018152760341763496, + 0.0034536721650511026, + 0.0028178091160953045, + -0.00041839462937787175, + 0.014899206347763538, + 0.0057485890574753284, + 0.01018026378005743, + 0.03811304643750191, + -0.012452586553990841, + -0.011600465513765812, + -0.007972495630383492, + -0.06326352804899216, + 0.016977865248918533, + 0.01873375102877617, + -0.010858086869120598, + 0.02577020414173603, + 0.013775955885648727, + 0.027112940326333046, + 0.013479004614055157, + -0.009851034730672836, + -0.0170553307980299, + -0.008250080980360508, + 0.032535530626773834, + -0.0118586840108037, + -0.02180655114352703, + -0.025266679003834724, + 0.008049961179494858, + 0.024195071309804916, + 0.017972007393836975, + 0.011309969238936901, + 0.010832265019416809, + -0.021341757848858833, + 0.021135183051228523, + 0.02948855049908161, + 0.013905065134167671, + -0.023975586518645287, + -0.0034924049396067858, + -0.0065361554734408855, + -0.009063469246029854, + -0.025899313390254974, + 0.005367716774344444, + 0.02161288633942604, + -0.02096734009683132, + -0.0019414802081882954, + 0.04691829904913902, + -0.027371158823370934, + -0.008914993144571781, + 0.010380382649600506, + 0.019017791375517845, + 0.007972495630383492, + -0.020902786403894424, + -0.008166159503161907, + -0.025434520095586777, + -0.0012886716285720468, + -0.022206788882613182, + -0.015234890393912792, + 0.00441230833530426, + -0.009205489419400692, + 0.00014434009790420532, + 0.04059194400906563, + -0.008133882656693459, + 0.025666916742920876, + 0.018372245132923126, + -0.005380627699196339, + -0.004631794057786465, + 0.014214927330613136, + -0.026467394083738327, + 0.02014104090631008, + 0.004031436052173376, + 0.017145708203315735, + -0.008798794820904732, + 0.026092978194355965, + 0.0026644919998943806, + 0.021470867097377777, + 0.0034859494771808386, + 0.009224855341017246, + -0.00832109060138464, + -0.020205596461892128, + -0.01195551548153162, + 0.02597677893936634, + -0.011290603317320347, + -0.008805250748991966, + 0.00395074300467968, + 0.008953725919127464, + 0.007191384676843882, + 0.028145814314484596, + -0.020838230848312378, + 0.006842789705842733, + 0.003640880575403571, + -0.010612779296934605, + 0.03465292230248451, + 0.0011087256716564298, + 0.004305793438106775, + -0.05572354793548584, + 0.0075980788096785545, + 0.017933273687958717, + 0.006468372885137796, + -0.009760658256709576, + 0.0006330387550406158, + 0.004483318421989679, + 0.01786871999502182, + 0.02407887391746044, + -0.011084028519690037, + -0.04472343996167183, + 0.004089535214006901, + -0.008140337653458118, + -0.02079949900507927, + -0.006823423318564892, + -0.015854615718126297, + -0.001550117856822908, + 0.044413577765226364, + 0.019495494663715363, + 0.012730170972645283, + 0.017765432596206665, + -0.019637515768408775, + -0.016267765313386917, + 0.006419957149773836, + -0.013943797908723354, + -0.020437993109226227, + -0.008585765026509762, + 0.004725398030132055, + 0.004215416964143515, + -0.015196157619357109, + -0.0038506831042468548, + 0.012175001204013824, + -0.020231418311595917, + 0.012142724357545376, + -0.030056631192564964, + -0.021909838542342186, + 0.003108304925262928, + 0.02263285033404827, + -0.0094766179099679, + 0.00822425913065672, + 0.013020667247474194, + 0.005596885457634926, + 0.004270288161933422, + 0.006771779619157314, + 0.02207767963409424, + 0.0013701717834919691, + 0.03057306818664074, + 0.005603340920060873, + 0.021664530038833618, + -0.025421610102057457, + -0.0067459577694535255, + -0.017533035948872566, + 0.0064038182608783245, + -0.006187560502439737, + 0.040023863315582275, + 0.004673754330724478, + 0.0036118309944868088, + 0.050404246896505356, + 0.008488932624459267, + -0.031037861481308937, + -0.002519244095310569, + -0.008508299477398396, + 0.015944991260766983, + 0.017804164439439774, + 0.010845175944268703, + -0.02598969079554081, + -0.0043832589872181416, + 0.006277936976402998, + 0.010703155770897865, + 0.023446237668395042, + -0.005651757121086121, + -0.044207002967596054, + 0.011374523863196373, + -0.03535011038184166, + 0.007488335948437452, + -0.0061940159648656845, + -5.169412816030672e-06, + -0.0012289586011320353, + 0.0037635343614965677, + 0.01103238482028246, + 0.002398204058408737, + -0.015105781145393848, + -0.01289801299571991, + -0.015480197966098785, + -0.015944991260766983, + -0.02496972680091858, + -0.018824126571416855, + 0.013672668486833572, + -0.003145423950627446, + -0.04782206192612648, + -0.010154441930353642, + 0.008863349445164204, + -0.003411711659282446, + -0.005028804764151573, + 0.004906150978058577, + 0.005093359388411045, + 0.03612476587295532, + -0.018126938492059708, + 0.017403926700353622, + -0.03473038598895073, + -0.02283942513167858, + -0.0028016704600304365, + -0.004421991761773825, + -0.005022349301725626, + 0.002007648814469576, + -0.03757078945636749 + ], "DOT") LIMIT 3; +/* end::query-vectors-idx-whole[] */ + + +/* tag::query-vectors-idx-filtered-truncated[] */ +SELECT b.color, b.description from `rgb` AS b +WHERE brightness > 190.0 +ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, +[ + 0.005115953739732504, + 0.004331615287810564, + 0.014279481954872608, + /* long list of vector values omitted */ + -0.005022349301725626, + 0.002007648814469576, + -0.03757078945636749 + ], "DOT") LIMIT 3; +/* end::query-vectors-idx-filtered-truncated[] */ + +/* tag::query-vectors-idx-filtered-whole[] */ +SELECT b.color, b.description from `rgb` AS b +WHERE brightness > 190.0 +ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, +[ + 0.005115953739732504, + 0.004331615287810564, + 0.014279481954872608, + 0.000619320897385478, + 0.006700769532471895, + 0.018410978838801384, + -0.010367471724748611, + -0.019805356860160828, + 0.013059400022029877, + -0.011271236464381218, + -0.011251870542764664, + -0.004915834404528141, + -0.0031744735315442085, + 0.00843728892505169, + -0.01706824265420437, + 0.013362806290388107, + 0.04694411903619766, + 0.011258325539529324, + 0.01298193447291851, + -0.01080644316971302, + -0.01744265854358673, + 0.0044155362993478775, + -0.00742378132417798, + 0.014214927330613136, + -0.01248486340045929, + 0.0009481459856033325, + 0.027293693274259567, + -0.029204510152339935, + 0.006355402525514364, + 0.016254853457212448, + 0.02933361940085888, + -0.017352283000946045, + 0.007236572913825512, + -0.017094064503908157, + 0.002293302910402417, + -0.018139848485589027, + 0.007811109069734812, + 0.015028315596282482, + -0.008785883896052837, + -0.013453182764351368, + -8.422360406257212e-05, + 0.010896819643676281, + 0.002246500924229622, + -0.010586957447230816, + -0.0011482653208076954, + -0.003537593176588416, + 0.02017977461218834, + -0.013491915538907051, + -0.00977356918156147, + 0.01215563528239727, + 0.032122381031513214, + 0.02827492356300354, + 0.002995334332808852, + -0.027396980673074722, + 0.004583378322422504, + 0.0007577098440378904, + 0.00016683334251865745, + 0.025731472298502922, + 0.006158510688692331, + -0.008288813754916191, + 0.00016885067452676594, + 0.01956005021929741, + -0.01309813279658556, + 0.009934956207871437, + -0.007920851930975914, + 0.008721329271793365, + -0.032354775816202164, + -0.0031050771940499544, + -0.0049997554160654545, + 0.029178688302636147, + 0.0075980788096785545, + 0.024995548650622368, + 0.018165670335292816, + -0.008463110774755478, + 0.025292500853538513, + -0.0031518794130533934, + -0.01706824265420437, + -0.00925713311880827, + -0.013375717215240002, + 0.0066749476827681065, + 0.015144513919949532, + -0.0011805426329374313, + -0.037312570959329605, + 0.015092870220541954, + 0.01786871999502182, + 0.015002493746578693, + -0.020631656050682068, + 0.0021415995433926582, + -0.004912606440484524, + -0.004880329128354788, + -0.012523596175014973, + 0.024246715009212494, + 0.02413051761686802, + 0.0008162125013768673, + -0.02077367715537548, + 0.005419360473752022, + 0.008508299477398396, + 0.010470759123563766, + 0.0004575308703351766, + -0.01443441305309534, + -0.00852766539901495, + 0.017326461151242256, + -0.03674449026584625, + -0.009579905308783054, + -0.018643373623490334, + -0.0009473390528000891, + 0.00832109060138464, + -0.0016057961620390415, + 0.023614080622792244, + -0.024272536858916283, + -0.042502760887145996, + 0.03207073733210564, + 0.009534717537462711, + -0.041082561016082764, + -0.010651512071490288, + -0.01997319981455803, + 0.016306497156620026, + 0.015648040920495987, + -0.00894081499427557, + -0.03473038598895073, + -0.00884398352354765, + 0.018010739237070084, + 0.019004879519343376, + -0.015970813110470772, + 0.01914690062403679, + 0.0008166159386746585, + -0.006232748739421368, + -0.033568404614925385, + -0.03416230529546738, + -0.02494390495121479, + 0.02163870818912983, + 0.01701659895479679, + -0.004396169912070036, + 0.003786128479987383, + -0.008372734300792217, + 0.014563522301614285, + -0.01029646210372448, + 0.005622707307338715, + 0.010270640254020691, + 0.0004607586015481502, + 0.032096557319164276, + 0.021096449345350266, + -0.00034355162642896175, + -0.007966040633618832, + -0.004928745329380035, + 0.02806834876537323, + 0.010528858751058578, + 0.013349895365536213, + -0.006629759445786476, + -0.01913398876786232, + 0.02205185778439045, + -0.015480197966098785, + 0.02580893784761429, + 0.013362806290388107, + 0.010244818404316902, + 0.024246715009212494, + -0.0043122489005327225, + 0.0009594430448487401, + -0.02948855049908161, + 0.005044943653047085, + -0.004499457310885191, + -0.010373927652835846, + 0.0007040488417260349, + 0.012032981030642986, + 0.02039925940334797, + 0.02788759581744671, + 0.01807529479265213, + 0.008695507422089577, + 0.0015170335536822677, + 0.02059292420744896, + -0.012291199527680874, + 0.02706129662692547, + -0.009663826785981655, + 0.01101301796734333, + -0.013336984440684319, + 0.025705650448799133, + 0.006765324156731367, + 0.007197840139269829, + 0.024156339466571808, + -0.012975478544831276, + -0.03098621778190136, + -0.004870646167546511, + -0.000659667537547648, + -0.01186513900756836, + -0.007849842309951782, + -0.005797004792839289, + 0.022310076281428337, + -0.02099316194653511, + 0.0013346667401492596, + -0.011600465513765812, + -0.002236817730590701, + 0.020825320854783058, + 0.0010651513002812862, + -0.022826513275504112, + -0.6420344114303589, + 8.150020585162565e-05, + -0.014214927330613136, + -0.015841703861951828, + 0.02079949900507927, + 0.020205596461892128, + 0.037544965744018555, + 0.012265377677977085, + 0.0005870435852557421, + -0.01665509305894375, + 0.005919658578932285, + 0.013349895365536213, + 0.016577627509832382, + -0.01664218120276928, + 0.0006382837891578674, + -0.013969619758427143, + -0.017326461151242256, + -0.00033669269760139287, + -0.013027122244238853, + 0.00042283275979571044, + -0.00431870436295867, + 0.02161288633942604, + -0.007572256959974766, + 0.007262394763529301, + 0.019469672814011574, + 0.01372431218624115, + 0.001147458446212113, + -0.013479004614055157, + 0.014279481954872608, + 0.043587278574705124, + -0.027138762176036835, + 0.015118692070245743, + 8.61400694702752e-05, + 0.00968319270759821, + 0.04738309234380722, + 0.01579006016254425, + -0.026544859632849693, + 0.03506607189774513, + -0.022348809987306595, + 0.05510382354259491, + -0.01931474171578884, + 0.011671475134789944, + 0.02081240899860859, + -0.03098621778190136, + 0.0003318511007819325, + 0.021574154496192932, + 0.024272536858916283, + -0.015854615718126297, + 0.028378210961818695, + -0.015467287041246891, + 0.019689159467816353, + 0.005471004173159599, + 0.014718453399837017, + 0.0048641907051205635, + 0.00894081499427557, + 0.010845175944268703, + 0.030056631192564964, + -0.016538893803954124, + 0.012317021377384663, + 0.009366875514388084, + -0.003025997895747423, + 0.0029791956767439842, + -0.01434403657913208, + -0.019185632467269897, + -0.014976671896874905, + 0.03465292230248451, + -0.013788866810500622, + -0.013091676868498325, + -0.0024353230837732553, + -0.028791360557079315, + -0.005522647872567177, + -0.008630952797830105, + -0.02286524698138237, + 0.009418519213795662, + 0.00011145758617203683, + -0.0103932935744524, + 0.012342843227088451, + 0.017584679648280144, + -0.008288813754916191, + 0.009754203259944916, + 0.0016525982646271586, + -0.00712683005258441, + -0.005467776209115982, + 0.0034956326708197594, + 0.0353759340941906, + 0.013324073515832424, + -0.03535011038184166, + -0.04258022829890251, + 0.01322078611701727, + 0.011193770915269852, + 0.023756099864840508, + 0.030934574082493782, + 0.0018236680189147592, + -0.0009667054400779307, + -0.012588150799274445, + 0.003983020316809416, + -0.02369154617190361, + -0.015234890393912792, + -0.026299552991986275, + -0.007107463665306568, + 0.00779174268245697, + -0.015389821492135525, + -0.012310566380620003, + 0.008262991905212402, + 0.02664814703166485, + -0.0017284499481320381, + -0.0297467689961195, + 0.022607028484344482, + 0.023575346916913986, + -0.017326461151242256, + 0.020115219056606293, + -0.026751434430480003, + 0.0026580365374684334, + 0.003090552520006895, + 0.03596983477473259, + -0.02451784536242485, + 0.02471150830388069, + -0.003347157035022974, + -0.007533524185419083, + -0.02556362934410572, + 0.02933361940085888, + -0.013298251666128635, + -0.014279481954872608, + 0.007507702335715294, + 0.017571767792105675, + 0.00280489819124341, + -0.008424378000199795, + -0.0010514333844184875, + -0.0030469780322164297, + -0.0012862507719546556, + 0.021161004900932312, + -0.0022755505051463842, + -0.0011644039768725634, + 0.0031744735315442085, + -0.00047205566079355776, + -0.014576433226466179, + 0.004460724536329508, + -0.010031787678599358, + 0.008256535977125168, + -0.04513658955693245, + -0.019288919866085052, + -0.013233697041869164, + 0.00965091586112976, + 0.0026709474623203278, + -0.021884016692638397, + -0.03516935929656029, + -0.03281956911087036, + 0.008663230575621128, + -0.038784414529800415, + -0.010322283953428268, + -0.016474340111017227, + -0.013788866810500622, + -0.022568294778466225, + 0.03183833882212639, + 0.025834759697318077, + -0.0028807499911636114, + -0.02100607380270958, + -0.02249082922935486, + -0.01434403657913208, + -0.007365682162344456, + 0.01994737796485424, + 0.02972094714641571, + -0.008837527595460415, + -0.009457251988351345, + -0.013595202937722206, + -0.04121166840195656, + -0.009605727158486843, + 0.013111043721437454, + -0.010877453722059727, + -0.023368772119283676, + 0.012420308776199818, + -0.012820547446608543, + -0.006842789705842733, + 0.012523596175014973, + -0.005935797467827797, + 0.013646846637129784, + -0.006868611555546522, + -0.021264292299747467, + -0.002252956386655569, + -0.007681999821215868, + 0.00020627219055313617, + 0.009089291095733643, + -0.005713083781301975, + -0.005212785676121712, + 0.03496278449892998, + 0.001072413637302816, + 0.022090591490268707, + 0.07266268134117126, + -0.02431127056479454, + 0.032974500209093094, + -0.0030485920142382383, + 0.009289409965276718, + -0.01660344935953617, + 0.001254780450835824, + -0.01340153906494379, + 0.01103238482028246, + 0.010199629701673985, + -0.0026919275987893343, + -0.012142724357545376, + -0.005038488190621138, + 0.031709231436252594, + 0.023562436923384666, + 0.011781218461692333, + -0.003963653929531574, + 0.016164477914571762, + -0.02034761570394039, + 0.016745468601584435, + 0.0006649125716648996, + 0.008069328032433987, + 0.022168057039380074, + -0.0036215141881257296, + -0.03199326992034912, + -0.008366279304027557, + -0.014576433226466179, + 0.006668492220342159, + 0.0007762692985124886, + 0.00029594259103760123, + 0.010864542797207832, + -0.0174555703997612, + 0.013349895365536213, + 0.017984917387366295, + 0.010993652045726776, + 0.01976662501692772, + -0.013956708833575249, + -0.00499007198959589, + 0.007546435110270977, + 0.014498967677354813, + -0.0032164340373128653, + -0.01974080316722393, + -0.03395573049783707, + -0.013853421434760094, + -0.0065393829718232155, + -0.005961619317531586, + 0.0028016704600304365, + -0.005122409202158451, + 0.005061082076281309, + 0.01603536866605282, + -0.024595310911536217, + 0.03449799120426178, + 0.008217803202569485, + 0.01891450397670269, + 0.031683407723903656, + 0.005170824937522411, + 0.006481283809989691, + 0.04433611407876015, + -0.02637701854109764, + 0.0172231737524271, + 0.005474231671541929, + 0.0028710667975246906, + 0.0050417156890034676, + -0.026351196691393852, + -0.007681999821215868, + -0.04808028042316437, + 0.009780025109648705, + 0.011619831435382366, + -0.013982530683279037, + 0.014576433226466179, + -0.0004478476766962558, + 0.020864052698016167, + 0.017545945942401886, + 0.02428544871509075, + -0.019043613225221634, + 0.009986599907279015, + -0.01952131651341915, + 0.00379258394241333, + 0.008004773408174515, + 0.004909378942102194, + 0.003116374369710684, + -0.018785394728183746, + -0.008095149882137775, + 0.008701963350176811, + -0.0237173680216074, + 0.009082835167646408, + -0.02453075535595417, + -0.0049674781039357185, + 0.0127753596752882, + -0.003941059578210115, + -0.018165670335292816, + -0.00499007198959589, + 0.00441230833530426, + -0.010193174704909325, + -0.032328955829143524, + 0.004309020936489105, + 0.0170553307980299, + -0.005080448463559151, + -0.018630463629961014, + -0.00671368045732379, + 0.030237384140491486, + -0.026958009228110313, + 0.0016606675926595926, + 0.024375824257731438, + 0.033800799399614334, + 0.022619938477873802, + -0.0027839180547744036, + -0.0024272536393254995, + -0.02493099495768547, + 0.017829986289143562, + 0.004564011935144663, + 0.010690244846045971, + -0.00247244187630713, + 0.006426412612199783, + -0.006271481513977051, + -0.024220893159508705, + 0.008295268751680851, + 0.02227134443819523, + 0.017300639301538467, + 0.002096411306411028, + -0.00018418239778839052, + 0.00420250603929162, + -0.019430940970778465, + -0.010774166323244572, + -0.011903871782124043, + 0.0039023268036544323, + -0.00925713311880827, + 0.009276499040424824, + 0.015118692070245743, + -0.016383962705731392, + -0.018359335139393806, + 0.042270366102457047, + -0.013582292012870312, + 0.0026806306559592485, + -0.011206681840121746, + -0.014821740798652172, + 0.007075186353176832, + 0.05422588065266609, + -0.006026173941791058, + -0.010412660427391529, + 0.0015331722097471356, + 0.019676247611641884, + 0.012058802880346775, + -0.021303024142980576, + -0.02076076529920101, + 0.00893435999751091, + 0.004357437137514353, + -0.0068105123937129974, + 0.003177701262757182, + -0.014770097099244595, + 0.008469566702842712, + 0.0034052561968564987, + 0.001760727260261774, + -0.0002231169055448845, + -0.02892046980559826, + -0.006868611555546522, + -0.028326567262411118, + -0.014369858428835869, + 0.014395680278539658, + -0.005064310040324926, + 0.015467287041246891, + -0.010787077248096466, + 0.010832265019416809, + 0.038242157548666, + 0.018785394728183746, + 0.006449006497859955, + -0.020463814958930016, + 0.014679720625281334, + 0.0031486516818404198, + -0.007694910746067762, + 0.001307231024838984, + -0.030237384140491486, + -0.003976564854383469, + -0.020902786403894424, + -0.005809915717691183, + -0.01404708530753851, + -0.003650563769042492, + -0.003025997895747423, + 0.015660950914025307, + -0.014176194556057453, + -0.0116262873634696, + 0.01331116259098053, + -0.010535313747823238, + -0.014085818082094193, + 0.003834544448181987, + -0.013956708833575249, + 0.01422783825546503, + 0.007656177971512079, + -0.0012346070725470781, + -0.0008440516539849341, + -0.006145599763840437, + 0.0010465917875990272, + 0.0094766179099679, + -0.023188019171357155, + -0.0028339477721601725, + 0.01321433112025261, + -0.019689159467816353, + -0.0012321863323450089, + -0.022335898131132126, + 0.0003241852391511202, + 0.008256535977125168, + -0.011613376438617706, + -0.04136659950017929, + 0.005361261311918497, + -0.038242157548666, + -0.01059341337531805, + -0.014576433226466179, + -0.005667895544320345, + -0.027319515123963356, + -0.012704349122941494, + 0.01828186959028244, + 0.02349788136780262, + 0.02330421842634678, + 0.007236572913825512, + 0.00861804187297821, + 0.01975371316075325, + 0.01621612161397934, + -0.0014678107108920813, + -0.009424974210560322, + -0.006681403145194054, + -0.018772482872009277, + -0.0005394345498643816, + -0.0009868787601590157, + 0.0320449136197567, + -0.015635129064321518, + -0.01580297201871872, + 0.010122164152562618, + 0.016177387908101082, + -0.013259518891572952, + 0.03413648530840874, + -0.021057717502117157, + -0.00473508145660162, + 0.018152760341763496, + 0.011000107042491436, + 0.015919169411063194, + -0.004273516125977039, + -0.027758486568927765, + 0.008914993144571781, + -0.026983831077814102, + -0.0003104673814959824, + -0.02206476964056492, + 0.012168546207249165, + -0.00358600914478302, + -0.009308775886893272, + 0.0029097995720803738, + -0.018979057669639587, + -0.007385048549622297, + 0.010464304126799107, + -0.005532330833375454, + 0.004405852872878313, + 0.023562436923384666, + -0.006629759445786476, + 0.007101008202880621, + -0.023536615073680878, + 0.030857108533382416, + -0.00613914430141449, + -0.028817182406783104, + 0.012213733978569508, + -0.05587847903370857, + 0.0013596817152574658, + -0.0006209347629919648, + -0.022168057039380074, + 0.0028807499911636114, + 0.006303758826106787, + -0.00539999408647418, + 0.00671368045732379, + -0.0013120726216584444, + 0.002383679384365678, + 0.013149776495993137, + -0.007772376295179129, + -0.022568294778466225, + -0.04898404702544212, + -0.004215416964143515, + 0.011019473895430565, + 0.016345230862498283, + -0.004915834404528141, + -0.020463814958930016, + -0.01891450397670269, + 0.03300032392144203, + -0.015209068544209003, + -0.02121264860033989, + -0.03568579629063606, + -0.030624711886048317, + 0.033129431307315826, + 0.0057485890574753284, + -0.009941411204636097, + 0.02680307812988758, + -0.026364106684923172, + -0.00288559147156775, + -0.013995441608130932, + 0.014369858428835869, + -7.84742078394629e-05, + -0.014447323977947235, + -0.03196744993329048, + -0.017804164439439774, + 0.018385156989097595, + -0.005532330833375454, + 0.01112921629101038, + 0.015480197966098785, + 0.032742105424404144, + 0.011000107042491436, + -0.017197351902723312, + -0.010212540626525879, + -0.015441465191543102, + 0.002488580532371998, + -0.01600954681634903, + 0.012859280221164227, + 0.02429835870862007, + 0.014692631550133228, + 0.00968319270759821, + 0.00819843728095293, + 0.03116697072982788, + 0.022297166287899017, + 0.008689052425324917, + -0.01892741397023201, + -0.008863349445164204, + -0.02413051761686802, + -0.014653898775577545, + 0.005671123508363962, + -0.009625094011425972, + -0.00072664296021685, + 0.02493099495768547, + 0.009786480106413364, + 0.0253828763961792, + 0.017106974497437477, + -0.009689648635685444, + 0.004954567179083824, + 0.029798412695527077, + 0.010244818404316902, + 0.024569489061832428, + -0.005290251225233078, + 0.01206525880843401, + -0.03989475592970848, + -0.032948680222034454, + 0.0032067508436739445, + -0.024827707558870316, + -0.007230117451399565, + 0.0014653898542746902, + 0.009005369618535042, + 0.011961971409618855, + -0.0028016704600304365, + 0.011903871782124043, + 0.022374631837010384, + 0.014279481954872608, + 0.002787145785987377, + 0.008256535977125168, + -0.007920851930975914, + -0.0590287446975708, + -0.008179070428013802, + -0.04596288874745369, + -0.04172810539603233, + 0.0019027474336326122, + 0.006784690544009209, + -0.038552019745111465, + 0.026570681482553482, + 0.010012421756982803, + -0.002772620879113674, + -0.008153248578310013, + -0.0035827814135700464, + 0.00415731780230999, + -0.020334705710411072, + 0.0441037155687809, + -0.004292882513254881, + -0.00043211248703300953, + -0.009115112945437431, + 0.001920499955303967, + -0.016074100509285927, + -0.011755396611988544, + 0.03496278449892998, + 0.019418029114603996, + -0.001509771216660738, + -0.020864052698016167, + 0.022710315883159637, + 0.005758272018283606, + -0.015015404671430588, + -0.009192578494548798, + 0.004983616527169943, + 0.040230438113212585, + 0.0032842163927853107, + -0.039817288517951965, + 0.030185740441083908, + -0.02413051761686802, + 0.03341347351670265, + 0.0032083645928651094, + -0.018036561086773872, + 0.016732558608055115, + -0.02183237299323082, + 0.0003052223182749003, + 0.022723225876688957, + -0.017106974497437477, + 0.022568294778466225, + -0.00087632896611467, + 0.014176194556057453, + -0.01289155799895525, + 0.008753607049584389, + -0.022193878889083862, + -0.004238010849803686, + -0.0060584512539207935, + 0.0023304217029362917, + 0.01770087704062462, + 0.003155107144266367, + 0.011581098660826683, + 0.014628076925873756, + 0.0070170871913433075, + 0.01621612161397934, + 0.011774762533605099, + 0.027810130268335342, + -0.010141531005501747, + 0.014318214729428291, + -0.013737223111093044, + 0.0001642108109081164, + 0.0021545104682445526, + -0.0005850262241438031, + 0.0009626707760617137, + -0.0011571416398510337, + -0.0033891175407916307, + -0.015919169411063194, + 0.03881023824214935, + -0.00852766539901495, + -0.0292819757014513, + 0.01413746178150177, + 0.001689717173576355, + 0.009986599907279015, + -0.030908752232789993, + -0.017326461151242256, + 0.02330421842634678, + 0.0007924079545773566, + -0.03119279257953167, + -0.020257240161299706, + 3.0058245101827197e-05, + 0.018578819930553436, + 0.001744588604196906, + -0.012471952475607395, + -0.005761499982327223, + -0.0022077681496739388, + -0.020915696397423744, + 0.03488531708717346, + -0.007688455283641815, + 0.010548224672675133, + -0.009818757884204388, + 0.012323477305471897, + -0.0036150587256997824, + -0.04596288874745369, + 0.026983831077814102, + -0.01952131651341915, + -0.035453397780656815, + -0.011807040311396122, + 0.01847553253173828, + 0.014240749180316925, + -0.009547628462314606, + -0.0049707056023180485, + 0.0062262932769954205, + 0.006449006497859955, + -0.006158510688692331, + 0.0026919275987893343, + -0.016913311555981636, + 0.012736626900732517, + -0.008146793581545353, + -0.01372431218624115, + 0.015518930740654469, + -0.006048767827451229, + -0.005877698305994272, + -0.031915806233882904, + -0.005909975618124008, + -0.007139740977436304, + -0.031244436278939247, + -0.003595692338421941, + -0.0068105123937129974, + 0.036873601377010345, + -0.007165562827140093, + -0.014150372706353664, + -0.015183246694505215, + 0.0006019718130119145, + -0.01622903160750866, + 0.01874666102230549, + 0.012020070105791092, + -0.01619029976427555, + -0.017403926700353622, + 0.029462728649377823, + 0.022180967032909393, + 0.0210189837962389, + -0.007572256959974766, + -0.01644851826131344, + -0.01825604774057865, + -0.018385156989097595, + -0.01466680970042944, + -0.00905055832117796, + -0.0055839745327830315, + 0.027371158823370934, + 0.02597677893936634, + -0.04059194400906563, + -0.030857108533382416, + 0.023781921714544296, + -0.023420415818691254, + -0.025834759697318077, + 0.016371052712202072, + 0.004722170531749725, + -0.0015210682759061456, + 0.01724899560213089, + -0.004993299953639507, + 0.018991969525814056, + 0.004809319041669369, + -0.01748139224946499, + -0.019237276166677475, + 0.0008916606893762946, + 0.012743081897497177, + -0.030934574082493782, + 0.03842290863394737, + -0.025615273043513298, + -0.03036649338901043, + -0.005680806469172239, + 0.01932765357196331, + -0.0033923452720046043, + 0.0026725612115114927, + 0.004583378322422504, + 0.010361016727983952, + 0.019882822409272194, + -0.004883557092398405, + 0.033129431307315826, + -0.0001690524077275768, + 0.003650563769042492, + 0.009011825546622276, + -0.020063575357198715, + -0.02286524698138237, + -0.02081240899860859, + 0.03661538287997246, + -0.036073122173547745, + 0.013750134035944939, + 0.023162197321653366, + 0.012846369296312332, + -0.026958009228110313, + -0.019392207264900208, + -0.006219837814569473, + 0.006013263016939163, + -0.019043613225221634, + -0.001880153315141797, + 0.003411711659282446, + -0.014305303804576397, + -0.008359823375940323, + -0.011897416785359383, + -0.015867525711655617, + -0.006100411526858807, + -0.025499075651168823, + -0.013995441608130932, + -0.0001231581118190661, + 0.021483777090907097, + -0.0021464412566274405, + -0.0072236619889736176, + -0.016525983810424805, + 0.016061190515756607, + -0.01829477958381176, + -0.018578819930553436, + -0.02680307812988758, + -0.02726787142455578, + -0.01600954681634903, + 0.028972113505005836, + 0.016371052712202072, + -0.014382769353687763, + 0.007843386381864548, + -0.014692631550133228, + -0.007055819965898991, + 0.0005442761466838419, + -0.0042799715884029865, + 0.005874470341950655, + -0.04758966714143753, + 0.010361016727983952, + 0.009818757884204388, + -0.02969512529671192, + -0.003356840228661895, + -0.003760306630283594, + 0.007772376295179129, + 0.01788162998855114, + 0.03176087513566017, + 0.22434021532535553, + 0.022206788882613182, + -0.0009489529184065759, + 0.039171744138002396, + 0.0189532358199358, + 0.022387541830539703, + 0.02620917558670044, + 0.022168057039380074, + -0.0061326888389885426, + 0.026570681482553482, + 0.0018317373469471931, + 0.016990777105093002, + 0.0008521209820173681, + 0.00717201828956604, + 0.008237170055508614, + -0.007778831757605076, + -0.04635021835565567, + -0.00758516788482666, + -0.02014104090631008, + 0.0025369965005666018, + 0.005935797467827797, + -0.024453289806842804, + -0.021767817437648773, + -0.008986003696918488, + 0.0469699427485466, + 0.013530648313462734, + -0.004231555387377739, + 0.011878049932420254, + 0.004512368235737085, + -0.006113322451710701, + -0.002269095042720437, + 0.006681403145194054, + 0.00701063172891736, + -0.0016316180117428303, + -0.02034761570394039, + -0.0013120726216584444, + -0.012181457132101059, + -0.031657587736845016, + 0.02450493350625038, + 0.022916890680789948, + -0.025938047096133232, + 0.006946077104657888, + -0.018436800688505173, + 0.0010780622251331806, + -0.02056710235774517, + 0.01331116259098053, + -0.025912225246429443, + -0.018139848485589027, + 0.030082453042268753, + 0.006636214908212423, + -0.018862860277295113, + -0.0018220541533082724, + 0.032922856509685516, + 0.027164584025740623, + 0.0049674781039357185, + 0.004890012554824352, + 0.013375717215240002, + 0.001705855829641223, + -0.0007004176150076091, + 0.022826513275504112, + -0.016525983810424805, + 0.019172722473740578, + -0.014602255076169968, + 0.027371158823370934, + -0.010109253227710724, + -0.009250677190721035, + -0.027319515123963356, + -0.0037570788990706205, + 0.015699684619903564, + -0.006100411526858807, + -9.284770203521475e-05, + -0.006997720804065466, + 0.0019172722240909934, + 0.02329130657017231, + -0.00461565563455224, + -0.013685579411685467, + 0.005170824937522411, + -0.0017203806200996041, + 0.011639198288321495, + 0.016964955255389214, + -0.008856894448399544, + -0.013788866810500622, + -0.022206788882613182, + 0.013027122244238853, + -0.008327546529471874, + -0.012026526033878326, + 0.00020344792574178427, + 0.00208027265034616, + 0.001817212556488812, + -0.00914738979190588, + 0.002096411306411028, + 0.024801885709166527, + -0.006571660283952951, + -0.006784690544009209, + 0.014279481954872608, + 0.014150372706353664, + 0.0026709474623203278, + 0.008559943176805973, + -0.009076380170881748, + 0.01402126345783472, + -0.0292819757014513, + -0.004083079751580954, + 0.020283062011003494, + 0.012194368056952953, + -0.01624194346368313, + 0.008689052425324917, + -0.011761851608753204, + 0.003563415026292205, + 0.04289009049534798, + -0.0017591133946552873, + -0.009747747331857681, + 0.00556138064712286, + 0.018656285479664803, + -0.014382769353687763, + -0.0028823637403547764, + -0.005170824937522411, + -0.0009061854798346758, + -0.016138656064867973, + 0.003221275517717004, + -0.00014050716708879918, + -0.007094552740454674, + -0.022180967032909393, + -0.03075382113456726, + 0.01372431218624115, + -0.017403926700353622, + -0.007966040633618832, + -0.03653791546821594, + 0.013052944093942642, + 0.020115219056606293, + -0.03119279257953167, + 0.00556138064712286, + -0.0019156583584845066, + 0.02409178391098976, + -0.03305196762084961, + -0.01537691056728363, + 0.016500161960721016, + 0.015854615718126297, + -0.014008352532982826, + 0.014537700451910496, + -0.018036561086773872, + -0.01507995929569006, + -0.03488531708717346, + 0.02494390495121479, + -0.013763044960796833, + 0.005593657959252596, + -0.030289027839899063, + -0.024788973852992058, + 0.003569870488718152, + -0.015893347561359406, + -0.031115327030420303, + 0.007966040633618832, + -0.0341106615960598, + -0.009812301956117153, + -0.014524789527058601, + 0.016461428254842758, + -0.0013120726216584444, + -0.003531137714162469, + 0.004305793438106775, + 0.023988496512174606, + 0.014886295422911644, + -0.023846477270126343, + 0.0060584512539207935, + 0.027319515123963356, + 0.008185526356101036, + -0.01665509305894375, + -0.011871594935655594, + -0.16247107088565826, + 0.04035954922437668, + 0.017003687098622322, + -0.0315801203250885, + 0.0046995761804282665, + 0.011096939444541931, + -0.007197840139269829, + 0.012000704184174538, + -0.010193174704909325, + 0.016099922358989716, + 0.016500161960721016, + 0.004973933566361666, + -0.01971498131752014, + -0.029798412695527077, + -0.01080644316971302, + -0.0011305127991363406, + -0.032509706914424896, + 0.009599272161722183, + 0.03225148841738701, + 0.0255507193505764, + 0.003721573855727911, + -0.015454376116394997, + 0.022929800674319267, + 0.0010328739881515503, + 4.037815870105987e-06, + 0.005090131890028715, + -0.01528653409332037, + -0.004086307715624571, + 0.016964955255389214, + -0.014718453399837017, + -0.011671475134789944, + 0.005903520155698061, + 0.016706736758351326, + 0.01484756264835596, + 0.001228151610121131, + 0.0060294014401733875, + 0.009754203259944916, + 0.005745361093431711, + -0.0023772239219397306, + 0.02664814703166485, + -0.0033051965292543173, + 0.0022109958808869123, + 0.003171245800331235, + 0.02409178391098976, + -0.016745468601584435, + 0.02391103096306324, + 0.020502546802163124, + -0.01203943695873022, + -0.01030291710048914, + -0.018824126571416855, + 0.006219837814569473, + -0.01620320975780487, + 0.008772972971200943, + -0.004564011935144663, + 0.004709259606897831, + 0.015131602995097637, + 0.03558250889182091, + 0.00420250603929162, + 0.005432271398603916, + -0.014176194556057453, + -0.007094552740454674, + -0.007417325861752033, + 0.018772482872009277, + 0.0015840090345591307, + 0.017158618196845055, + -0.015196157619357109, + 0.0010005966760218143, + -0.0034407612401992083, + -0.022710315883159637, + 0.024840617552399635, + -0.025899313390254974, + -0.025279588997364044, + 0.003889415878802538, + -0.01059986837208271, + 0.0070493645034730434, + 0.009786480106413364, + 0.0005386276170611382, + -0.005629162769764662, + -0.017765432596206665, + -0.006481283809989691, + -0.04260604828596115, + 0.0211868267506361, + -0.015699684619903564, + 0.02015395276248455, + 0.005109498277306557, + 0.010193174704909325, + -0.015325266867876053, + 0.00905055832117796, + -0.017003687098622322, + -0.018630463629961014, + 0.032303132116794586, + -0.036279696971178055, + 0.01810111664235592, + -0.03912010043859482, + 0.025060104206204414, + 0.021741995587944984, + -0.0008488932508043945, + 0.01870792917907238, + -0.006171421613544226, + -0.0001905370008898899, + 0.017726698890328407, + -0.013763044960796833, + 0.0060907285660505295, + -0.0021157776936888695, + 0.030108274891972542, + 0.015712594613432884, + -0.012491319328546524, + 0.026067156344652176, + 0.03757078945636749, + 0.004628566559404135, + -0.027990883216261864, + 0.005409677047282457, + 0.036692846566438675, + 0.027500268071889877, + -0.02289106883108616, + 0.008275902830064297, + 0.013801777735352516, + -0.018036561086773872, + 0.01994737796485424, + 0.003921693190932274, + 0.05012020841240883, + -0.028972113505005836, + -0.011878049932420254, + 0.009670281782746315, + -0.0016542121302336454, + -0.004651160445064306, + -0.09636713564395905, + 0.013298251666128635, + 0.02558945119380951, + -0.008656774647533894, + 0.0031841567251831293, + 0.026880543678998947, + 0.010722522623836994, + 0.014731364324688911, + 0.011167949065566063, + 0.014989582821726799, + 0.00011952691420447081, + -0.015118692070245743, + -0.015351088717579842, + -0.014615166001021862, + -0.004676982294768095, + 0.007178473751991987, + -0.01321433112025261, + -0.0021851740311831236, + -0.034394703805446625, + 0.0041766841895878315, + -0.0012846369063481688, + -0.02619626559317112, + -0.016900399699807167, + -0.011309969238936901, + -0.01496376097202301, + -0.0008892398909665644, + -0.024698598310351372, + 0.011548821814358234, + 0.006468372885137796, + 0.02830074541270733, + -0.0017558856634423137, + -0.025873491540551186, + -0.007081641815602779, + -0.012032981030642986, + -0.026751434430480003, + -0.028145814314484596, + -0.0124590415507555, + 0.007075186353176832, + -0.0004353402182459831, + -0.020670389756560326, + 0.004770586267113686, + -0.014860473573207855, + 0.017829986289143562, + -0.013905065134167671, + 0.024982638657093048, + -0.020954430103302002, + -0.016125744208693504, + 0.018837038427591324, + 0.02428544871509075, + -0.003297127317637205, + -0.01994737796485424, + 0.006875067017972469, + -0.003363295691087842, + -0.0033277906477451324, + 0.030314849689602852, + -0.02930779755115509, + 0.012284744530916214, + 0.007184929214417934, + -0.014731364324688911, + -0.0052805677987635136, + -0.01622903160750866, + 0.027706842869520187, + -0.007468969561159611, + 0.018875770270824432, + -0.0013758203713223338, + 0.0021916294936090708, + -0.005780866369605064, + 0.008889171294867992, + 0.020915696397423744, + -0.022193878889083862, + -0.04263187199831009, + 0.005548469722270966, + -0.019004879519343376, + 0.0062262932769954205, + -0.032561350613832474, + 0.0063715409487485886, + -0.034807853400707245, + 0.009734836407005787, + -0.003019542433321476, + 0.0006003579474054277, + -0.014524789527058601, + -0.011251870542764664, + -0.014331125654280186, + -0.005874470341950655, + 0.0014960533007979393, + 0.043561458587646484, + 0.010348105803132057, + -0.006694314070045948, + -0.0012450972571969032, + -0.03240641951560974, + -0.01913398876786232, + 0.018152760341763496, + 0.0034536721650511026, + 0.0028178091160953045, + -0.00041839462937787175, + 0.014899206347763538, + 0.0057485890574753284, + 0.01018026378005743, + 0.03811304643750191, + -0.012452586553990841, + -0.011600465513765812, + -0.007972495630383492, + -0.06326352804899216, + 0.016977865248918533, + 0.01873375102877617, + -0.010858086869120598, + 0.02577020414173603, + 0.013775955885648727, + 0.027112940326333046, + 0.013479004614055157, + -0.009851034730672836, + -0.0170553307980299, + -0.008250080980360508, + 0.032535530626773834, + -0.0118586840108037, + -0.02180655114352703, + -0.025266679003834724, + 0.008049961179494858, + 0.024195071309804916, + 0.017972007393836975, + 0.011309969238936901, + 0.010832265019416809, + -0.021341757848858833, + 0.021135183051228523, + 0.02948855049908161, + 0.013905065134167671, + -0.023975586518645287, + -0.0034924049396067858, + -0.0065361554734408855, + -0.009063469246029854, + -0.025899313390254974, + 0.005367716774344444, + 0.02161288633942604, + -0.02096734009683132, + -0.0019414802081882954, + 0.04691829904913902, + -0.027371158823370934, + -0.008914993144571781, + 0.010380382649600506, + 0.019017791375517845, + 0.007972495630383492, + -0.020902786403894424, + -0.008166159503161907, + -0.025434520095586777, + -0.0012886716285720468, + -0.022206788882613182, + -0.015234890393912792, + 0.00441230833530426, + -0.009205489419400692, + 0.00014434009790420532, + 0.04059194400906563, + -0.008133882656693459, + 0.025666916742920876, + 0.018372245132923126, + -0.005380627699196339, + -0.004631794057786465, + 0.014214927330613136, + -0.026467394083738327, + 0.02014104090631008, + 0.004031436052173376, + 0.017145708203315735, + -0.008798794820904732, + 0.026092978194355965, + 0.0026644919998943806, + 0.021470867097377777, + 0.0034859494771808386, + 0.009224855341017246, + -0.00832109060138464, + -0.020205596461892128, + -0.01195551548153162, + 0.02597677893936634, + -0.011290603317320347, + -0.008805250748991966, + 0.00395074300467968, + 0.008953725919127464, + 0.007191384676843882, + 0.028145814314484596, + -0.020838230848312378, + 0.006842789705842733, + 0.003640880575403571, + -0.010612779296934605, + 0.03465292230248451, + 0.0011087256716564298, + 0.004305793438106775, + -0.05572354793548584, + 0.0075980788096785545, + 0.017933273687958717, + 0.006468372885137796, + -0.009760658256709576, + 0.0006330387550406158, + 0.004483318421989679, + 0.01786871999502182, + 0.02407887391746044, + -0.011084028519690037, + -0.04472343996167183, + 0.004089535214006901, + -0.008140337653458118, + -0.02079949900507927, + -0.006823423318564892, + -0.015854615718126297, + -0.001550117856822908, + 0.044413577765226364, + 0.019495494663715363, + 0.012730170972645283, + 0.017765432596206665, + -0.019637515768408775, + -0.016267765313386917, + 0.006419957149773836, + -0.013943797908723354, + -0.020437993109226227, + -0.008585765026509762, + 0.004725398030132055, + 0.004215416964143515, + -0.015196157619357109, + -0.0038506831042468548, + 0.012175001204013824, + -0.020231418311595917, + 0.012142724357545376, + -0.030056631192564964, + -0.021909838542342186, + 0.003108304925262928, + 0.02263285033404827, + -0.0094766179099679, + 0.00822425913065672, + 0.013020667247474194, + 0.005596885457634926, + 0.004270288161933422, + 0.006771779619157314, + 0.02207767963409424, + 0.0013701717834919691, + 0.03057306818664074, + 0.005603340920060873, + 0.021664530038833618, + -0.025421610102057457, + -0.0067459577694535255, + -0.017533035948872566, + 0.0064038182608783245, + -0.006187560502439737, + 0.040023863315582275, + 0.004673754330724478, + 0.0036118309944868088, + 0.050404246896505356, + 0.008488932624459267, + -0.031037861481308937, + -0.002519244095310569, + -0.008508299477398396, + 0.015944991260766983, + 0.017804164439439774, + 0.010845175944268703, + -0.02598969079554081, + -0.0043832589872181416, + 0.006277936976402998, + 0.010703155770897865, + 0.023446237668395042, + -0.005651757121086121, + -0.044207002967596054, + 0.011374523863196373, + -0.03535011038184166, + 0.007488335948437452, + -0.0061940159648656845, + -5.169412816030672e-06, + -0.0012289586011320353, + 0.0037635343614965677, + 0.01103238482028246, + 0.002398204058408737, + -0.015105781145393848, + -0.01289801299571991, + -0.015480197966098785, + -0.015944991260766983, + -0.02496972680091858, + -0.018824126571416855, + 0.013672668486833572, + -0.003145423950627446, + -0.04782206192612648, + -0.010154441930353642, + 0.008863349445164204, + -0.003411711659282446, + -0.005028804764151573, + 0.004906150978058577, + 0.005093359388411045, + 0.03612476587295532, + -0.018126938492059708, + 0.017403926700353622, + -0.03473038598895073, + -0.02283942513167858, + -0.0028016704600304365, + -0.004421991761773825, + -0.005022349301725626, + 0.002007648814469576, + -0.03757078945636749 + ], "DOT") LIMIT 3; +/* end::query-vectors-idx-filtered-whole[] */ \ No newline at end of file diff --git a/modules/vector-index/examples/hyperscale-idx-data.json b/modules/vector-index/examples/hyperscale-idx-data.json new file mode 100644 index 000000000..1f539e697 --- /dev/null +++ b/modules/vector-index/examples/hyperscale-idx-data.json @@ -0,0 +1,395 @@ +// tag::query-rgb-questions-output[] +[{ + "id": "#87CEEB", + "question": "What is the color that is often linked to feelings of peace and + tranquility, and is reminiscent of the clear sky on a calm day?", + "wanted_similar_color_from_search": "sky blue", + "vector": [ + 0.024399276822805405, + -0.006973916664719582, + 0.025191623717546463, + -0.02188388630747795, + "..." + ] +}] +// end::query-rgb-questions-output[] + + +// tag::rgb-document[] +[{ + "id": "#87CEEB", + "color": "sky blue", + "brightness": 188.077, + "description": "Sky blue is a calming and serene color that evokes feelings of + tranquility. It is a light shade of blue that resembles the color + of the sky on a clear day. The color is often associated with + peace, relaxation, and a sense of openness. It can also represent + a sense of freedom and endless possibilities, as the sky seems + to stretch on forever. Sky blue is a refreshing and soothing color + that can bring a sense of calmness to any space.", + "embedding_vector_dot": [ + 0.015966663137078285, + 0.018097303807735443, + -0.005783640779554844, + -0.020661966875195503, + "..." + ] +}] +// end::rgb-document[] + +// tag::query-rgb-color[] +[{ + "color": "deep sky blue", + "description": "Deep sky blue is a calming and refreshing color that evokes + feelings of tranquility and peace. It is a shade of blue + that resembles the clear, open sky on a sunny day. This + color is often associated with serenity and relaxation, + making it a popular choice for interior design and clothing. + Its cool and calming nature makes it a perfect color for + creating a peaceful and serene atmosphere.", + "wanted_similar_color_from_search": "sky blue" + }, + { + "color": "sky blue", + "description": "Sky blue is a calming and serene color that evokes feelings of + tranquility. It is a light shade of blue that resembles the + color of the sky on a clear day. The color is often associated + with peace, relaxation, and a sense of openness. It can also + represent a sense of freedom and endless possibilities, as the + sky seems to stretch on forever. Sky blue is a refreshing and + soothing color that can bring a sense of calmness to any space.", + "wanted_similar_color_from_search": "sky blue" + }, + { + "color": "light sky blue", + "description": "Light sky blue is a soft and delicate color that evokes a sense of + tranquility and peace. It is a shade of blue that is reminiscent + of a clear, sunny day with a few fluffy clouds scattered across the + sky. This color is often associated with feelings of serenity and + relaxation, making it a popular choice for bedrooms and spa-like + environments. The lightness of this shade adds a touch of freshness + and purity, making it a perfect color for creating a calming and + inviting atmosphere.", + "wanted_similar_color_from_search": "sky blue" + } +] +// end::query-rgb-color[] + + +// tag::query-rgb-brightness[] +[{ + "color": "sky blue", + "description": "Sky blue is a calming and serene color that evokes + feelings of tranquility. It is a light shade of blue + that resembles the color of the sky on a clear day. + The color is often associated with peace, relaxation, + and a sense of openness. It can also represent a sense + of freedom and endless possibilities, as the sky seems + to stretch on forever. Sky blue is a refreshing and + soothing color that can bring a sense of calmness to + any space.", + "brightness": 188.077 + }, + { + "color": "light sky blue", + "description": "Light sky blue is a soft and delicate color that evokes + a sense of tranquility and peace. It is a shade of blue + that is reminiscent of a clear, sunny day with a few fluffy + clouds scattered across the sky. This color is often + associated with feelings of serenity and relaxation, making + it a popular choice for bedrooms and spa-like environments. + The lightness of this shade adds a touch of freshness and + purity, making it a perfect color for creating a calming + and inviting atmosphere.", + "brightness": 189.787 + }, + { + "color": "pale turquoise", + "description": "Pale turquoise is a delicate and soothing color that can be + described as a soft blend of blue and green. It has a calming + effect and can evoke feelings of tranquility and serenity. The + color is often associated with the ocean and can bring to mind + images of clear, tropical waters. It has a gentle and subtle + quality, making it a popular choice for creating a peaceful and + serene atmosphere.", + "brightness": 219.163 + } +] +// end::query-rgb-brightness[] + + +// tag::rerank-before[] +[{ + "color": "peach", + "description": "Peach is a soft and warm color that can enliven any space. It has + a delicate and gentle quality, like the softness of a peach's skin. + This color can soften the harshness of other colors and bring a sense + of warmth and comfort. It is a versatile color that can be both calming + and invigorating, making it a popular choice in interior design. Peach + is a color that evokes feelings of happiness and positivity, making it + a perfect addition to any room.", + "id": "#FF8C3C" + }, + { + "color": "apricot", + "description": "Apricot is a warm and inviting color, reminiscent of the soft glow of + a sunset. It has the ability to soften the harshness of other colors and + enliven any space it is used in. It is a delicate and soothing hue, + perfect for creating a cozy and welcoming atmosphere.", + "id": "#FB8737" + }, + { + "color": "light yellow", + "description": "Light yellow is a delicate and gentle color that can soften the overall + tone of a room. It has a bright and cheerful quality that can brighten up + any space. This color also has the ability to illuminate a room, making it + feel more open and airy. Light yellow is a perfect choice for creating + a warm and inviting atmosphere.", + "id": "#FFFFE0" + } +] +// end::rerank-before[] + +// tag::rerank-after[] +[{ + "color": "peach", + "description": "Peach is a soft and warm color that can enliven any space. It has + a delicate and gentle quality, like the softness of a peach's skin. + This color can soften the harshness of other colors and bring a sense + of warmth and comfort. It is a versatile color that can be both calming + and invigorating, making it a popular choice in interior design. Peach + is a color that evokes feelings of happiness and positivity, making it + a perfect addition to any room.", + "id": "#FF8C3C" + }, + { + "color": "light yellow", + "description": "Light yellow is a delicate and gentle color that can soften the overall + tone of a room. It has a bright and cheerful quality that can brighten up + any space. This color also has the ability to illuminate a room, making it + feel more open and airy. Light yellow is a perfect choice for creating a + warm and inviting atmosphere.", + "id": "#FFFFE0" + }, + { + "color": "apricot", + "description": "Apricot is a warm and inviting color, reminiscent of the soft glow of a + sunset. It has the ability to soften the harshness of other colors and + enliven any space it is used in. It is a delicate and soothing hue, perfect + for creating a cozy and welcoming atmosphere.", + "id": "#FB8737" + } +] +// end::rerank-after[] + + +// tag::query-rgb-distance[] +[{ + "color": "deep sky blue", + "description": "Deep sky blue is a calming and refreshing color that + evokes feelings of tranquility and peace. It is a shade + of blue that resembles the clear, open sky on a sunny + day. This color is often associated with serenity and + relaxation, making it a popular choice for interior + design and clothing. Its cool and calming nature makes + it a perfect color for creating a peaceful and serene + atmosphere.", + "wanted_similar_color_from_search": "sky blue", + "approx_distance": 0.5202313646339596 + }, + { + "color": "sky blue", + "description": "Sky blue is a calming and serene color that evokes + feelings of tranquility. It is a light shade of blue + that resembles the color of the sky on a clear day. + The color is often associated with peace, relaxation, + and a sense of openness. It can also represent a sense + of freedom and endless possibilities, as the sky seems + to stretch on forever. Sky blue is a refreshing and + soothing color that can bring a sense of calmness to + any space.", + "wanted_similar_color_from_search": "sky blue", + "approx_distance": 0.5205406483903239 + }, + { + "color": "light sky blue", + "description": "Light sky blue is a soft and delicate color that evokes + a sense of tranquility and peace. It is a shade of blue + that is reminiscent of a clear, sunny day with a few + fluffy clouds scattered across the sky. This color is + often associated with feelings of serenity and + relaxation, making it a popular choice for bedrooms and + spa-like environments. The lightness of this shade adds + a touch of freshness and purity, making it a perfect + color for creating a calming and inviting atmosphere.", + "wanted_similar_color_from_search": "sky blue", + "approx_distance": 0.5315537216573907 + } +] +// end::query-rgb-distance[] + +// tag::untuned-query-results[] +[ + [{ + "color": "pale turquoise" + }, + { + "color": "slate blue" + }, + { + "color": "cadet blue" + }, + { + "color": "teal" + }, + { + "color": "snow" + }, + { + "color": "medium turquoise" + }, + { + "color": "slate gray" + }, + { + "color": "grey" + }, + { + "color": "medium slate blue" + }, + { + "color": "linen" + } + ] +] +// end::untuned-query-results[] + +// tag::exact-query-results[] +[ + [{ + "color": "deep sky blue" + }, + { + "color": "sky blue" + }, + { + "color": "light sky blue" + }, + { + "color": "pale turquoise" + }, + { + "color": "blue" + }, + { + "color": "slate blue" + }, + { + "color": "light cyan" + }, + { + "color": "cadet blue" + }, + { + "color": "light blue" + }, + { + "color": "medium blue" + } + ] +] +// end::exact-query-results[] + +// tag::recall-rate-results[] +[{ + "total_returned_items": 10, + "matching_color_list": [{ + "color": "cadet blue" + }, + { + "color": "pale turquoise" + }, + { + "color": "slate blue" + } + ], + "matching_color_count": 3, + "recall_percentage": 30 +}] +// end::recall-rate-results[] + +// tag::recall-rate-tuned-results[] +[{ + "total_returned_items": 10, + "matching_color_list": [{ + "color": "blue" + }, + { + "color": "cadet blue" + }, + { + "color": "deep sky blue" + }, + { + "color": "light blue" + }, + { + "color": "light cyan" + }, + { + "color": "light sky blue" + }, + { + "color": "medium blue" + }, + { + "color": "pale turquoise" + }, + { + "color": "sky blue" + }, + { + "color": "slate blue" + } + ], + "matching_color_count": 10, + "recall_percentage": 100 +}] +// end::recall-rate-tuned-results[] + + +// tag::tuned-query-results[] +[ + [{ + "color": "deep sky blue" + }, + { + "color": "sky blue" + }, + { + "color": "light sky blue" + }, + { + "color": "pale turquoise" + }, + { + "color": "light cyan" + }, + { + "color": "slate blue" + }, + { + "color": "blue" + }, + { + "color": "cadet blue" + }, + { + "color": "light blue" + }, + { + "color": "medium blue" + } + ] +] +// end::tuned-query-results[] diff --git a/modules/vector-index/examples/hyperscale-idx-examples.sqlpp b/modules/vector-index/examples/hyperscale-idx-examples.sqlpp new file mode 100644 index 000000000..ba9637253 --- /dev/null +++ b/modules/vector-index/examples/hyperscale-idx-examples.sqlpp @@ -0,0 +1,239 @@ +/* tag::create-rgb-idx[] */ +CREATE VECTOR INDEX `color_desc_hyperscale` + ON `vector-sample`.`color`.`rgb`(`embedding_vector_dot` VECTOR) + WITH { "dimension":1536, "similarity":"L2", "description":"IVF8,SQ4" } +/* end::create-rgb-idx[] */ + +/* tag::rgb-entry[] */ +SELECT + d.id, + d.color, + d.brightness, + d.description, + ARRAY_CONCAT( + d.embedding_vector_dot[0:4], + ["..."] + ) AS embedding_vector_dot +FROM `vector-sample`.`color`.`rgb` AS d +WHERE d.id = "#87CEEB"; +/* end::rgb-entry[] */ + + +/* tag::query-rgb-questions[] */ +SELECT + d.id, + d.question, + d.wanted_similar_color_from_search, + ARRAY_CONCAT( + d.couchbase_search_query.knn[0].vector[0:4], + ["..."] + ) AS vector +FROM `vector-sample`.`color`.`rgb-questions` AS d +WHERE d.id = "#87CEEB"; +/* end::query-rgb-questions[] */ + +/* tag::query-rgb-with-subquery[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB"), + question_answer AS ( + SELECT wanted_similar_color_from_search + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB") +SELECT b.color, b.description, q.wanted_similar_color_from_search + FROM `vector-sample`.`color`.`rgb` AS b, question_answer as q + ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, + question_vec[0], "l2", 4) LIMIT 3; +/* end::query-rgb-with-subquery[] */ + +/* tag::create-idx-brightness[] */ +CREATE VECTOR INDEX `color_desc_hyperscale_brightness` + ON `vector-sample`.`color`.`rgb`(`embedding_vector_dot` VECTOR) + INCLUDE (`brightness`) + WITH { "dimension":1536, "similarity":"L2", "description":"IVF8,SQ4" } +/* end::create-idx-brightness[] */ + +/* tag::query-rgb-with-brightness[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB") +SELECT b.color, b.description, b.brightness + FROM `vector-sample`.`color`.`rgb` AS b + WHERE b.brightness > 170.0 + ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, + question_vec[0], "l2", 4) LIMIT 3; +/* end::query-rgb-with-brightness[] */ + +/* tag::create-rgb-no-persist[] */ +CREATE VECTOR INDEX `color_desc_hyperscale_no_persist` + ON `vector-sample`.`color`.`rgb`(`embedding_vector_dot` VECTOR) + WITH { "dimension":1536, "similarity":"L2", "description":"IVF8,SQ4", + "persist_full_vector": false}; +/* end::create-rgb-no-persist[] */ + +/* tag::rerank-before-example[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#FFFFE0") + SELECT b.color, b.description, b.id + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, question_vec[0], "l2", 4) + LIMIT 3; +/* end::rerank-before-example[] */ + +/* tag::rerank-after-example[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#FFFFE0") + SELECT b.color, b.description, b.id + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, question_vec[0], "l2", 4, TRUE) + LIMIT 3; +/* end::rerank-after-example[] */ + + +/* tag::query-rgb-with-distance[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB"), + question_answer AS ( + SELECT wanted_similar_color_from_search + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB") +SELECT b.color, b.description, q.wanted_similar_color_from_search, approx_distance + FROM `vector-sample`.`color`.`rgb` AS b, question_answer as q, + APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, question_vec[0], "l2", 4) + as approx_distance + ORDER BY approx_distance LIMIT 3; +/* end::query-rgb-with-distance[] */ + +/* tag::untuned-query[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB" + ), +colors AS ( + SELECT b.color + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, question_vec[0], "l2") + LIMIT 10 ) +SELECT RAW colors; +/* end::untuned-query[] */ + + +/* tag::exact-query[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB" + ), +colors AS ( + SELECT b.color + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY VECTOR_DISTANCE(b.embedding_vector_dot, question_vec[0], "l2") + LIMIT 10 ) +SELECT RAW colors; +/* end::exact-query[] */ + +/* tag::recall-rate-query[] */ +-- Get the vector for the question +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB" +), +-- Exact Search results +GroundTruthResults AS ( + SELECT b.color + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY VECTOR_DISTANCE(b.embedding_vector_dot, + question_vec[0], "l2") LIMIT 10 +), +-- Approximate Search results +ApproximateResults AS ( + SELECT b.color + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, + question_vec[0], "l2") LIMIT 10 +) +SELECT + -- List the stats based on the merges in the following clauses + COUNT(DISTINCT gr.color) AS total_returned_items, + ARRAY_AGG(intersection_results) AS matching_color_list, + COUNT(DISTINCT intersection_results.color) AS matching_color_count, + (COUNT(DISTINCT intersection_results.color) * 100.0 / COUNT(DISTINCT gr.color)) AS recall_percentage +FROM + GroundTruthResults AS gr +LEFT JOIN + ApproximateResults AS ar ON gr.color = ar.color +LEFT JOIN + -- Use INTERSECT SELECT to find the shared members of the two result sets + (SELECT t1.color FROM GroundTruthResults AS t1 INTERSECT SELECT t2.color FROM ApproximateResults AS t2) AS intersection_results + ON gr.color = intersection_results.color; +/* end::recall-rate-query[] */ + +/* tag::recall-rate-tuned[] */ +-- Get the vector for the question +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB" +), +-- Exact Search results +GroundTruthResults AS ( + SELECT b.color + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY VECTOR_DISTANCE(b.embedding_vector_dot, + question_vec[0], "l2") LIMIT 10 +), +-- Approximate Search results, this timw with nProbes set to 4: +ApproximateResults AS ( + SELECT b.color + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, + question_vec[0], "l2", 4) LIMIT 10 +) +SELECT + -- List the stats based on the merges in the following clauses + COUNT(DISTINCT gr.color) AS total_returned_items, + ARRAY_AGG(intersection_results) AS matching_color_list, + COUNT(DISTINCT intersection_results.color) AS matching_color_count, + (COUNT(DISTINCT intersection_results.color) * 100.0 / COUNT(DISTINCT gr.color)) AS recall_percentage +FROM + GroundTruthResults AS gr +LEFT JOIN + ApproximateResults AS ar ON gr.color = ar.color +LEFT JOIN + -- Use INTERSECT SELECT to find the shared members of the two result sets + (SELECT t1.color FROM GroundTruthResults AS t1 INTERSECT SELECT t2.color FROM ApproximateResults AS t2) AS intersection_results + ON gr.color = intersection_results.color; +/* end::recall-rate-tuned[] */ + + +/* tag::tuned-query[] */ +WITH question_vec AS ( + SELECT RAW couchbase_search_query.knn[0].vector + FROM `vector-sample`.`color`.`rgb-questions` + WHERE meta().id = "#87CEEB" + ), +colors AS ( + SELECT b.color + FROM `vector-sample`.`color`.`rgb` AS b + ORDER BY APPROX_VECTOR_DISTANCE(b.embedding_vector_dot, question_vec[0], "l2", 4) + LIMIT 10 ) +SELECT RAW colors; +/* end::tuned-query[] */ + +/* tag::train-list[] */ +CREATE VECTOR INDEX `squad-context-index` +ON `demo`.`squad`.`context`(`vector` VECTOR) + WITH { "dimension":384, "similarity":"L2", + "description":"IVF,SQ8", + "train_list":15000}; +/* end::train-list[] */ diff --git a/modules/vector-index/pages/composite-vector-index.adoc b/modules/vector-index/pages/composite-vector-index.adoc new file mode 100644 index 000000000..747974123 --- /dev/null +++ b/modules/vector-index/pages/composite-vector-index.adoc @@ -0,0 +1,468 @@ += Filtered Searches Using Composite Vector Index +:page-topic-type: guide +:page-ui-name: {ui-name} +:page-product-name: {product-name} +:description: A Composite Vector index is a Global Secondary Index (GSI) with a single vector column that combines scalar queries with semantic search. +:stem: +:page-toclevels: 3 +:index-name: Composite Vector index +:index-name-plural: Composite Vector indexes + +{description} +The added vector column lets your application perform a query using both the index's scalar, array, and object index entries to pre-filter the dataset before performing a vector similarity search. + +== How the Composite Vector Index's Vector Column Works + +The Composite Vector index's single vector column enables semantic and similarity searches within your {sqlpp} queries. +When creating the index, you use a `VECTOR` key attribute to identify the key that contains the embedded vectors. + +When your query contains an embedded vector, the Query Service uses any non-vector predicates in the query to filter index entries. +Then it performs a vector similarity search to locate semantically related vectors. +Handling the non-vector predicates first reduces the number of vector similarity comparisons the Query Service must do to find similar vectors. + +== Prerequisites + +* You must have the Index Service enabled on at least one node in your cluster. +For more information about how to deploy a new node and Services on your database, see xref:manage:manage-nodes/node-management-overview.adoc[]. + +* You must have a bucket with scopes and collections in your database. +For more information about how to create a bucket, see xref:manage:manage-buckets/create-bucket.adoc[]. + +* Your account must have the xref:learn:security:roles.adoc#query-manage-index[Query Manage Index] or an administrator role to be able to create an index. + +* You have documents in a collection that contain one or more vector embeddings. +You can add a single vector to a Composite Vector index. +If your documents contain multiple embedded vectors, you can create multiple indexes---one for each vector attribute. ++ +Embeddings can be an array of floating point numbers or a base64 encoded string. +Couchbase {product-name} does not embed vectors itself. +You must use an external embedding model to embed vectors into your data and add them to your documents. ++ +[TIP] +-- +include::vector-search:partial$download-sample-partial.adoc[] +-- + +* You must know the number of dimensions the vector contains. +The embedding model you use to embed the vectors may determine this value for you. +For example, OpenAI API's `text-embedding-ada-002` embedding model that embedded the sample data demonstrated later in this page creates vectors that have 1536 dimensions. + +* You must decide what distance metric and quantization you want your index to use. +The metrics affect how the index compares vectors. +The quantization determines how much memory your index uses and the amount of processing Couchbase {product-name} must perform to train and search them. +See xref:vector-index:vectors-and-indexes-overview.adoc#vector_similarity[Vector Similarity Metrics] and xref:vector-index:vectors-and-indexes-overview.adoc#quantization[Quantization] for more information. + + +[#create-index] +ifeval::['{product-name}' == 'Capella'] +include::vector-index:partial$create-composite-index-capella-ui.adoc[] + +== Create a Composite Vector Index Using SQL++ +endif::[] +ifeval::['{product-name}' == 'Server'] +== Create a Hyperscale Vector Index +endif::[] + +Creating a Composite Vector index is similar to creating a non-vector GSI index. +See xref:guides:create-index.adoc[] for an overview of creating indexes. +In the `CREATE INDEX` statement to create the Composite Vector index, add the `VECTOR` lead key attribute after the vector's key name to declare it as an embedded vector. + +You must also use the xref:n1ql:n1ql-language-reference/createindex.adoc#index-with[`WITH`] clause to specify some additional information for the vector column. +The format for this clause with the most commonly used parameters is: + +[source,sqlpp] +---- +WITH { "dimension": , + "similarity":, + "description": + }; +---- + +NOTE: The `WITH` clause can contain other parameters that affect how the index processes vectors. +For a full list of these parameters, see xref:n1ql:n1ql-language-reference/createindex.adoc#index-with[WITH Clause] in the {sqlpp} for Query Reference. + +* `dimensions` is an integer value that sets the number of dimensions in the vector. +This value is set by the embedded model you used to embed the vectors. +* `similarity-metric` is a string that sets the distance metric to use when comparing vectors during index creation. ++ +include::partial$distance-metric-list.adoc[] + ++ +For the greatest accuracy, use the distance function you plan to use when querying vector data. +* `centroids-and-quantization` is a string containing the settings for the quantization and index algorithms. +See <<#algo_settings>> in the next section for more information. + +For a full list of the parameters that affect a Composite Vector index, see xref:n1ql:n1ql-language-reference/createindex.adoc[]. + +include::partial$index-algorithm-settings.adoc[] + +[#examples] +=== Examples + +The following examples show you how to create two Composite Vector index with a vector column using sample data. +They both use the data from the `color_data_2vectors.zip` file mentioned earlier. + +The following query gets a single document from the `rgb` collection in the `vector-sample` bucket's `color` scope. +It truncates the `embedding_vector_dot` attribute to the first four values to improve readability. + +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=get-sample-doc] +---- + +The result of running this query is: + +[source,json] +---- +include::vector-index:example$composite-vector-data.json[tag=sample-doc] +---- + +==== Index the RGB Values + +The `rgb.json` file's `colorvect_l2` attribute defines an array containing the RGB values for the entry's color. +While this technically is not an embedded vector, you can still create a vector index column for this array. +The following example creates a Composite Vector index for this attribute as an embedded vector as well as the color's name and brightness. + +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=create-rgb-idx] +---- + +In this example: + +* The number of dimensions is 3, because there are three values in the array containing the RGB value. +* The similarity function is `L2`. +This function works well to find related vectors which are close by the search vector. +In this example, finding similar colors depends more on proximity than the magnitude or alignment of the vectors. +See xref:gsi-with-vectors.adoc##vector_similarity[Vector Similarity] for a comparison of similarity functions. +* The `description` lets Couchbase {product-name} decide the number of centroids for the IVF algorithm. +It also chooses to use Scalar Quantization with an 8-bit index, splitting each dimension into 256 bins. +This setting does not actually save any space in the index, as each of the RGB dimensions are already 8-bit values. +However, in this example, memory use is not a concern as the dataset is small. + +The result of running example is: + +[source,json] +---- +[ + { + "id": "f572fa0b1c7358ee", + "name": "color_vectors_idx", + "state": "online" + } +] +---- + +==== Create a Composite Vector Index Using the Embedded Vectors + +The `embedding_vector_dot` attribute contains the embedded vectors for the text in the `description` attribute. +The data sample shown in <<#examples>> truncated this attribute to several values. +The embedded vector contains 1536 dimensions. + +The following example creates a Composite Vector index that indexes the embedded vectors in the `embedding_vector_dot` as well as indexing the scalar `color` that contains the color's name and `brightness.` + +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=create-vectors-idx] +---- + +This example uses the Dot Product similarity function. +This function works better with the embedded text content than the Euclidean function used in the previous example. +It also uses the same algorithms as the previous example--Couchbase {product-name} chooses the number of centroids, and uses SQ quantization with 256 bins. + +If successful, Couchbase {product-name} responds with: + +[source, json] +---- +[ + { + "id": "c965205718c3e4c2", + "name": "color_desc_idx", + "state": "online" + } +] +---- + +After Couchbase {product-name} creates the index, it begins training it. +Depending on your system, this training can take several seconds. + +== Query with a Composite Vector Index Column + +You query embedded vector attributes that you have indexed in a Composite Vector index to find similar vectors and therefore similar semantic content. +To find the most similar vectors, use a `GROUP BY` clause in your query to return the most relevant vectors first. +In this clause, call one of two functions that actually performs the vector comparisons: `APPROX_VECTOR_DISTANCE` or `VECTOR_DISTANCE`. +The first of these functions is faster, but less precise. +The second is more precise, but slower. +Which you choose depends on your use case. + +You should also use a `LIMIT` clause to return just the number of vectors you need. +The query pushes the `LIMIT` clause down into the index scan so that the scan ends after finding the required number of matches. + +=== Query RGB Values + +Querying the RGB values in `rgb.colorvect_l2` requires a vector with only three values. +You can just specify the vector by hand. +The following example finds colors that are similar to gray, which has an RGB value of 128, 128, 128: + +[source, sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=query-rgb-idx] +---- + +The query uses the `APPROX_VECTOR_DISTANCE` function to sort the results. +You pass it the vector column to search, the vector to search for (in this case, the array `128, 128, 128`) and the distance function. + +For the best accuracy, use the same distance function you specified when creating the Composite Vector index (in this case, `L2`). +The query pushes the `LIMIT` clause down into the index scan, so once it finds the 5 entries that satisfy the query, it exits. + +The top result is the entry for gray. +The other results are all shades of gray: + +[source,json] +---- +[{ + "color": "grey", + "colorvect_l2": [ + 128, + 128, + 128 + ], + "brightness": 128 + }, + { + "color": "slate gray", + "colorvect_l2": [ + 112, + 128, + 144 + ], + "brightness": 125.04 + }, + { + "color": "light slate gray", + "colorvect_l2": [ + 119, + 136, + 153 + ], + "brightness": 132.855 + }, + { + "color": "light gray", + "colorvect_l2": [ + 144, + 144, + 144 + ], + "brightness": 144 + }, + { + "color": "dim gray", + "colorvect_l2": [ + 105, + 105, + 105 + ], + "brightness": 105 + } +] +---- + +You can also add other predicates to help reduce the workload of searching for similar vectors by excluding vectors. +The following example searches for colors similar to gray which has an RGB value of 128, 128, 128 and have a brightness greater than 128: + +[source, sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=query-rgb-idx-w-predicate] +---- + +The result of running this query are: + +[source, json] +---- +[{ + "color": "light slate gray", + "colorvect_l2": [ + 119, + 136, + 153 + ], + "brightness": 132.855 + }, + { + "color": "light gray", + "colorvect_l2": [ + 144, + 144, + 144 + ], + "brightness": 144 + }, + { + "color": "cadet blue", + "colorvect_l2": [ + 95, + 158, + 160 + ], + "brightness": 139.391 + }, + { + "color": "rosy brown", + "colorvect_l2": [ + 188, + 143, + 143 + ], + "brightness": 156.455 + }, + { + "color": "dark sea green", + "colorvect_l2": [ + 143, + 188, + 143 + ], + "brightness": 169.415 + } +] +---- + +=== Query the Embedded Vectors + +To query the `color_desc_idx` Composite Vector index containing the embedded vector for the description attribute, you must supply a vector. +In a production environment, your application calls the same embedding model it called to generate the embedded vectors in your documents to generate a vector for the query value. + +For this example, you can use embedded vectors in the `rgb_questions.json` file that's in the `color_data_2vectors.zip` file. +This file contains a `question` attribute containing a search prompt for a particular color. +The following query gets a single document from the `rgb_questions` collection in the `vector-sample` bucket's `color` scope. +It truncates the `couchbase_search_query.knn.vector` attribute to the first four values to improve readability. + +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=get-sample-doc-question] +---- + +The result of the query shows the content of one of the documents: + + +[source,json] +---- +include::vector-index:example$composite-vector-data.json[tag=sample-doc-question] +---- + +The `couchbase_search_query.knn.vector` attribute contains the embedded vector for the `question` attribute. + +This example queries the `embedding_vector_dot` column. +It appears here with most of the 1536 vectors omitted: + +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=query-vectors-idx-truncated] +---- + +You can expand the following section to see and copy the entire query with all the vectors: + +.Show full example +[%collapsible] +==== +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=query-vectors-idx-whole] +---- +==== + +Another option is to import the `rgb_questions.json` file into another collection in the `vector-sample` bucket's `color` scope named `rgb-questions`. +Then you can use a subquery to get the vectors for the question and use it in your query of the `rgb` collection's `embedding_vector_dot` attribute: + +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=query-vectors-idx-subquery] +---- + +In either case, the results of the query are the same: + +[source,json] +---- +[ + { + "color": "cantalope", + "description": "The color cantaloupe is a soft and soothing shade that evokes feelings of calmness + and relaxation. It is a refreshing hue that brings to mind the juicy and sweet fruit it is named + after. This delicate color is a pale orange with hints of pink, giving it a subtle and gentle + appearance. It is a perfect color for creating a peaceful and tranquil atmosphere." + }, + { + "color": "papaya whip", + "description": "Papaya whip is a soft and mellow color that can be described as a light shade of + peach or coral. It has a calming and soothing effect, similar to the tropical fruit it is named + after. This color is perfect for creating a warm and inviting atmosphere, and it pairs well with + other pastel shades or neutral tones. Papaya whip is a versatile color that can be used in both + fashion and interior design, adding a touch of elegance and sophistication to any space." + }, + { + "color": "apricot", + "description": "Apricot is a warm and inviting color, reminiscent of the soft glow of a sunset. It + has the ability to soften the harshness of other colors and enliven any space it is used in. It is a + delicate and soothing hue, perfect for creating a cozy and welcoming atmosphere." + } +] +---- + +The second result, the color papaya whip, matches the `rgb_questions` collection's `wanted_similar_color_from_search` attribute. + +=== Adding a Scalar + +Using additional scalar fields in your search can improve your results and reduce the overhead of performing a vector search. +For example, filtering on an additional scalar field reduces the number of vectors an index scan has to compare. +Searching for scalar values requires less resources than vector searches. + +The example that created the `color_desc_idx` index added fields in addition to the `embedding_vector_dot` vector field. +The following example adds a filter based on the `brightness` field to reduce the number of vectors that get compared and also improve the results. + +The version of the query that performs a subquery of the `rgb-questions` to get the vector value is: + +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=query-vectors-idx-subquery-filtered] +---- + +The truncated version of the query is: + +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=query-vectors-idx-filtered-truncated] +---- + +You can expand the Show full example section to see and copy the entire query with all the vectors: + +.Show full example +[%collapsible] +==== +[source,sqlpp] +---- +include::vector-index:example$gsi-vector-idx-examples.sqlpp[tag=query-vectors-idx-filtered-whole] +---- +==== + +The results of this query moves the papaya whip entry to the top. + +[source,json] +---- +[{ + "color": "papaya whip", + "description": "Papaya whip is a soft and mellow color that can be described as a light shade of peach or coral. It has a calming and soothing effect, similar to the tropical fruit it is named after. This color is perfect for creating a warm and inviting atmosphere, and it pairs well with other pastel shades or neutral tones. Papaya whip is a versatile color that can be used in both fashion and interior design, adding a touch of elegance and sophistication to any space.", + "brightness": 240.82 + }, + { + "color": "pale turquoise", + "description": "Pale turquoise is a delicate and soothing color that can be described as a soft blend of blue and green. It has a calming effect and can evoke feelings of tranquility and serenity. The color is often associated with the ocean and can bring to mind images of clear, tropical waters. It has a gentle and subtle quality, making it a popular choice for creating a peaceful and serene atmosphere.", + "brightness": 219.163 + }, + { + "color": "light green", + "description": "Light green is a calming and refreshing color that evokes feelings of tranquility and new beginnings. It is a delicate shade that is often associated with nature and growth. The softness of this color can bring a sense of balance and harmony to any space, making it a popular choice for interior design. Light green is also known to have a rejuvenating effect, making it a perfect color for relaxation and self-care. Its gentle hue can bring a sense of peace and serenity to the mind, body, and soul.", + "brightness": 199.178 + } +] +---- diff --git a/modules/vector-index/pages/hyperscale-filter.adoc b/modules/vector-index/pages/hyperscale-filter.adoc new file mode 100644 index 000000000..4cf963392 --- /dev/null +++ b/modules/vector-index/pages/hyperscale-filter.adoc @@ -0,0 +1,57 @@ += Use Scalar Columns to Filter Hyperscale Vector Index Scans +:page-topic-type: guide +:page-ui-name: {ui-name} +:page-product-name: {product-name} +:description: You can reduce the number of vectors a query that uses a Hyperscale Vector index by adding scalar values. +:stem: +:page-toclevels: 3 +:index-name: Hyperscale Vector index +:index-name-plural: Hyperscale Vector indexes + +[abstract] +{description} +A Hyperscale Vector index has a single column that indexes the vector. +However, you can include scalar values in the index that you can use to filter the vector search. +The index stores these included values along with the vector, but they're not indexed. + +In your queries that use a Hypserscale Vector index, you add the included scalar values as predicates in the `WHERE` clause. +During the index scan, Couchbase {product-name} uses the included scalar values to filter out vectors that do not meet the filter restriction. +If the filter matches the entry, Couchbase {product-name} performs the more expensive vector comparison operation to determine the distance between the vector value and the search vector. + +== Creating a Hyperscale Vector Index with Included Scalar Values + +When you create a Hyperscale Vector index, you can add scalar values to the index using the `INCLUDE` clause in the `CREATE VECTOR INDEX` statement. + +The following example creates a new Hyperscale Vector index for the `embedding-vector-dot` vector column from the xref:vector-index:hyperscale-vector-index.adoc#query-example[Hyperscale Vector Index Query Example]. +It also includes the `brightness` key from the document. + + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=create-idx-brightness] +---- + +This example is the same as the example from xref:vector-index:hyperscale-vector-index.adoc#examples[Create Hyperscale Vector Index Example], except that it adds the `INCLUDE` clause to add the `brightness` key. + +== Querying a Hyperscale Vector Index with Included Scalar Values + +When you query a Hyperscale Vector index, you can use the included scalar values as predicates in the `WHERE` clause of your query. +Couchbase {product-name} uses the predicates to filter the results before performing the vector comparison. + +The following example performs the same query as the example from xref:vector-index:hyperscale-vector-index.adoc#example[Query with a Hyperscale Vector Index], but adds the `brightness` key as a predicate in the `WHERE` clause: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=query-rgb-with-brightness] +---- + +The result of running the query is: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=query-rgb-brightness] +---- + +Querying with the `brightness` attribute changes makes `sky blue` the top result compared to the results from the example in xref:vector-index:hyperscale-vector-index.adoc#query-example[Query with a Hyperscale Vector Index]. +The restriction can also make the query faster. +On a laptop running a three-node cluster in Docker containers, the query ran in (43{nbsp}ms verses 219{nbsp}ms for the query without the filter. diff --git a/modules/vector-index/pages/hyperscale-reranking.adoc b/modules/vector-index/pages/hyperscale-reranking.adoc new file mode 100644 index 000000000..56c1d77fb --- /dev/null +++ b/modules/vector-index/pages/hyperscale-reranking.adoc @@ -0,0 +1,89 @@ += Hyperscale Vector Index Reranking and Full Vector Persistence +:page-title: Reranking and Full Vector Persistence +:page-topic-type: guide +:page-ui-name: {ui-name} +:page-product-name: {product-name} +:description: You can enable reranking in queries using a Hyperscale Vector index to potentially improve the query results. +:stem: +:page-toclevels: 3 +:index-name: Hyperscale Vector index +:index-name-plural: Hyperscale Vector indexes + +[abstract] +{description} +It uses non-quantized versions of the search and indexed vectors to return more accurate results. +After the query locates similar vectors in the index, it performs a second round of comparisons using the full vector values stored in the index to reorder the results. +This reranking can make the most relevant vectors to the search vector appear higher in the search results. + +== Enabling Reranking + +To enable reranking, your index must have a copy the full vector value in addition to the quantized value. +The `CREATE VECTOR INDEX` statement adds this copy of the full vector value to the index by default. + +Queries do not perform reranking by default. +To enable it, you must pass `TRUE` as the fifth parameter in the `APPROX_VECTOR_DISTANCE` function call in your query. + +For example, the following query on the sample RGB dataset does not perform reranking: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=rerank-before-example] +---- + +The results of this query are: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=rerank-before] +---- + +The color that's most relevant to the search vector, `#FFFFE0` Light Yellow, is third in the results. + +The following query enables reranking by passing `TRUE` as the fifth parameter in the `APPROX_VECTOR_DISTANCE` function call: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=rerank-after-example] +---- + +The results of this query are: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=rerank-after] +---- + +The result for Light Yellow improved from position 3 to position 2. + +[#prevent-vector-persistence] +== Preventing Vector Persistence + +Reranking can improve the accuracy of recall in some cases. +However, it always decreases queries per second (QPS) when enabled. +In many cases, you can achieve acceptable recall accuracy without reranking. +See xref:vector-index:vector-index-best-practices.adoc#reranking[Reranking] to learn in which cases reranking is useful. + +Storing the full vector significantly increases the size of the index. +If you do not plan to use reranking, you can save space in your index by having it not save the full vector value. + +To prevent an index from persisting the full vector, set the `persist_full_vector` attribute to `False` in the `WITH` clause of the `CREATE VECTOR INDEX` statement you use to create it: + +[source,sqlpp] +---- +WITH { "dimension": , + "similarity":, + "description":, + "persist_full_vector":false + }; +---- + +The following example creates a Hyperscale Vector index from the example RGB dataset that does not persist the full vector value: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=create-rgb-no-persist] +---- + +The size of the resulting index is much smaller than the index that persists the full vector value (269KiB verses 1.17MiB). + +The actual savings you see in your own indexes depends on the number of dimensions in your vectors. diff --git a/modules/vector-index/pages/hyperscale-vector-index.adoc b/modules/vector-index/pages/hyperscale-vector-index.adoc new file mode 100644 index 000000000..62f5f018c --- /dev/null +++ b/modules/vector-index/pages/hyperscale-vector-index.adoc @@ -0,0 +1,280 @@ += Vector Searches Using Hyperscale Vector Indexes +:page-topic-type: guide +:page-ui-name: {ui-name} +:page-product-name: {product-name} +:description: Hyperscale Vector Indexes are optimized to index a single vector column. They offer the highest performance of any index when it comes to vector data. +:stem: +:page-toclevels: 3 +:index-name: Hyperscale Vector index +:index-name-plural: Hyperscale Vector indexes + +[abstract] +{description} +They can scale up to a billion documents containing vectors with a large number of dimensions. + +Because they provide the best performance, consider testing a Hyperscale Vector index for your application before resorting to the other types of indexes. +If you find theirs performance does not meet your needs, then test using a Composite Vector Index or a FTS Vector Index. + + +== How the Hyperscale Vector Index Works + +The Hyperscale Vector Index primarily relies on data stored in an optimized format on disk. +By relying on disk storage, they have lower memory requirements than other index types. + +You add a single vector column to a Hyperscale Vector Index. +The vector value can be an array of floating point values. +You can nest the array in another array as long as you use an xref:n1ql:n1ql-language-reference/unnest.adoc[`UNNEST` clause] to extract the it from the containing array. +You can also store the vector in a BASE64 string. + +== Prerequisites + +Hyperscale Vector Indexes have the following requirements: + +* You must have the Index Service enabled on at least one node in your cluster. +For more information about how to deploy a new node and Services on your database, see xref:manage:manage-nodes/node-management-overview.adoc[]. + +* Your account must have the xref:learn:security:roles.adoc#query-manage-index[Query Manage Index] or an administrator role to be able to create an index. + +* You must have a bucket your database. +For more information about how to create a bucket, see xref:manage:manage-buckets/create-bucket.adoc[]. + +* You have documents in a collection that contain one or more vector embeddings. +You can add a single vector to a Hyperscale Vector Index. +If your documents contain multiple embedded vectors, you can create multiple indexes---one for each vector attribute. ++ +Embeddings can be an array of floating point numbers or a base64 encoded string. +Couchbase {product-name} does not embed vectors itself. +You must use an external embedding model to embed vectors into your data and add them to your documents. ++ +[TIP] +-- +include::vector-search:partial$download-sample-partial.adoc[] +-- + +* The vectors you add to an index must contain the same number of dimensions. +Also the values in the vector must be 32-bit floating point numbers. +If a vector does not meet both of these requirements, the vector index treats it as a NULL value and the document is not added to the index. + +* You must know the number of dimensions the vector contains. +The embedding model you use to embed the vectors may determine this value for you. +For example, OpenAI API's `text-embedding-ada-002` embedding model creates vectors that have 1536 dimensions. + +* You must decide whether you want to use the default distance metric and quantization for your index. +By default, a Hyperscale Vector index uses the xref:vector-index:vectors-and-indexes-overview.adoc#euclidean-squared[Euclidean distance squared] metric and xref:vector-index:vectors-and-indexes-overview.adoc#sq[Scalar Quantization (SQ)] with 8 bits per vector dimension (`SQ8`). +The metrics affect how the index compares vectors. +The quantization determines how much memory your index uses and the amount of processing Couchbase {product-name} must perform to train and search them. +See xref:vector-index:vectors-and-indexes-overview.adoc#vector_similarity[Vector Similarity Metrics] and xref:vector-index:vectors-and-indexes-overview.adoc#quantization[Quantization] for more information. + +[#create-index] +ifeval::['{product-name}' == 'Capella'] +include::vector-index:partial$create-hyperscale-index-capella-ui.adoc[] + +== Create a Hyperscale Vector Index Using SQL++ +endif::[] +ifeval::['{product-name}' == 'Server'] +== Create a Hyperscale Vector Index +endif::[] + +Use the `CREATE VECTOR INDEX` statement to create a Hyperscale Vector Index. +This statement is similar to the `CREATE INDEX` statement that you use to create Global Secondary Indexes (GSI). +See xref:guides:create-index.adoc[] for an overview of creating indexes. +You must also supply a `WITH` clause to set some additional information about the vector column that the Hyperscale index needs. + +The following syntax shows the minimum required parameters to create a Hyperscale Vector index: + +[source,sqlpp] +---- +CREATE VECTOR INDEX `` + ON ``(`` VECTOR) + WITH { "dimension": , + "similarity":, + "description": + }; +---- + +NOTE: This syntax for the `CREATE VECTOR INDEX` shows the minimum required parameters to get you started. +For the full syntax, see xref:n1ql:n1ql-language-reference/createvectorindex.adoc[`CREATE VECTOR INDEX`] in the SQL++ for Query Reference. + +The parameters in this statement are: + +* `index-name` is a string that sets the name of the index. +* `collection` is the path of the collection to index. +* `key-name` is the name of the key containing the vector that you want to index. +The key value must be an array of floating point numbers or a base64 encoded string. +* `dimensions` The number of dimensions in the vector as an integer. +The embedded model you use to embed the vectors determines the number of dimensions in the vector. +* `distance-metric` is a string that sets the distance metric to use when comparing vectors during index creation. ++ +include::partial$distance-metric-list.adoc[] + ++ +For the greatest accuracy, use the distance metric you plan to use to query the data. +* `centroids-and-quantization` is a string containing the settings for the quantization and index algorithms. +See <<#algo_settings>> in the next section for more information. + +include::partial$index-algorithm-settings.adoc[] + + +[#examples] +=== Create Hyperscale Vector Index Example + +The examples in this section use a dataset that contains information about colors including a text description of the color. +There's also a field named `couchbase_search_query.knn.vector` that contains an embedded vector for the color description. + +include::vector-search:partial$download-sample-partial.adoc[] + +The following query returns a sample document from the data in the `vector-sample.color.rgb` collection, truncating the embedded vector to 4 values to make the result readable: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=rgb-entry] +---- + +The result of running the query is: + +[#example-results] +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=rgb-document] +---- + +The following example creates an Hyperscale vector index for the vector column named `embedding-vector-dot`. + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=create-rgb-idx] +---- + +The key pieces of this example are: + +* The `CREATE VECTOR INDEX` statement creates a Hyperscale Vector index. +This differs from the `CREATE INDEX` statement used to create a Global Secondary Index (GSI). +* The `WITH` clause defines several settings specific to Hyperscale Vector indexes: +** It uses the Euclidean distance (`l2`) similarity function when locating centroids. +This function has high accuracy, which matters in a dataset with only 153 documents. +** Also, because the dataset is so small, the example sets the `description` to `IVF8,SQ4`. +This value has the xref:vector-index:vectors-and-indexes-overview.adoc#IVF[inverted file algorithm] use just 8 centroids. +It also uses 4-bit xref:vector-index:vectors-and-indexes-overview.adoc#sq[scalar quantization]. +These settings limit the fragmentation of the small dataset. + +In most cases, you'll not use these settings in a production environment. + +== Query with a Hyperscale Vector Index + +To use your Hyperscale Vector index, use the `SELECT` statement with a `ORDER BY` clause containing a call to the `APPROX_VECTOR_DISTANCE` function. +This function uses the Hyperscale Vector index when you query the vector key the index covers. + +A typical query looks like this: + +[source,sqlpp] +---- +SELECT + FROM > + ORDER BY APPROX_VECTOR_DISTANCE( + , + , + , + ] + ) LIMIT ; +---- + +NOTE: The previous query example shows just a subset of the most common parameters for the `APPROX_VECTOR_DISTANCE` function. +See xref:n1ql:n1ql-language-reference:vectorfun.adoc#approx_vector_distance[APPROX_VECTOR_DISTANCE] for the full set of parameters available in this function. + +The `APPROX_VECTOR_DISTANCE` parameters shown in the example are: + +* `collection-vector-column` is the name of the key containing the vector in the collection. +* `search-vector-value` is the vector value to search for in the collection column. +It can be an array of floating point numbers or a base64 encoded string. +* `distance-metric` is the distance metric to use when comparing the vectors. +This value should match the distance metric you used when you created the index. +* `centroids-to-probe` is an optional integer value that sets the number of centroids to probe for matching vectors. +By default, the vector search only probes a single centroid. + + +NOTE: You can also call the function xref:n1ql:n1ql-language-reference:vectorfun.adoc#vector_distance[`VECTOR_DISTANCE`] to find similar vectors. +However, this function does not use the Hyperscale Vector index to perform the vector search. +Instead, it performs a brute-force search for similar vectors. +It's useful to measure the recall of your Hyperscale Vector index. +See xref:vector-index:vector-index-best-practices.adoc#recall-accuracy[Determine Recall Rate] for more information about measuring recall. + +Also use a `LIMIT` clause to return just the number of results you need. +The query pushes the `LIMIT` clause down into the index scan so that the scan ends after finding the number of matches you need. + +[#query-example] +=== Hyperscale Vector Index Query Example + +You must supply a vector value in your query that Couchbase {product-name} can compare to the vectors in the index. +In actual use, your application generates a vector for the query value using the same embedding model it used to embed the vectors in your documents. + +To avoid the complication of calling an embedding model, this example uses embedded vectors in the `rgb_questions.json` file that's included in `color_data_2vectors.zip`. +For this example, the contents of this file are loaded into a collection named `vector-sample.color.rgb-questions`. +This collection contains a `question` attribute which is a search prompt for a particular color. +The `couchbase_search_query.knn.vector` attribute contains the embedded vector for the `question` attribute. +The following query lists several attributes from a document in the collection. +It truncates the `couchbase_search_query.knn.vector` attribute to just the first 4 dimensions of the vector for readability: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=query-rgb-questions] +---- + +The output of the query looks like this: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=query-rgb-questions-output] +---- + +To use the embedded vector, you need to include the `couchbase_search_query.knn.vector` attribute in your query's the `SELECT` statement. +You can either directly cut & paste the entire array into your query or use a subquery to retrieve it from the `vector-sample.color.rgb-questions` collection. +The following example uses a subquery to get the vector, and also includes the `wanted_similar_color_from_search` attribute in the output which shows you the color that the query should return. + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=query-rgb-with-subquery] +---- + +In this example, the `APPROX_VECTOR_DISTANCE` function compares the vector in the `couchbase_search_query.knn.vector` attribute to the vectors in the index. +The parameters the example passes to this function are: + +* The `embedding-vector-dot` is the name of the indexed vector key in the collection. +* The `couchbase_search_query.knn[0].vector` is the vector search value to compare to the vectors in the index. +This value is the result of the subquery that gets the vector from the `rgb-questions` collection. +* `l2` is the distance metric to use. +* `4` is the number of centroids to probe for matching vectors. +This value defaults to `1`. +This example sets this value to `4` because the dataset is small. +In a small dataset, it's more likely that relevant vectors are not associated with the same centroid. +This parameter broadens the search beyond a single centroid to find more relevant vectors. +If you re-run the query with the default value of `1`, you'll see that the results are less relevant. + +The result of running the query is: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=query-rgb-color] +---- + +The second result, `sky blue`, matches the `wanted_similar_color_from_search` attribute as the most relevant color to the question posed in the `question` attribute. +All of the results are still relevant to the question. + +=== Getting the Vector Distance + +You can use the `APPROX_VECTOR_DISTANCE` function as a predicate to return the distance between the search vector and the vectors in the index. +You may want to get this value when the distance is meaningful, such as when it represents a real-world measurement. + +The following example returns the distance between the search vector and the vectors in the index by adding an alias for the results of the `APPROX_VECTOR_DISTANCE` function in the `SELECT` statement as well as the `ORDER BY` clause: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=query-rgb-with-distance] +---- + +The result of running the query is: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=query-rgb-distance] +---- + diff --git a/modules/vector-index/pages/use-vector-indexes.adoc b/modules/vector-index/pages/use-vector-indexes.adoc new file mode 100644 index 000000000..4c408a184 --- /dev/null +++ b/modules/vector-index/pages/use-vector-indexes.adoc @@ -0,0 +1,284 @@ += Use Vector Indexes for AI Applications +:page-topic-type: concept +:page-ui-name: {ui-name} +:page-product-name: {product-name} +:description: Use Couchbase {page-product-name}'s vector indexes to find documents based on content similarity or semantic meaning. +:page-toclevels: 3 + +{description} + +Couchbase {product-name} supports three types of vector indexes. +You store vectors as attributes in your documents and index them using one of the three types of vector indexes. +You can then find relevant data by executing queries of the vector attributes which use the index to find similar vectors. + +As with other data types in Couchbase {product-name}, indexes make searching for similar vectors much faster. +Using indexes for vector searches is especially important due to the size of vector data. +Vectors contain hundreds to thousands of dimensions. +Using indexes reduces the resources needed to perform vector searches. + +If you're unfamiliar with vectors and vector indexing, see xref:vectors-and-indexes-overview.adoc[] for an overview. + +The three types of Couchbase {product-name} vector indexes are: + +Hyperscale Vector Indexes:: ++ +-- +* Specifically designed for vector searches +* Perform vector similarity and semantic searches faster than the other types of indexes +* Designed to scale to billions of vectors +* Most of the index resides in a highly optimized format on disk +* High accuracy even for vectors with a large number of dimensions +* Supports concurrent searches and inserts for datasets that are constantly changing +-- + ++ +Use this type of index when you want to primarily query vector values with a low memory footprint. +In general, Hyperscale Vector indexes are the best choice for most applications that use vector searches. + ++ +See xref:vector-index:hyperscale-vector-index.adoc[] for more information. + +Composite Vector Indexes:: ++ +-- +* Combines a standard xref:learn:services-and-indexes/indexes/indexing-and-query-perf.adoc#secondary-index[Global Secondary index (GSI)] with a single vector column +* Designed for searches using a single vector value along with standard scalar values that filter out large portions of the dataset. +The scalar attributes in a query reduce the number of vectors the Couchbase {product-name} has to compare when performing a vector search to find similar vectors. +* Consume a moderate amount of memory and can index billions of documents. +* Work well for cases where your queries are highly selective---returning a small number of results from a large dataset +-- + ++ +Use Composite Vector indexes when you want to perform searches of documents using both scalars and a vector where the scalar values filter out large portions of the dataset. + ++ +To learn how to use Composite Vector indexes, see xref:vector-index:composite-vector-index.adoc[]. + + +FTS Vector Index:: ++ +-- +* Combines a Couchbase {product-name} Search index with a single vector column +* Allows hybrid searches that combine vector searches with Full-Text Search (FTS) and geospatial searches. +* Can index millions of documents +-- + ++ +Use this index type when you need to perform hybrid searches that combine vectors with full-text or geospatial searches. + ++ +To learn how to use FTS Vector indexes, see xref:vector-search:vector-search.adoc[]. + +== Choosing the Right Index Type + +When choosing which type of index to use, you must consider: + +* The size of your dataset. +* Whether you need to perform hybrid searches that combine scalar value or text searches along with the vector search. +* The performance requirements of your application. + +The following table summarizes the differences between the three types of vector indexes: + + +[%autowidth] +|=== +| | Hyperscale Vector Index | Composite Vector Index | FTS Vector Index + +| *First Available in Version* +| 8.0 +| 8.0 +| 7.6 + +| *Dataset Size* +| Tens of millions to billions of documents +| Tens of millions to billion +| Tens of millions + +| *Uses* +a| * Pure vector searches +* Content discovery or recommendations +a| +* Searches combining vector and scalar values where scalar values are less selective (20% or less) +* Searches where scalars should exclude vectors, such as compliance uses +a| +* Hybrid searches combining vector and keywords or geospatial + +| *Strengths* +a| * High performance for pure vector searches +* Higher accuracy at lower quantizations (fewer bits per vector) +* Low memory footprint +* Lowest TCO for huge datasets +* Best option for concurrent updates and searches +* Scalars and vector values compared at the same time +a| +* Scalar values pre-filter data to reduce the scope of vector searches +* Efficient when scalar values have low selectivity (exclude less than 20% of dataset) +* Can restrict searches based on scalars for use cases such as compliance +* Based on familiar Global Secondary Indexes (GSI) +a| +* Combines semantic and Full-Text Search and geospatial search in a single pass +* Uses familiar Search indexes + +| *Limitations* +a| * Indexing can take longer relative to other index types +a| +* Lower accuracy than Hyperscalar when using lower quantizations (fewer bits per vector) +* Scalar values filter data before vector search, potentially missing relevant results (see <>) +a| +* Not as efficient as Composite Vector indexes if the search includes purely numeric or scalar values +* Does not scale to the extent of the other index types +Limited to approximately 100 million documents + +|=== + +[#scalar-handling] +NOTE: A key difference between Hyperscale and Composite Vector indexes is how they handle scalar values in queries. +Hyperscale Vector indexes compare vectors and scalar values at the same time. +Composite Vector indexes always apply scalar filters first, and only perform vector searches on the results. +This behavior means Composite Index searches can exclude relevant vectors from the search result. +However, it's useful for cases where you must exclude some vectors (even the nearest neighbors) based on scalar values. For example, it's useful when meeting compliance requirements. + +When choosing which type of index to use, consider the following: + +* In most cases, test using a Hyperscale Vector index. +If you find that the performance is not what you need, you can try using one of the other index types. +* If your dataset will not grow beyond 100 million documents and you need to perform hybrid searches that combine vector searches with Full-Text Search or geospatial searches, use an FTS Vector index. + +== Applications for Vector Indexes + +Each type of index works best for different types of applications. +The following sections explain several common applications for each type of vector index. +They also describe the workflow your application follows when using each type of index. + +=== Hyperscale Vector Index Applications + +Hyperscale Vector indexes contain a single vector column. +They excel at indexing huge datasets that can scale into the billions of documents. +They're optimized for pure vector searches, such as content discovery or recommendations. + +The Hyperscale Vector index works well for applications such as: + +Reverse image searches:: +Embedded vectors for images often contain up to thousands of dimensions, which Hyperscale Vector indexes handle better than other index types. + +Chatbot context matching:: +Chatbot context for workflows like retreival-augmented generation (RAG) requires a huge dataset for accurate results. +The large dataset gives the chatbot a depth of knowledge that's not necessary in simpler applications. + +Anomaly detection:: +Anomaly detection applications, such as those used in Internet of Things (IoT) sensor networks, require huge datasets to find deviations from expected patterns. +Hyperscale Vector indexes can handle the large datasets and perform these vector searches fast. + +=== Hyperscale Vector Index Application Workflow + + +After you create a Hyperscale Vector index, your application follows the workflow shown in the following diagram: + +.Application Workflow with Hyperscale Vector Indexes +[plantuml,hyperscale-vector-app-workflow,svg] +.... +include::vector-index:partial$hyperscale-vector-app-workflow.puml[] +.... + +The steps shown in the diagram are: + +. When your application loads data with a complex data field it wants to search semantically, it calls an embedding model to generate a vector for it. +. It sends the data, including the vector, to Couchbase {product-name} for storage. +. The Data Service sends the embedded vector to the Indexing Service for inclusion in the Hyperscale Vector index. +. When your application needs to search for documents related to a complex piece of data, it uses the same embedding model to generate a vector for the search value. +. It sends the vector as part of the query to the Couchbase {product-name} Query Service. +. The Query Service sends a request to the Index Service for an index scan. +. The Index Service performs an index scan in the Hyperscale Vector index to find similar vectors to the search vector. +It sends the results of the scan back to the Query Service. +. The Query Service returns query results to your application. + +See xref:vector-index:hyperscale-vector-index.adoc[] for more information about Hyperscale Vector indexes. + +=== Composite Vector Index Applications +Composite Vector indexes contain a single vector column and one or more scalar columns. +They apply scalar filters before performing a vector similarity search. +This is ideal for workflows where you want to exclude large portions of the dataset to reduce the number of vectors that the vector search has to compare. +Composite Vector indexes work well for applications such as: + +Content Recommendations:: +Viewers often want hard constraints on their searches, such as genre, language, or favorites actors or directors. +Composite Vector indexes can filter using these constraints before performing a vector similarity search on fields such as the plot description or reviews. + +Job Searches:: +Job seekers often want to filter jobs based on location, salary, or job title. +Composite Vector indexes can filter using these constraints before performing a vector similarity search on fields such as the job description or required skills. + +Supply chain management:: +Supply chain management applications often need to query based on product type, supplier, or location. +Vector similarity searches can be added to these searches to find similar demand patterns. + +=== Composite Vector Index Application Workflow + +After you create a Composite Vector index, your application follows the workflow shown in the following diagram: + +.Application Workflow with Composite Vector Indexes +[plantuml,composite-vector-app-workflow,svg] +.... +include::vector-index:partial$composite-vector-app-workflow.puml[] +.... + +The steps shown in the diagram are: + +. When your application loads data with a complex data field it wants to search semantically, it calls an embedding model to generate a vector for it. +. It sends the data, including the vector, to Couchbase {product-name} for storage. +. The Data Service sends the embedded vector along with scalar fields to the Indexing Service for inclusion in the Composite Vector index. +. When your application needs to perform a query that includes a vector, it uses the same embedding model to generate a vector for the search value. +. It sends the vector and scalar values as part of a query to the Couchbase {product-name} Query Service. +. The Query Service requests index scans for the scalar values and a vector similarity search from the Indexing Service. +. The Indexing Service performs an index scan in the Composite Vector index to find documents that match the scalar fields. +It then performs the vector similarity search on the results of the scalar index scan. +Finally, it sends the results of the similarity search back to the Query Service. +. The Query Service returns the query results to your application. + +See xref:vector-index:composite-vector-index.adoc[] for more information about Composite Vector indexes. + +[#fts] +=== FTS Vector Index Applications + +FTS Vector indexes contain a single vector column in addition to a Full-Text Search index. +Some of the applications for FTS Vector indexes include: + +E-Commerce product recommendations:: +E-Commerce applications can use scalar, text, and vector searches to find products that match a customer's search. +For example, a customer could search for red sneakers (text) that cost less than $100 (scalar) and are similar to an uploaded image of a sneaker (vector). + +Travel recommendations:: +Users often want to search for hotels using multiple criteria: + ++ +* Limiting searches to a specific area (for example, "walking distance to the Louvre") which relies on geospatial data. +* Specific keywords for features they want, such as "quiet", "romantic", or "gym", which requires Full-Text Search. +* Semantic searches of descriptions and reviews for searches that do not rely on literal text matches, such as "modern beach resort with chic décor," which requires vector searches. + ++ +An FTS vector index can combine geospatial, keyword, and semantic searches into a single index. + +Real estate searches:: +Real estate applications can use FTS Vector indexes to find properties within a search region and have floor plan similar to an uploaded image. + +=== FTS Vector Index Application Workflow + +After you create an FTS Vector index, your application follows the workflow shown in the following diagram: + +.Application Workflow with FTS Vector Indexes +[plantuml,fts-app-workflow,svg] +.... +include::vector-index:partial$fts-vector-app-workflow.puml[] +.... + +The steps shown in the diagram are: + +. When your application loads data it wants to search semantically, it calls an embedding model to generate a vector for it. +. It sends the data and the vector to Couchbase {product-name} for storage. +. The Data Service sends the embedded vector along with scalar fields to the Search Service for inclusion in the FTS Vector index. +. When your application needs to perform a search that includes a vector, it uses the same embedding model to generate a vector for the search value. +. It sends the search vector and text, geospatial, and other search values as part of a search request to the Couchbase {product-name} Search Service. +. The Search Service performs an index scan in the FTS Vector index to find documents that match the text or geospatial portions of the query. +Then it performs a vector similarity search on the results using the search vector. +. The Search Service returns results to your application. + diff --git a/modules/vector-index/pages/vector-index-best-practices.adoc b/modules/vector-index/pages/vector-index-best-practices.adoc new file mode 100644 index 000000000..91261975a --- /dev/null +++ b/modules/vector-index/pages/vector-index-best-practices.adoc @@ -0,0 +1,273 @@ += Hyperscale and Composite Vector Index Best Practices +:page-topic-type: guide +:page-ui-name: {ui-name} +:page-product-name: {product-name} +:description: When creating and querying Hyperscale and Composite Vector indexes, you have several options to set that can affect the speed and accuracy of your results. +:stem: +:page-toclevels: 3 + +[abstract] +{description} +Couchbase has tested vector indexes to determine how index creation and query settings affect the performance of Hyperscale and Composite Vector indexes. +The following sections describe the results of the testing and recommendations based on these results. + +NOTE: Most of the tests were performed using the Hyperscale Vector index. +However, many of the results also apply to Composite Vector indexes where the two index types share the same settings. + +== Tune Index Creation + +When you create a Hyperscale Vector index, you can set the parameters in the following list. +Each has the potential to affect the performance of creating the index and the speed and accuracy of queries that use the index. +For more information about these parameters: + +* For Composite Vector index, see the xref:n1ql:n1ql-language-reference/createindex.adoc#index-with[WITH Clause] in the xref:n1ql:n1ql-language-reference/createindex.adoc[] page of the {sqlpp} for Query Reference. +* For Hyperscale Vector index, see xref:n1ql:n1ql-language-reference/createvectorindex.adoc#index-with[WITH Clause] in the xref:n1ql:n1ql-language-reference/createvectorindex.adoc[] page of the {sqlpp} for Query Reference. + +[#nlist] +=== nList + +The `nList` setting controls the number of clusters (centroids) in the index. +You set the `nList` by supplying a value after the `IVF` in the `description` parameter when you create your index. +This value affects the accuracy of the index and the speed of queries that use it. +The `nList` setting defaults to the number of vectors in the dataset divided by 1000. + + + +For Composite Vector indexes, tests show that increasing `nList` beyond the default does not affect the build time of the index. +However, it does improve the queries per second (QPS) that the index can handle. +It also lowers the latency of queries that use the index. + +Hyperscale Vector indexes tend to perform better with larger centroids (smaller `nList` values). +This performance gain has to be balanced against tyhe possibility of increased disk I/O due to centroids having more vectors associated with them. + +*Recommendation:* The best practice for the `nList` depend on your vector index type: + +* If you find that your Composite Vector index query throughput and latency is not meeting your needs, you can try rebuilding the index with a larger `nList` value. + +* For Hyperscale Vector indexes, decrease the `nList` value if your working dataset fits into the bucket's memory quota. +You can also try decreasing the `nList` value if you have fast storage such as NVME connected to a high-speed PCIe interface. + +=== train_list + +The `train_list` setting controls the number of vectors that Couchbase {product-name} considers when searching for centroids in the dataset. +You set it using the `train_list` argument in the `WITH` clause when you create your index. +The default value depends on the size of the dataset: + +* If there are less than 10,000 vectors, Couchbase {product-name} samples all of the vectors. +* If there are 10,000 or more vectors, Couchbase {product-name} samples the number of vectors divided by 10 or 10 times the number of centroids, whichever is larger. +Couchbase {product-name} limits the trainlist to a maximum of 1 million vectors. + +Tests show that increasing the `trainlist` improves QPS and reduces latency, but slightly increases memory usage for the index. + +*Recommendation:* if you find that increasing the `nList` does not improve your query performance, you can try increasing the `train_list` value. + +The following example demonstrates how to set the `train_list` value when creating a Hyperscale Vector index: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=train-list] +---- + +=== Partitions + +The number of partitions the index controls how the index is split among logical shards. +This setting affects the scalability, memory distribution, and parallelism of the index. +You set this value using the `PARTITION BY` clause in the `CREATE [VECTOR] INDEX` statement. +See xref:n1ql:n1ql-language-reference/index-partitioning.adoc[] for more information about partitioning indexes. + +Tests show that increasing the number of partitions linearly reduces both the time it takes to build and train the index and index's memory use. +These changes do not affect the QPS or latency of queries that use the index. + +*Recommendation:* if the length of time it takes to build the index or the amount of memory the index uses is a concern, you can try increasing the number of partitions. + +=== Replicas +The number of replicas you set affects the fault tolerance, query throughput, and memory footprint of the index. +You set this value using the `num_replicas` key in the `WITH` clause when you create or alter your index. + +Tests show that increasing the number of replicas learly increases the QPS and linerly reduces the latency of queries that use the index. +However, it also linearly increased the memory footprint of the index. +Adding replicas does not affect the time it takes to build the index. + +*Recommendation:* if you find that your query throughput or latency is not meeting your needs, you can try increasing the number of replicas for the index if you can afford the additional memory usage. + +[#quantization] +=== Quantization +Vector indexes always use quantization to compress the vectors they index. +Couchbase {product-name} supports two quantization methods: xref:vector-index:vectors-and-indexes-overview.adoc#sq[scalar quantization (SQ)] and xref:vector-index:vectors-and-indexes-overview.adoc#pq[product quantization (PQ)]. +You set the quantization method using the `description` parameter in the `WITH` clause when you create your index. + +Couchbase tested different quantization settings using datasets that differed in size and number of dimensions. +The results of these tests appear in the following table: + +[%autowidth, options="header"] +|=== +| Dataset | Index Type | Quantization Setting | Build Time | Memory Use | Recall Accuracy | QPS | Latency + +| 100 million 128 dimensions +| Hyperscale +| SQ8 +| Lowest +| Highest +| Best +| Best +| Best + +| 5 million, 1536 dimensions +| Composite +| PQ32x8 +| Slightly higher than SQ8 +| 75% less than SQ8 +| lower than SQ8 +| Lower than SQ8 +| Lower than SQ8 + +|=== + + +NOTE: Couchbase also tested Hyperscale Vector indexes containing 1 billion vectors with 128 dimensions using SQ4 quantization. +The results showed acceptable recall accuracy and similar performance to SQ8 on smaller datasets. + + +*Recommendations:* + +* SQ8 provides the best balance between memory use and recall for lower dimensional datasets. +* If you have a low-dimensional dataset that's in the range of a billion vectors, consider using SQ4 quantization. +* Use PQ for higher-dimensional datasets if you want to reduce memory use and are willing to accept less accurate recall, decreased QPS, and increased latency. + + +// Similarity Function:: +// Sets the function the index uses when determining the similarity of vectors when identifying centroids. +// Couchbase {product-name} supports two similarity +// +// Holding off on simlarity because the best practice doc is mute on it, also lacks testing for dot? + + +== Tune Queries + +When querying a Hyperscale Vector index, you can set several parameters in the `APPROX_VECTOR_DISTANCE` function that affect the performance of the query. +The following list describes the parameters you can set in the function: + +[#nprobes] +=== nProbes + +`nProbes` sets the number of centroids in the Hyperscale Vector index to search for similar vectors. +You optionally set this value as the fourth parameter in the `APPROX_VECTOR_DISTANCE` function call in your query. +The default value for this value is 1, which only searches for similar vectors in the centroid that's closest to the search vector. + +Tests show that increasing `nProbes` beyond the default improves the accuracy of results non-linearly (larger values show diminishing improvements). +However, it caused a linear decrease in QPS and increase in latency. + +*Recommendation:* if you find that your query recall is not meeting your needs, you can try increasing the `nProbes` value. +However, increasing this value reduces QPS and increases latency. + +[#reranking] +=== Reranking + +A query can perform a reranking phase after a vector search. +This reranking phase reorders the results by comparing the full vector values of the results to the search vector. +See xref:vector-index:hyperscale-reranking.adoc[] for more information about how reranking works. +This setting is off by default. +You can enable it by passing `TRUE` as the fifth parameter in the `APPROX_VECTOR_DISTANCE` function call in your query. + +Testing shows that enabling reranking improves the accuracy of recall in limited cases and decreases QPS. + +*Recommendation:* if you find recall accuracy is not meeting your needs and you're using SQ4 or PQ128x8 or below quantization, try enabling reranking. +You must have your index set to persist the full vector value, which increases memory use. + +If you do not enable reranking, consider preventing the persistence of the full vector value in the index to reduce memory and disk use. +See xref:vector-index:hyperscale-reranking.adoc#prevent-vector-persistence[Preventing Vector Persistence] to learn how to turn off full vector persistence. + +[#recall-accuracy] +== Determine Recall Rate + +To understand how well your index and queries are performing, you can determine the recall of your queries. +To do this, compare the results of running a query using the `APPROX_VECTOR_DISTANCE` function to the results of running the same query using the `VECTOR_DISTANCE` function. +The `VECTOR_DISTANCE` function performs a brute-force full vector comparison, so it returns the most accurate results. +Based on the results of this comparison, you can decide whether you need to adjust your index or query settings to improve recall accuracy. + +IMPORTANT: The `VECTOR_DISTANCE` function is expensive to run because it compares all vectors in the dataset. +You should only use it on a testing system with a smaller dataset. + +For example, suppose you run the following query against a Hyperscale Vector index: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=untuned-query] +---- + +The results of running this query against the RGB sample dataset are: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=untuned-query-results] +---- + +You can then run the same query using the `VECTOR_DISTANCE` function to get the most accurate results. +The following example uses the `VECTOR_DISTANCE` function instead of the `APPROX_VECTOR_DISTANCE` function: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=exact-query] +---- + +Running the query returns the following results: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=exact-query-results] +---- + +You can see the results of the two queries share few common results. +You can perform a more complex query that determines the common results between the two queries and calculates the recall rate. +The following example executes both of the previous queries as subqueries, then finds the intersection of the results. +It calculates the recall rate based on the 10 results the queries return (called the recall@10 due to the sample size): + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=recall-rate-query] +---- + +The result of running the recall rate query is: + +---- +include::vector-index:example$hyperscale-idx-data.json[tag=recall-rate-results] +---- + +The recall rate shown in the example is 30%, which indicates poor results. + +A low recall rate means you need to perform some tuning to improve the recall accuracy of the query or the index. +One way to improve the recall accuracy is to increase the `nProbes` value in the `APPROX_VECTOR_DISTANCE` function call. +It increases the number of centroids the query searches for similar vectors. +See <> for more information about this setting. +The following example shows how to increase this value to `4` in the approximate vector query: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=tuned-query] +---- + +The results of running the tuned query are: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=tuned-query-results] +---- + +The results look more similar to the results of the exact query. +To verify, you can re-run the recall rate query using the new `nProbes` value. +The following example shows the recall rate query with the `APPROX_VECTOR_DISTANCE` function call updated with the new `nProbes` value: + +[source,sqlpp] +---- +include::vector-index:example$hyperscale-idx-examples.sqlpp[tag=recall-rate-tuned] +---- + +The result of this update are: + +[source,json] +---- +include::vector-index:example$hyperscale-idx-data.json[tag=recall-rate-tuned-results] +---- + +The new recall rate is 100%, which means the result of the change makes the `APPROX_VECTOR_DISTANCE` function as accurate as the `VECTOR_DISTANCE` function. +This means the query calling `APPROX_VECTOR_DISTANCE` is now returning the most accurate results possible. diff --git a/modules/vector-index/pages/vectors-and-indexes-overview.adoc b/modules/vector-index/pages/vectors-and-indexes-overview.adoc new file mode 100644 index 000000000..96cdc6ab4 --- /dev/null +++ b/modules/vector-index/pages/vectors-and-indexes-overview.adoc @@ -0,0 +1,411 @@ += Vectors and Vector Indexes +:page-topic-type: concept +:page-ui-name: {ui-name} +:stem: latexmath +:page-product-name: {product-name} +:description: This page is a high-level overview of vectors and how they work in indexes. +:page-toclevels: 3 + +[abstract] +{description} +Couchbase {product-name} supports several types of vector indexes. +These indexes let you add similarity searches to your applications without relying on external services. +This page provides an overview of vectors. +If you're already familiar with vectors, you can skip to the next page, xref:vector-index:use-vector-indexes.adoc[] for information about how to use vector indexes in your application. + +== About Vectors + +Vectors are a numerical representation of complex unstructured data such as text, images, or audio. +They distill this complex data into an array of floating-point values called dimensions. +The dimensions in vectors capture features of the data in a way that makes them easy to compare mathematically. +Similar data, such as text about the same topic or images of a similar subject, have similar vectors. +Similar vectors are close together the multi-dimensional space formed by all of the vectors in the dataset. +Vectors for dissimilar data (articles discussing two different topics for example) have vectors that are further apart in this multi-dimensional space. + +=== Finding Semantically Similar Text Data + +By comparing two vectors, you can find the similarity between the two pieces of data they represent. +This similarity goes beyond just finding parts of the data that's identical (for example, finding similar words in two pieces of text). +The vectors represent features such as the meaning of text rather than just superficial similarities. +When two pieces of data have similar vectors, they have semantically related (having similar meanings or subjects). + +For example, suppose you have three text articles. +The first is about feral cats, the second about domestic cats, and the third is about the UNIX/Linux `cat` command. +A text search for the term "cat" could return all three articles at the top of its search results due to their frequent use of the search term. +However, that does not mean that the articles are all semantically related. +By generating vectors for the articles and comparing them, you can determine any semantic relationship between them. + +Vectors can be similar in a variety of ways. +They may: + +* Point in similar directions. +* Be close to each other in the vector space made up of all the dimensions in the vectors. +* Have a similar magnitude (length). + +image::vector-space-example.svg["Three-dimensional plot showing two vectors that are close by and parallel and a third vector that's away and points in another direction"] + +Because the first two articles are about cats, their vectors point in a similar direction and are in a similar location in space. +The third article, despite using the word "cat" as frequently as the two other articles, has a vector that has significant differences from the other two. + +NOTE: Some diagrams in this document (and in other discussions available on the web) show vectors in three dimensions. +These diagrams are a simplification. +The vectors used in AI applications have hundreds to thousands of dimensions. +They're easy for computers to handle but are rather difficult for humans to visualize. +In addition, the vector dimension values in the diagrams show only 4 decimal places to conserve space. +The floating point dimensional values of actual vectors often use 6 or 7 decimal places. +When viewing these diagrams, remember that they only scratch the surface of the data encoded in a vector. + +=== Using Vectors to Find Similar Complex Data + +Vectors let you search for similarity in data that's hard to search using traditional techniques. +Image data, for example, is just a string of raw binary values. +Matching portions of this data within two image files does not mean they're of the same subject, or even have any resemblance. +Also, comparing megabytes of raw image data is computationally expensive. +Generating vectors of the images distills features of the image into a smaller, more manageable amount of data. +It also emphasizes features of the images that viewers find important, such as shapes and textures. +Comparing the vectors is more manageable and actually results in finding similar images. + +== Embedding Vectors + +Embedding is the process of generating vectors that represent a piece of complex unstructured data. +You use an embedding model that's specific to the data's type to generate a vector to represent it. + +For example, to generate vectors from text, you can use a use models such as https://en.wikipedia.org/wiki/Word2vec[Word2Vec^], https://en.wikipedia.org/wiki/GloVe[Global Vectors for Word Representation (GloVe)^], or https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2[all-MiniLM-L6-v2^]. +These models take into account the context around each potion of the text when generating a vector. +This context is what captures the semantic meaning of the text and embeds it in the vector's dimensions. + +To generate vectors from images, you use different embedding models such as a https://en.wikipedia.org/wiki/Residual_neural_network[Residual Neural Network (ResNet)^]. +You can embed audio using a model such as OpenL3. + +image::embedding-vectors.svg["Diagram showing text, image, and audio data being transformed by embedding models into a string of floating point numbers that represent vectors."] + +=== How Embedding Models Work + +Behind the scenes, embedding models use neural networks that mimic how the brain recognizes patterns. +The neural nets distill the complex data into an array of floating point values. +Beyond choosing an embedding model that's appropriate for your data, you generally do not worry about how the model transforms data into a vector. + +=== Embedding Model Compatibility + +You can only compare the similarity of vectors generated by the same embedding model. +For example, you cannot find the similarity of a vector generated by Word2Vec and one generated by GloVe. +You also cannot compare a vector for a piece of text generated by Word2Vec with the vector for an image generated by ResNet. + +=== Using Embedding Models with Couchbase {product-name} + +ifeval::['{product-name}' == 'Server'] +Couchbase {product-name} does not implement any embedding models. +You must use external embedding models to generate them and then store the resulting vectors in your documents. +A common method of embedding vectors in your database is to call an https://openai.com/index/introducing-text-and-code-embeddings/[OpenAI Embedding API^] to generate vectors for your data. +You then store the vector as an attribute in your document. + +Another option is to use Couchbase Capella along with Capella's AI Services which integrates several embedding models. +See https://www.couchbase.com/products/ai-services/[Capella AI Services] for more information. +endif::[] + +ifeval::['{product-name}' != 'Server'] +You can use external embedding models or https://www.couchbase.com/products/ai-services/[Capella AI Services] to generate vector embeddings. + +endif::[] + +[#vector_similarity] +== Vector Similarity Metrics + +Once you have embedded vectors in your database, you find documents with a similar meaning by finding similar vectors. +You use metrics to (also referred to as distance functions) to find similar vectors. +When you create an index or perform a vector search, you must specify which metric to use to compare vectors. +Each metric works best for certain applications and types of data. + +Couchbase {product-name} supports four metrics: + +[#euclidean] +=== Euclidean Distance + +Euclidean Distance (also known as L2) calculates the geometric distance between two vectors by finding the distance between the individual dimensions in the vectors. +This method is most sensitive to the distance between the vectors in space, rather than their alignment. +It's also sensitive to the scale of the vectors, where the length of one vector verses the other affects the relationship between the vectors. +Use this method when the actual distance of the vectors and their magnitudes are important. +This method is useful if the distance between vectors represents a real-world value. + +image::euclidean-distance-example.svg["Three-dimensional plot showing two vectors with points along each vector joined by dotted lines, indicating the summing of corresponding points."] + +Euclidean Distance is useful for tasks such as: + +* 3D motion capture where you're detecting similar positions or trajectories of joints, objects, where finding real-world values for thresholds is important. +* Geographic or spatial searches where you care about exact (and often real-world) distances. +* Other cases where you use the results as filters in calculations that require the actual distance between the vectors. + +NOTE: Only Hyperscale Vector and Composite Vector indexes support this metric. +FTS Vector indexes do not support it. + +[#euclidean-squared] +=== Euclidean Squared Distance + + +Euclidean Squared Distance (also known as L2 Squared or L2^2^) is similar to Euclidean Distance, but it does not take the square root of the sum distances between the vectors: + + +Euclidean Distance Formula:: + latexmath:[L2(x, y) = \sqrt{\sum_{i=1}^n (x_i - y_i)^2}] + + +Euclidean Squared Distance Formula:: +latexmath:[L2^2(x, y) = \sum_{i=1}^n (x_i - y_i)^2] + + +Because it does not take the square root of the sums, Euclidean Squared Distance is faster to calculate than Euclidean Distance. +However, it does not represent the actual distance between the vectors. +The results of a vector search using L2 Squared as a metric always returns the same rankings that an L2 search returns. +In cases where the dimensions of the vectors represent real-world values, L2 is more intuitive to use because it returns the actual distance between the vectors. + +Use this method when you need higher performance than Euclidean Distance. +It's better in cases when comparing literal distances is less important than performance and where having the ranking of search results is sufficient. + +For example: + +* Image recognition tasks where real-world distances between vectors are not a factor, including: +** Searching for products that are visually similar to an image uploaded by a shopper. +** Facial recognition. +* Audio recognition tasks such as identifying who's speaking in a recording. +* Locating similar genomic and biological sequences in a dataset, such as related gene profiles. + +NOTE: Only Hyperscale Vector and Composite Vector indexes support this metric. +FTS Vector indexes do not support it. + +[#dot] +=== Dot Product + +This metric finds related vectors by comparing the magnitude (length) and alignment of the vectors. +Here, the proximity of the vectors in space is less important than whether they point in a similar direction and have the a similar magnitude. +Vectors that point in similar directions (have a low angle between them) and have similar magnitude are strongly associated with each other. +This method uses the similarity of the vectors' magnitudes to rank their relation. + +image::dot-product-example.svg["Three-dimensional plot showing two vectors labeled with their magnitudes and the angle between them labeled with the theta symbol."] + +Use this method for tasks where ranking confidence is key. +The magnitude of the vectors is important when determining the strength of the relationship. +For example: + +* Recommending related products based on a shopper's previous purchases. +* Personalizing a music service's user home page based on the user's likes and dislikes of artists and songs. +* Targeting ads based on a user's interests and previous interactions with the service. + +[#cosine] +=== Cosine Similarity + +This metric is similar to the dot product. +However, it normalizes the vectors (making them the same length) during comparison. +Normalization means their magnitudes are not taken into account, just their alignment. +This normalization makes this method better for comparing textual data because it's less sensitive to the length of the data. +The magnitude of a vector generated by some text embedding models depend on the length of the source text. +Normalizing vector magnitudes emphasizes the semantic meaning when performing comparisons. +Therefore, Cosine Similarity can find the semantic relationship between a short question and a long article that's relevant to answering it. + +image::cosine-similarity-example.svg["Three-dimensional plot showing two vectors that are of equal length, with the angle between them labeled as theta."] + +Use this method when you're performing searches that rely on semantic meaning, such as: + +* Find relevant articles to answer a question posed by a user. +* Locate code snippets based on a user's question about how to perform a task. +* Organize scanned documents in a document management system based on their semantic meaning. + + +[#index-algorithms] +== Index Formats + +Couchbase {product-name} supports two formats that the Vector indexes use when storing their data. +These formats control how the index stores the vectors. +Couchbase {product-name} automatically chooses which algorithm to use, based on the type of the index and the size of the dataset. +However, you can set parameters when you create the index that affect how the algorithm organizes data. + +=== Flat Index +This algorithm just stores the full vector value in the index without performing any sort of optimization. +Searches using this index use a brute-force method to find similar vectors. +Adding new vectors to a flat index is fast and the index does not need training. +It also offers high precision because search compares the full vector values. +However, searching a flat index is inefficient. +The search must compare every vector in the index to find matches. +You should only use it for small data sets or for testing. + +NOTE: FTS Vector indexes use a flat index when indexing datasets with 1000 or fewer vectors. +Hyperscale Vector and Composite Vector indexes only support the next algorithm, IVF. + +[#IVF] +=== Inverted File (IVF) +This algorithm partitions the vector space to limit the number of vectors that a search must compare. +An IVF index trains itself during creation using a set of parameters you pass to it: + +. It samples vectors in the dataset to locate clusters of similar vectors. +. For each cluster it finds, it chooses a representative vector (called a centroid). +. It creates a data structure called an inverted list that associates all vectors with their closest centroid. + +image::ivf-diagram-with-vectors.svg["A plot showing clusters of points in a 3D graph labelled and assigned to centroid vectors. The centroids then point to multiple vectors in an inverted list."] + +When you search using an IVF index, it first locates the centroids that are most relevant to the vector value you're searching for. +It then searches just the vectors associated with those centroids in the inverted list. +By limiting the number of vector comparisons to just the vectors close to the relevant centroids, IVF makes vector search faster. + +A drawback of this method is the possibility that the search could miss some relevant vectors. +A search can miss vectors if they're associated with a centroid that's not relevant to the search vector. +This risk increases as you add and delete data after you train the index. +The centroids chosen during the initial training may no longer accurately represent clusters in current dataset. +See <<#index-training>> for more information about index accuracy. + +Hyperscale Vector and Composite Vector indexes always use IVF as the basis of their indexes. +In addition, they use a Hierarchical Navigable Small World (HNSW) graph to index the IVF's centroids. +This graph connects related centroids together so that a similarity search can quickly traverse the graph to find the centroids that are closest to the search vector. +Hyperscale also adds other proprietary optimizations that allow it to scale to billions of vectors. + + +FTS Vector indexes automatically uses IVF when the indexing datasets larger than 1000 vectors. + +[#quantization] +== Quantization + +Quantization simplifies vector data so it consumes less space in memory and on disk. +Reducing the amount of data in a vector also makes vector comparison faster. +However, quantization does reduce the accuracy of a vector. +It's similar to using a lossy image compression format, such as JPEG, on an picture to reduce its data size. +It trades off some detail and accuracy for a smaller, more manageable data size. + +Unlike the indexing algorithms, you choose the quantization method you want Couchbase {product-name} to use when you create a Hyperscale Vector or Composite Vector index. + +Couchbase {product-name} supports two types of quantization: + +[#pq] +=== Product Quantization (PQ) +Product Quantization simplifies vectors by breaking their dimensions into chunks called subspaces. +It then replaces each set of dimensions within the with a single value that represents the nearest centroid in the subspace. +This method reduces the size of the vector by replacing the original floating point values with smaller integers that represent the centroid. + +PQ processes vectors by following these steps: + +. It groups the vector's dimensions into chunks called subspaces. +For example, suppose the vectors contain 1024 dimensions. +Then PQ may break the vectors into 128 subspaces, each containing 8 dimensions. +. It finds groups of centroids in each subspace and adds them to a data structure called a codebook. +The codebook assigns each centroid an index number. +. PQ then reduces the size of the vectors by replacing each subspace's dimensions with the index of the closest centroid in the codebook. + + +image::pq-diagram.svg["Three-dimensional plot showing two vectors that are of equal length, with the angle between them labeled as theta."] + +PQ could quantize the vector in the previous example from 1024 64-bit floating point values to 128 8 bit or 16 bit integer values. +This data size reduction improves performance because integer operations are less computationally expensive than floating point operations. +It also reduces memory use because each vector requires less data to store (for example, from 64KB to 128 bytes). + +A search of the PQ index performs the same steps on the vector you're searching for: + +. It breaks the search vector into subspaces and quantizes it using the codebook. +. It then locates closest centroids to the quantized query vector. +. It searches the vectors related to the matching centroids for vectors that relate to the search vector. + +PQ sacrifices some accuracy because it compares quantized vectors instead of their original raw values. +The process of quantization adds additional processing requirements to training. +This overhead makes training a PQ index more computationally expensive than the other methods. +However, PQ reduces the amount of memory and processing time necessary when searching for related vectors in a large dataset. + + +Use PQ quantization when: + +* Your vectors contain a large number of dimensions. +* You're willing to trade higher processing requirements during training for smaller memory use and less CPU time during searches. +* Your dataset is large (millions to billions of vectors). + + +Hyoerscale Vector and Composite Vector indexes support PQ quantization. +FTS Vector indexes do not support it. + +[#sq] +=== Scalar Quantization (SQ) +Scalar Quantization is a simpler form of quantization than PQ. +Instead of breaking the vector into subspaces, it quantizes each dimension of the vector independently. +Its quantized vectors are larger, but are a more precise represenation than than those quantized using PQ. + + +SQ follows these steps to process vectors: + +. SQ determines the maximum and minimum values for each dimension in the dataset. +. It then partitions each dimension in the vector into equal segments (called bins) over the range of the dimension's values. +For example, in the diagram, the first dimension's values range from 0 to 1, while the second dimension's range from 0.1 to 0.9. +This means the second dimension's bins will only cover the range from 0.1 to 0.9. +. SQ assigns each bin an index value that's from 4 to 8 bits in length. +. It find a centroid within the range associated with the bin. +It saves the centroid as a 16 or 32 bit floating point number. +. SQ then quantizes the vectors by replacing their dimensional values with the index value of the bin the dimensional value falls into. + +image::sq-diagram.svg["Diagram showing each floating point dimension of a vector being converted to an 8-bit integer by looking up which bucket it falls into."] + +This quantization reduces the dimensions from 32 or 64 bit floating point values to 8 or less bit integers, reducing the memory needed for search. +It also makes search faster because integer operations are computationally less expensive than floating point operations. + +A search on an SQ index reassembles vectors before comparing them. +For each of the vector's dimensions, SQ replaces the integer bin number with the floating point centroid associated with the bin. +This recreation is an approximation of the original vector, because each dimension in the vector is the bin's centroid value instead of the original dimensional value. + +Because this method quantizes the vectors, it loses precision. +It's less precise than the PQ method (which also quantizes vectors) because it assumes that each dimension can be evenly divided. +Its accuracy suffers if your data has clusters. +It's best suited for data that's more evenly distributed and does not have high correlations. +For example, SQ may be a good fit for an IoT sensor dataset where the measured values (such as temperature) are evenly distributed over the range of measurements. + +SQ has a lower training overhead compared to PQ because it does not search for clusters of vectors. +Its training just determines the range of values for each dimension. + +Use SQ if you do not want the processing overhead of training a PQ index. +You can also use it if you have a smaller dataset (hundreds of thousands to millions of vectors). + +All three types of vector indexes support SQ quantization. + + +=== Choosing a Quantization Method + +You do not choose a quantization method for FTS vector indexes. +Instead, they automatically choose whether to use quantization: + +* FTS Vector indexes do not use quantization for datasets smaller than 10000 vectors. +* FTS Vector indexes automatically use 8-bit SQ quantization for datasets with 10000 vectors or larger. + +When creating a Hyperscale Vector or Composite Index, you choose which quantization method to use when creating the index. +When deciding, consider the following: + +* Use SQ when you want higher accuracy than PQ, at the cost of lower compression and therefore more memory use. +* Use PQ when you're willing to trade some accuracy for higher compression and less memory use. +PQ is a good choice for larger datasets (millions to billions of vectors) where you want to reduce memory use and improve search performance. + +You should also consider the potential need to retrain the index if your dataset changes over time. +See the following section for more information about index training. + +No matter which quantization you choose, you should perform tests to verify it meets your needs. +See xref:vector-index:vector-index-best-practices.adoc[] for more information about choosing quantization for your Hyperscale Vector and Composite Vector indexes. + +[#index-training] +== The Importance of Index Training + +The IVF indexing algorithm and the PQ ans SQ quantizations rely on training the index on existing data. +Both PQ and IVF locate centroids that represent clusters of vectors in vector space. +The SQ quantization samples vectors to determine the range of values in each dimension. +These training techniques reflect the content of dataset at the time you create the index. +For this training to give you accurate search results, the data in your dataset must represent the full range of data you expect to search. + +If the dataset is not representative, the centroids that the PQ quantization or IVF indexing method selects may not accurately represent clusters of data in the dataset. +Having accurate centroids are key to these indexing methods returning accurate results. +For indexes using SQ quantization, the range of values in the dimensions may not accurately represent the data in the dataset. +If one or more dimensional values fall outside the range that SQ assign bins to, they get assigned closest bin which may not properly represent the value. +As your dataset changes, these inaccuracies can build, skewing results. + +Over time, may find your vector search's recall (percentage of the nearest neighbors of the search vector returned by a query) decreases. +Searches for similar vectors may miss relevant results or may rank less-related vectors higher than more relevant results. +These inaccuracies can occur because the data in the dataset changes over time as you add and remove documents. +The centroids identified by PQ and IVF may no longer adequately reflect the data in your database. +New clusters of vectors may have developed, and old ones may have dissipated. +For indexes using SQ quantization, the range of values in the dimensions may have changed. + +To resolve these accuracy issues, you can retrain your indexes when you notice poor recall. +You can also choose to retrain indexes periodically or after you make significant changes to your dataset. +To retrain an index, you create a new index with the same (or tweaked) settings as the existing index, but with a different name. +After Couchbase {product-name} builds and trains the new index, you can drop the old index. + +You should consider the need to retrain your indexes when choosing which quantization to use. +For example, the PQ quantization requires more resources to train than SQ. +If your dataset evolves rapidly, you may choose to not use PQ because you'll need to perform more frequent retraining. diff --git a/modules/vector-index/partials/ai-app-workflow.puml b/modules/vector-index/partials/ai-app-workflow.puml new file mode 100644 index 000000000..3d8d54dae --- /dev/null +++ b/modules/vector-index/partials/ai-app-workflow.puml @@ -0,0 +1,96 @@ +@startuml ai-app-workflow + +!pragma layout smetana +!include +!include +!include +!include +!include +!include +!include +!include +!include +sprite Couchbase + + + +'title: Application Workflow with Vector Indexes + +skinparam defaultTextAlignment center + +skinparam linetype ortho + +top to bottom direction + + + frame "Your Application" as APP { + card DL [ + Data + Loading + ] + card EM [ + Embedding + Models + ] + card SE [ + Search & Query Logic + ] + + DL --> EM : <$ma_numeric_1_box{scale=0.4}>Complex\nData + EM --> DL : Vectors + SE --> EM : <$ma_numeric_4_box{scale=0.4}>Complex\nData + EM --> SE : Vectors + + } + + frame "<$Couchbase{scale=0.15}> Couchbase Cluster" as CC { + database DS [ + <$Couchbase{scale=0.15,color=red}> + .. + Data + .. + Service + .. + ] + rectangle " <$Couchbase{scale=0.15}> Index Service" as IS { + card GSI [ + GSI with + Vector + Column + ] + card VI [ + Vector + Index + ] + } + rectangle " <$Couchbase{scale=0.15}> Search Service" as SSERV { + card SI [ + Search + Index + w/ Vector + ] + } + + rectangle "<$Couchbase{scale=0.15}> Query Service" as QS { + + } + + } + + +DL ----> DS : <$ma_numeric_2_box{scale=0.4}> Data &\nVectors +DS --> GSI : Data &\nVectors +DS --> VI : Data &\nVectors +DS --> SI : <$ma_numeric_3_box{scale=0.4}>Data &\nVectors + +QS <--> IS :Index\nScans + + +SE ----> QS : <$ma_numeric_5_box{scale=0.4}>Queries +SE --------> SSERV : <$ma_numeric_5_box{scale=0.4}>Searches + +QS ----> SE :<$ma_numeric_6_box{scale=0.4}> Results +SSERV ---------> SE :<$ma_numeric_6_box{scale=0.4}> Results + +@enduml diff --git a/modules/vector-index/partials/composite-vector-app-workflow.puml b/modules/vector-index/partials/composite-vector-app-workflow.puml new file mode 100644 index 000000000..e64ef1ce6 --- /dev/null +++ b/modules/vector-index/partials/composite-vector-app-workflow.puml @@ -0,0 +1,83 @@ +@startuml ai-app-workflow + +!pragma layout smetana +!include +!include +!include +!include +!include +!include +!include +!include +!include +sprite Couchbase + + + +'title: Application Workflow with Composite Vector Indexes + +skinparam defaultTextAlignment center + +skinparam linetype ortho + +top to bottom direction + + + frame "Your Application" as APP { + card DL [ + Data + Loading + ] + card EM [ + Embedding + Models + ] + card SE [ + Search & Query Logic + ] + + DL --> EM : <$ma_numeric_1_box{scale=0.4}>Complex\nData + EM --> DL : Vectors + SE --> EM : <$ma_numeric_4_box{scale=0.4}>Complex\nData + EM --> SE : Vectors + + } + + frame "<$Couchbase{scale=0.15}> Couchbase Cluster" as CC { + database DS [ + <$Couchbase{scale=0.15,color=red}> + .. + Data + .. + Service + .. + ] + rectangle " <$Couchbase{scale=0.15}> Index Service" as IS { + card COMPOSITE [ + Composite + Vector + Index + ] + } + + rectangle "<$Couchbase{scale=0.15}> Query Service" as QS { + + } + + } + + +DL ----> DS : <$ma_numeric_2_box{scale=0.4}> Data &\nVectors +DS --> COMPOSITE : <$ma_numeric_3_box{scale=0.4}> Scalars &\nVectors + +QS --> COMPOSITE : <$ma_numeric_6_box{scale=0.4}> Scan\nRequest + +QS <-- COMPOSITE : <$ma_numeric_7_box{scale=0.4}> Index Scan\nResults + +SE ----> QS : <$ma_numeric_5_box{scale=0.4}> Queries + +QS ----> SE :<$ma_numeric_8_box{scale=0.4}> Query Results + + +@enduml diff --git a/modules/vector-index/partials/distance-metric-list.adoc b/modules/vector-index/partials/distance-metric-list.adoc new file mode 100644 index 000000000..55283c226 --- /dev/null +++ b/modules/vector-index/partials/distance-metric-list.adoc @@ -0,0 +1,8 @@ +Couchbase {product-name} uses the following strings to represent the distance metrics: ++ +-- +** `COSINE`: xref:vector-index:vectors-and-indexes-overview.adoc#cosine[Cosine Similarity] +** `DOT`: xref:vector-index:vectors-and-indexes-overview.adoc#dot[Dot Product] +** `L2` or `EUCLIDEAN`: xref:vector-index:vectors-and-indexes-overview.adoc#euclidean[Euclidean Distance] +** `L2_SQUARED` or `EUCLIDEAN_SQUARED`: xref:vector-index:vectors-and-indexes-overview.adoc#euclidean-squared[Euclidean Squared Distance] +-- diff --git a/modules/vector-index/partials/fts-vector-app-workflow.puml b/modules/vector-index/partials/fts-vector-app-workflow.puml new file mode 100644 index 000000000..2e5a3074d --- /dev/null +++ b/modules/vector-index/partials/fts-vector-app-workflow.puml @@ -0,0 +1,74 @@ +@startuml ai-app-workflow + +!pragma layout smetana +!include +!include +!include +!include +!include +!include +!include +!include +!include +sprite Couchbase + + + +'title: Application Workflow with FTS Vector Indexes + +skinparam defaultTextAlignment center + +skinparam linetype ortho + +top to bottom direction + + + frame "Your Application" as APP { + card DL [ + Data + Loading + ] + card EM [ + Embedding + Models + ] + card SE [ + Search & Query Logic + ] + + DL --> EM : <$ma_numeric_1_box{scale=0.4}>Complex\nData + EM -d-> DL : Vectors + SE --> EM : <$ma_numeric_4_box{scale=0.4}>Complex\nData + EM --> SE : Vectors + + } + + frame "<$Couchbase{scale=0.15}> Couchbase Cluster" as CC { + database DS [ + <$Couchbase{scale=0.15,color=red}> + .. + Data + .. + Service + .. + ] + + rectangle " <$Couchbase{scale=0.15}> Search Service" as SSERV { + card SI [ + FTS Vector + Index + ] + } + + } + + +DS ----> SI : Text &\nVectors +DL ----> DS : <$ma_numeric_2_box{scale=0.4}> Data &\nVectors + +SE ----> SSERV : <$ma_numeric_5_box{scale=0.4}>Searches + +SSERV ----> SE :<$ma_numeric_6_box{scale=0.4}> Results + +@enduml diff --git a/modules/vector-index/partials/hyperscale-vector-app-workflow.puml b/modules/vector-index/partials/hyperscale-vector-app-workflow.puml new file mode 100644 index 000000000..59bf46d23 --- /dev/null +++ b/modules/vector-index/partials/hyperscale-vector-app-workflow.puml @@ -0,0 +1,82 @@ +@startuml ai-app-workflow + +!pragma layout smetana +!include +!include +!include +!include +!include +!include +!include +!include +!include +sprite Couchbase + + + +'title: Application Workflow with Hyperscale Vector Indexes + +skinparam defaultTextAlignment center + +skinparam linetype ortho + +top to bottom direction + + + frame "Your Application" as APP { + card DL [ + Data + Loading + ] + card EM [ + Embedding + Models + ] + card SE [ + Search & Query Logic + ] + + DL --> EM : <$ma_numeric_1_box{scale=0.4}>Complex\nData + EM --> DL : Vectors + SE --> EM : <$ma_numeric_4_box{scale=0.4}>Complex\nData + EM --> SE : Vectors + + } + + frame "<$Couchbase{scale=0.15}> Couchbase Cluster" as CC { + database DS [ + <$Couchbase{scale=0.15,color=red}> + .. + Data + .. + Service + .. + ] + rectangle " <$Couchbase{scale=0.15}> Index Service" as IS { + card HVI [ + Hyperscale + Vector + Index + ] + } + + rectangle "<$Couchbase{scale=0.15}> Query Service" as QS { + + } + + } + + +DL ----> DS : <$ma_numeric_2_box{scale=0.4}> Data &\nVectors +DS --> HVI : <$ma_numeric_3_box{scale=0.4}> Vectors + +QS --> HVI : <$ma_numeric_6_box{scale=0.4}> Scan\nRequest +QS <-- HVI : <$ma_numeric_7_box{scale=0.4}> Index\nScan\nResult + +SE ----> QS : <$ma_numeric_5_box{scale=0.4}>Queries + +QS ----> SE :<$ma_numeric_8_box{scale=0.4}> Query\nResults + + +@enduml diff --git a/modules/vector-index/partials/index-algorithm-settings.adoc b/modules/vector-index/partials/index-algorithm-settings.adoc new file mode 100644 index 000000000..3198ae3ea --- /dev/null +++ b/modules/vector-index/partials/index-algorithm-settings.adoc @@ -0,0 +1,156 @@ +[#algo_settings] +=== Quantization and Centroid settings + +When creating an index that includes a vector field, you choose settings that affect how the index processes vectors. +The parameter named `description` is the primary setting that controls the quantization and the number of centroids Couchbase {product-name} to create the index. +Using it, you control how the index subdivides the dataset to improve performance and how it quantizes vectors to reduce memory and processing requirements. + +The `description` parameter is a string in the following format: + +[source,sqlpp] +---- +'IVF[],{PQ|SQ}' +---- + +The following sections describe the settings for centroids and quantization. + +==== Number of Centroids + +{index-name} uses several algorithms to organize its data to improve its performance. +One of these algorithms, xref:vector-index:use-vector-indexes.adoc#IVF[Inverted File (IVF)], has a setting you can adjust to control how it subdivides the dataset. +The other algorithms that {index-name} uses do not have settings you can adjust. + +The key setting for IVF is the number of centroids it allocates for the index. +This setting controls how large the centroids are. +Larger centroids have more vectors associated with them. + +You can have Couchbase {product-name} choose a number of centroids for you by not providing a value after the `IVF` in your `description` parameter. +It sets the number of centroids to the number of vectors in the dataset divided by 1000. + +You can manually set the number of centroids for the index by adding an integer value after the `IVF` in the `description` parameter. +The number of centroids you set manually must be less than the number of vectors in the dataset. + +ifeval::['{index-name}' == 'Composite Vector index'] +The number of centroids affects the performance of your {index-name} index in two ways: + +* If the index has fewer centroids, each centroid is larger (has more vectors associated with it). +In this case, a vector search has to perform more comparisons, making the search slower. +However, having fewer centroids decreases the processing required to train the index. + +* A greater number of centroids results in a greater processing cost for training. +This increase is due to the training process having to search for more data cluster to identify more centroids. +However, it reduces the number of vectors associated with each centroid. +This reduction makes search faster by limiting the number of vector comparisons during a search. +endif::[] + +ifeval::['{index-name}' == 'Hyperscale Vector index'] +{index-name-plural} perform better with larger centroids (fewer centroids in the index). +They use algorithms to skip vectors that are far away from the search vector, making searches faster even with more vectors per centroid. +Having fewer centroids can also speed up the index training process because Couchbase {product-name} has to identify fewer data clusters. +However, having more vectors per centroid can result in more disk I/O during searches because each centroid has more data associated with it. + +When choosing the number of centroids for your index, consider the following guidelines: + +* If the majority of your working data set fits into the bucket's memory quota, choose a smaller number of centroids for the index. +Having more of the working data set in memory reduces disk I/O during searches, making searches faster. +Another option is to have the fastest possible storage such as a fast NVME connected to a high-speed PCIe interface. + +* If your working data set is much larger than the bucket's memory quota, choose a larger number of centroids for the index. +This setting reduces the number of vectors associated with each centroid, which can reduce disk I/O during searches. + +endif::[] + +You may need to experiment with different numbers of centroids to find the best setting for your dataset and queries. + +See xref:vector-index:vector-index-best-practices.adoc#nlist[nList] for more guidance on choosing the number of centroids for the index. + +==== Quantization Setting + +{index-name} always uses quantization to reduce the size of vectors stored in the index. +By default, it uses +You must choose whether the index uses xref:vector-index:use-vector-indexes.adoc#sq[Scalar Quantization (SQ)] or xref:vector-index:use-vector-indexes.adoc#pq[Product Quantization (PQ)]. +See xref:vector-index:vector-index-best-practices.adoc#quantization[Quantization] for guidance on choosing the quantization method for the index. + +You select the quantization by adding a comma followed by either `PQ` or `SQ` to the `description` parameter after the IVF setting in the `description` value. + +Each quantization method has additional settings explained in the following sections. + +===== SQ Settings + +For SQ, you set the number of bits the SQ algorithm uses for the bin index value or the number of bits it uses to store the centroid for each bin. +The values for SQ that Couchbase {product-name} supports are: + +[%autowidth] +|=== +| Setting | Effect + +| `SQ4` +| SQ uses a 4-bit index value splitting each vector dimension into 16 subspaces. + +| `SQ6` +| SQ uses a 6-bit index value splitting each vector dimension into 64 subspaces. + +| `SQ8` +| SQ uses an 8-bit index value splitting each vector dimension into 256 subspaces. + +// | `SQfp16` +// | SQ uses an 8-bit index value splitting each vector dimension into 256 subspaces. +// However, it stores the centroid value as a 16-bit floating point number instead of a 32-bit floating point number. +// This cuts the memory used to store the centroids in half. + +|=== + +See xref:vector-index:vectors-and-indexes-overview.adoc#sq[Scalar Quantization] for more information about how SQ works. + + +===== PQ Settings + +If you choose to use PQ in your index, you must set two values: + +* The number of subquantizers (number of subspaces PQ splits the vector's dimensions into) to use. +This value must be a divisor of the number of dimensions in the vector. +For example, if your vector has 99 dimensions, you can only use the values 3, 9, 11, 33, and 99 for the subquantizers. +Using any other value returns an error. + +* The number of bits in the centroid's index value. +This value sets the number centroids to find in each subspace. +For example, setting this value to 8 has PQ store the index for the centroids in a byte. +This results in SQ using 256 centroids per subspace. ++ +The number of centroids you set using this value must be less than the number of vectors in the dataset. +For example, if you choose 32 for the centroid index size, your dataset must have at least 4,294,967,296 vectors in it. + +The larger you set either of these values, the more accurate the index's search results are. +The trade-off is that your index is larger, as it has to store data for more centroids. +A smaller value results in a smaller index that returns less accurate results. + +The format for the PQ settings is: + +[source,sqlpp] +---- +PQx +---- + +For example, `PQ32x8` has PQ break the vector's dimensions into 32 subspaces, each of which has 256 centroids. +See xref:vector-index:vectors-and-indexes-overview.adoc#pq[Product Quantization] for more information about how PQ works. + +==== Algorithm Settings Examples + +The following table shows several `description` values along with an explanation. + +[%autowidth] +|=== +| Setting | Effect + +| `IVF,SQ8` +| Couchbase {product-name} chooses the number of centroids the IVF algorithm uses. +The index uses Scalar Quantization with an 8-bit index, meaning it breaks each of the vector's dimensions into 256 bins. + +| `IVF1024,PQ8x8` +| IVF uses 1024 centroids to divide the dataset. +The index uses Product Quantization. +PQ breaks the vector space into 8 subspaces, each of which uses 8-bits to represent centroids in the subspace. +This settings means each subspace has 256 centroids. + +|=== + diff --git a/modules/vector-index/partials/nav.adoc b/modules/vector-index/partials/nav.adoc new file mode 100644 index 000000000..eab2f8610 --- /dev/null +++ b/modules/vector-index/partials/nav.adoc @@ -0,0 +1,15 @@ +* xref:server:vector-index:vectors-and-indexes-overview.adoc[] ++ +-- +** xref:server:vector-index:use-vector-indexes.adoc[] +** xref:server:vector-index:hyperscale-vector-index.adoc[] +*** xref:server:vector-index:hyperscale-filter.adoc[] +*** xref:server:vector-index:hyperscale-reranking.adoc[] +** xref:server:vector-index:composite-vector-index.adoc[] +** xref:server:vector-index:vector-index-best-practices.adoc[] +-- ++ +-- +include::vector-search:partial$nav.adoc[] +-- + diff --git a/modules/vector-search/partials/download-sample-partial.adoc b/modules/vector-search/partials/download-sample-partial.adoc index 1d5692ec9..e258c4d35 100644 --- a/modules/vector-search/partials/download-sample-partial.adoc +++ b/modules/vector-search/partials/download-sample-partial.adoc @@ -3,7 +3,8 @@ You can download a sample dataset to use with the procedure or examples on this https://cbc-remote-execution-examples-prod.s3.amazonaws.com/color_data_2vectors.zip[Download color_data_2vectors.zip] -To get the best results with using the sample data with the examples in this documentation, xref:guides:import.adoc[import the sample files] from the dataset into your database with the following settings: +To get the best results with using the sample data with the examples in this documentation, +xref:guides:load.adoc[import the sample files] from the dataset into your database with the following settings: * Use a bucket called `vector-sample`. * Use a scope called `color`. diff --git a/modules/vector-search/partials/nav.adoc b/modules/vector-search/partials/nav.adoc index a7ac56f5c..dc7421dc3 100644 --- a/modules/vector-search/partials/nav.adoc +++ b/modules/vector-search/partials/nav.adoc @@ -1,9 +1,9 @@ -* xref:8.0@server:vector-search:vector-search.adoc[] -** xref:8.0@server:vector-search:create-vector-search-index-ui.adoc[] -** xref:8.0@server:vector-search:create-vector-search-index-rest-api.adoc[] -** xref:8.0@server:vector-search:vector-search-index-architecture.adoc[] -** xref:8.0@server:vector-search:pre-filtering-vector-search.adoc[] -** xref:8.0@server:vector-search:run-vector-search-ui.adoc[] -** xref:8.0@server:vector-search:run-vector-search-rest-api.adoc[] -** xref:8.0@server:vector-search:run-vector-search-sdk.adoc[] -** xref:8.0@server:vector-search:fine-tune-vector-search.adoc[] +* xref:vector-search:vector-search.adoc[] +** xref:vector-search:create-vector-search-index-ui.adoc[] +** xref:vector-search:create-vector-search-index-rest-api.adoc[] +** xref:vector-search:vector-search-index-architecture.adoc[] +** xref:vector-search:pre-filtering-vector-search.adoc[] +** xref:vector-search:run-vector-search-ui.adoc[] +** xref:vector-search:run-vector-search-rest-api.adoc[] +** xref:vector-search:run-vector-search-sdk.adoc[] +** xref:vector-search:fine-tune-vector-search.adoc[]