In Part 1 of this series: https://www.xcentium.com/blogs/building-fast-and-powerful-search-with-contentstack-and-algolia , we explored the foundational steps for building fast and powerful search using ContentStack and Algolia. Now, in this follow-up, we’ll dive deeper into content type mapping—a critical aspect of optimizing how your content is indexed and displayed in Algolia.
This post walks through a real-world use case, explaining how to handle both simple and complex field mappings using the Contentstack Algolia Marketplace App, and shares best practices to help you create scalable, relevant search experiences.
Use Case: Mapping the “Author” Content Type
Let’s consider a typical use case where you have an Author content type in ContentStack, and you want to surface author data in a search listing component on your website’s "Teams" page.
Content Type: Author
Fields:
- full_name (Text)
- picture (Asset)
- bio (Rich Text)
taxonomies (Custom Reference/Group Field for Metadata)
Your goal is to push this data into Algolia so that authors can be searched, filtered, and displayed based on certain fields.

Step 1: Basic Field Mapping in the Marketplace App
Fields like full_name, bio, and picture are straightforward; they can be mapped directly to Algolia attributes using one-to-one field mapping in the Marketplace app UI.
Example:
Contentstack Field | Algolia Attribute |
---|---|
full_name | full_name |
bio | bio |
picture | picture_url |
To do this:
Open the ContentStack → Algolia Marketplace App.
Select your Stack and Content Type (Author).
Click “Add Field Mapping” and map each field accordingly.
Save and apply the changes.
Step 2: Handling Complex Fields like taxonomies
The taxonomies field in this example is more nuanced. It may look like this in a REST API response:

Problem: You only want to display offices in the search results—not positions. Simply pushing the entire taxonomies array to Algolia will result in irrelevant or noisy search data.
Step 3: Selective Mapping with Rules
To solve this, we’ll filter and map only the "offices" taxonomy items. Here’s how to do it using the Marketplace app:
- Go to the Mapping Rules tab.
- Click Add Rule → Mapping Items.
- Choose Field: taxonomies.
- Apply a filter or transformation rule (e.g., extract only items where taxonomy_uid === "offices" or pick the first matching entry).
You can also configure the rule to map a transformed version of the data (e.g., flattening the office names into a string or array).

- Click Create & Apply, then Save your mappings.
Best Practices for Content Type Mapping
- Map only what’s needed: Avoid pushing unnecessary fields into Algolia—this keeps the index lean and fast.
- Flatten nested fields: Extract only the relevant values from objects or arrays (e.g., extract term_uid from taxonomies).
- Use rules to transform: Leverage the Marketplace App’s rule engine to filter, format, or enrich fields before indexing.
- Test in sandbox/preview index before pushing to production.
- Name fields consistently to make Algolia attributes readable and easy to filter.
Wrapping Up
Fine-tuning your ContentStack → Algolia integration starts with thoughtful content type mapping. Whether you’re pushing simple text fields or complex arrays like taxonomies, mapping rules give you the flexibility to control exactly what ends up in your search index.