Promo Center

50% off for new user

Direct Mail-46% off

Learn More

Indexes

Updated at: 2024-12-09 06:30

Each document contains multiple fields, and each field contains a set of words. The purpose of an index is to speed up data retrieval. Indexes can be classified into the following types based on mappings:

  • Inverted index: stores mappings from terms to document IDs in the following format: term -> (Doc1,Doc2,...,DocN). Inverted indexes are used for retrievals to help users identify the documents that contain specific search keywords.

  • Forward index: stores mappings from document IDs to fields in the following format: document ID -> (term1,term2,...termn). Forward indexes are divided into single-value indexes and multi-value indexes based on whether single-value attributes or multi-value attributes are specified. A single-value attribute that is not of the STRING data type is fixed in length. This makes data queries efficient and allows you to update the single-value attribute. A multi-value attribute is a field that contains an indefinite number of data values. The length of a multi-value attribute is not fixed. This negatively affects query performance and prevents you from updating the multi-value attribute. After a document is retrieved, you can use a forward index to query the attributes of the document based on the document ID for statistics collection, sorting, and filtering. OpenSearch Retrieval Engine Edition supports fields of the following types in forward indexes: INT8, UINT16, INT32, INT64, FLOAT, DOUBLE, and STRING. A multi-value attribute is essentially a series of single-value attributes. Therefore, field types supported for single-value attributes correspond to field types supported for multi-value attributes. For example, INT8 corresponds to multi_int8, and STRING corresponds to multi_string.

  • Summary index: stores mappings from document IDs to summaries. The format of a summary index is similar to that of a forward index. However, in a summary index, a document ID is mapped to a collection of fields. You can use a summary index to identify the summary that corresponds to a document ID in a short period of time. Summary indexes are used to retrieve results that contain the values of the fields that you want to display. In most cases, the size of a summary is large. Summary indexes are not suitable for searches in which a large amount of summary content needs to be retrieved. Summary content can be retrieved only for documents that contain the values of the fields that you want to display. OpenSearch Retrieval Engine Edition provides a compression mechanism for summary indexes. If you enable compression for a summary index in the schema, OpenSearch Retrieval Engine Edition uses zlib to compress the summary index and then stores the compressed summary index. When OpenSearch Retrieval Engine Edition reads data from the summary index, the search engine decompresses the compressed summary index and then returns the retrieved results to the user.

    Feedback
    phone Contact Us

    Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

    alicare alicarealicarealicare