Take the community feedback survey now.

dada
Jun 5, 2025
  571
(1 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
Quiet Performance Wins: Scheduled Job for SQL Index Maintenance in Optimizely

As Optimizely CMS projects grow, it’s not uncommon to introduce custom tables—whether for integrations, caching, or specialized business logic. But...

Stanisław Szołkowski | Oct 8, 2025 |

Image Generation with Gemini 2.5 Flash

Gemini 2.5 Flash Image, nicknamed Nano Banana, is Google DeepMind’s newest image generation & editing model. It blends text‑to‑image, multi‑image...

Luc Gosso (MVP) | Oct 8, 2025 |

Automated Page Audit for Large Content Sites in Optimizely

Large content sites often face significant challenges in maintaining visibility and control over thousands of pages. Content managers struggle to...

Sanjay Kumar | Oct 6, 2025

Optimizely CMS Roadmap – AI, automation and the future of digital experiences

A summary of the roadmap for Optimizely CMS from the Opticon conference on September 30, 2025.

Tomas Hensrud Gulla | Oct 6, 2025 |