Take the community feedback survey now.

dada
Jun 5, 2025
  21
(0 votes)

Avoid Field Type Conflicts in Search & Navigation

When using Optimizely Search & Navigation, reusing the same property name across different content types is fine — as long as the type is consistent. If one type uses int and another uses string, you'll run into indexing and query issues.

💥 The Issue

Optimizely Search & Navigation stores data in Elasticsearch, which assigns a data type to each field the first time it sees it. That type is then fixed.

If CategoryId is first indexed as an int, any later document sending "12" (as a string) under the same field name causes a conflict.

This can lead to:

  • Missing / fluctuating search results

  • Filters not working

  • Incorrect aggregations

  • Indexing errors

🧪 Example

public virtual List<int> CategoryId { get; set; }  // Used in one type
public virtual List<string> CategoryId { get; set; }  // Used in another

Query:

"term": { "CategoryId": 12 }

Only matches documents where CategoryId is an integer. 

✅ How to Prevent It

  • Keep the same type for shared field names across all content types - at least for those content types you will be indexing.

    It can be good to know that this is not always an issue because we do suffix many types (string gets the suffix $$string) meaning a plain string property and an integer propery will be keyed differently in the mappings. 

🧱 Root Cause

This is a limitation in Elasticsearch, not a bug in Optimizely Search & Navigation. Once a field is mapped with one type, it can’t accept another.

✅ Summary

  • Same name + different type = broken queries

  • Align types for all shared property names

  • Use consistent modeling to avoid mapping conflicts

Jun 05, 2025

Comments

Please login to comment.
Latest blogs
A day in the life of an Optimizely OMVP - Opticon London 2025

This installment of a day in the life of an Optimizely OMVP gives an in-depth coverage of my trip down to London to attend Opticon London 2025 held...

Graham Carr | Oct 2, 2025

Optimizely Web Experimentation Using Real-Time Segments: A Step-by-Step Guide

  Introduction Personalization has become de facto standard for any digital channel to improve the user's engagement KPI’s.  Personalization uses...

Ratish | Oct 1, 2025 |

Trigger DXP Warmup Locally to Catch Bugs & Performance Issues Early

Here’s our documentation on warmup in DXP : 🔗 https://docs.developers.optimizely.com/digital-experience-platform/docs/warming-up-sites What I didn...

dada | Sep 29, 2025

Creating Opal Tools for Stott Robots Handler

This summer, the Netcel Development team and I took part in Optimizely’s Opal Hackathon. The challenge from Optimizely was to extend Opal’s abiliti...

Mark Stott | Sep 28, 2025

Integrating Commerce Search v3 (Vertex AI) with Optimizely Configured Commerce

Introduction This blog provides a technical guide for integrating Commerce Search v3, which leverages Google Cloud's Vertex AI Search, into an...

Vaibhav | Sep 27, 2025

A day in the life of an Optimizely MVP - Opti Graph Extensions add-on v1.0.0 released

I am pleased to announce that the official v1.0.0 of the Opti Graph Extensions add-on has now been released and is generally available. Refer to my...

Graham Carr | Sep 25, 2025