Search Results Customization

This guide explains how to customize search results in the Raffle API using CSS Metadata Selectors. You’ll learn how to enhance result descriptions by extracting structured data during the indexing process.

Introduction

This guide focuses on improving the relevance and appearance of search results using CSS Metadata Selectors. Search results returned by the Raffle API are fast and accurate, but the content may sometimes appear disjointed or incomplete. By configuring CSS Metadata Selectors when creating an Index, you can enhance the structure and context of search results.

This guide covers:

  1. Understanding the default format of search results.
  2. Why you might want to enhance search result descriptions.
  3. Step-by-step instructions to configure CSS Metadata Selectors.
  4. How to use these enhancements via your API User Interface.
  5. Validating and refining your implementation for optimal results.

With this setup, you’ll gain control over the metadata included in your search results, ensuring a polished and user-friendly experience.


Prerequisites

Before following this guide, ensure the following:

  1. You have access to the Index Creation and Configuration in the Raffle web app.
  2. You understand that changes to an Index take effect after the next scheduled Periodic Resync. (This can be set to daily, weekly, or never during Index creation and adjusted later.)
  3. Basic understanding of CSS selectors and how they target elements in HTML.

If you’re new to Index creation, refer to the Index Creation Guide for detailed steps.


Workflow

This guide will take you through:

  1. Default Behavior: Understanding how search results are returned without customization.
  2. Configuring Metadata Selectors: Setting up CSS selectors to extract structured data during indexing.
  3. Using Enhanced Results: Viewing enriched search results via your API User Interface.
  4. Testing and Validation: Ensuring metadata selectors are working as intended.

By the end, you’ll be able to customize and enrich search results, providing a superior search experience for your end users.