Schema

Search > Configurations > Index > Schema

Overview

A product schema serves as the structural foundation of your platform's database, outlining the logical arrangement of product attributes. It is critical to the functionality of your Search API and has a direct effect on the search experience within your platform. Adjusting the schema influences how products are indexed, found, and displayed in search results.

Schema Details

When configuring your schema, the system automatically retrieves relevant details based on the existing index. Each attribute in the schema must specify the following characteristics:

  • Uniqueness: There is a single unique ID field for each product. This field is paramount, as it uniquely identifies each entry in your database.

    • Modification Alerts: Any change to this unique ID field prompts a confirmation to prevent unintentional overrides. If a new attribute is assigned as the unique ID, the system will alert you to confirm this significant change.
    • Data Type: The unique ID typically has a data type of either String or Integer, catering to various identifier formats.
  • Attributes: Each attribute should be capable of being filtered, sorted, and modified, including the option to delete.

Adding Attributes

To expand your schema, the platform allows the addition of new attributes, which are subsequently indexed in the backend database.

Mandatory Fields (Regardless of Attribute Type)

  • Attribute Name: A descriptive title for the attribute, which is essential for identification and reference.
  • Attribute Type: The data type of the attribute (e.g., Text, Integer, Date), indicating the nature of the data it will hold.

Configurable Fields for Attributes

Following configurations are applicable for these Attribute types: text, integer, date, double, boolean, keyword, long, and url.

  • Facetable: Determines if the attribute can be used to create facets in search results, allowing users to narrow down their search based on this attribute.

    • Display Name: This is the name of the attribute as it will be displayed in the user interface.
    • Limit: Sets the maximum number of facet values to display.
    • Facet Type: Specifies the type of control that should be used for displaying the facet values.
    • Sort: Determines the order in which the facet values will be presented to the users.
    • Sort Order: Specifies the default sorting of the facet values when they are displayed.
    • Enable Scroll: When checked, allows users to scroll through the list of facet values.
    • Enable Search: Provides a search box within the facet.
    • Multi Select: Allows users to select multiple values within the facet.
    • Stats: Shows summary statistics for this numeric attribute in search results.
  • Sortable: If enabled, users can sort search results based on this attribute.

    • Enable this to make the attribute as a sortable, thus allowing it to be a field under the sort options provided on the UI.
    • Display Name: For ease of use, please ensure that the display name reflects the sort order.
    • Order: Specifies the default sorting order when displaying sorted results.
  • Searchable: Attributes marked as searchable will be considered by the search algorithm when matching query terms.

  • Displayable: Attributes set as displayable will appear in the product listings or search results.

  • Filterable: If an attribute is filterable, users can apply it as a criterion to refine their search results.

Following configurations are applicable for these Attribute types: image vector and text vector

  • Model Type: Specifies the type of model or algorithm used to process or interpret the vector data.
  • Dimensions: Refers to the number of dimensions in the vector space.
  • EF-Construction: This typically refers to the parameter setting for certain types of search or database algorithms.
  • M: In the context of vector search algorithms, "M" often denotes a parameter that controls the width of the graph.
  • Engine: Indicates the underlying engine or platform that processes the vectors.
  • Similarity: Defines the method used to calculate the similarity between vectors.

Purpose and Impact

The configuration of schema-level attributes is critical for:

  • Searchability: Fine-tuning attribute configurations impacts the effectiveness and accuracy of the search results.
  • User Interface (UI) Adaptability: Empowering business teams to make UI changes directly through the tool, improving the end-user experience.
  • Search Calculations: Influencing the underlying calculations and logic of the search flow, which determines the relevancy and ranking of search results.

Example

Imagine you're adding a "Color" attribute to a clothing e-commerce platform:

  • Attribute Name: "Color"
  • Attribute Type: String
  • Facetable: Yes (so customers can see color options on the sidebar)
  • Sortable: No (sorting by color isn't typically useful)
  • Searchable: Yes (customers often search for specific colors)
  • Displayable: Yes (to show color options in the listings)
  • Filterable: Yes (customers may want to filter by color)

By carefully considering the configuration of each attribute, you optimize how products are discovered and interacted with on your platform, ensuring a seamless and intuitive user experience.