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 on a web scrape source, 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 widget.
  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 can create and configure Sources in the Raffle web app.
  2. You understand that changes to a source take effect the next time it is scraped, according to its Scrape Plan. (This is set to Weekly, Daily or First crawl only when you create the source, and can be adjusted later.)
  3. Basic understanding of CSS selectors and how they target elements in HTML.

If you’re new to creating sources, refer to the Sources 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 widget.
  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.