All Products
Search
Document Center

:Partition-based queries

Last Updated:Aug 27, 2024

Overview

When OpenSearch Vector Search Edition creates an index for a document, the system calculates a hash value based on the value in a specified field by using a specific hash algorithm and allocates the corresponding document to a specific partition based on the hash value. Hash values are in the [0-65535] range. For example, you import a document that describes the information about products to OpenSearch Vector Search Edition and specify the Type field as the hash field. When OpenSearch Vector Search Edition creates an index for this document, the system obtains values from this field and calculates hash values based on the obtained values. If a value in the field is Women's clothing, the hash value is 8. Then, OpenSearch Vector Search Edition distributes data that is related to Women's clothing to a specific partition based on the hash value and the number of partitions that you specify for the document. To specify a hash field, set the hash_field parameter to Type in the xxx_cluster.json configuration file. In the preceding example, the value of the hash_field parameter is Women's clothing.

When you write a query statement, you can include one or more values of the Type field in the value of the hash_field parameter. The system executes the query statement on the partitions that are specified by the hash_field parameter.

Examples

  • Query Coat from all partitions of the general cluster.

cluster=general&&query=Coat

  • Query Coat from the partitions in which Women's clothing and Accessories are stored.

cluster=general:hash_field=Women's clothing|Accessories&&query=Coat