THIS IS ARCHIVED DOCUMENTATION
Ignore Index Fields
Ignore Index Fields
Coveo for Sitecore 4.1 (November 2018)
The IgnoreIndexFieldAttribute
is a feature introduced in Sitecore 7.0 Update-1. It can be applied to any C# object property to prevent the search provider from mapping it to a value retrieved from the index. In the following example, the property City
will never be mapped, even if there’s a field named City
in the index.
public class Airport : SearchResultItem
{
[IgnoreIndexField]
public string City { get; set; }
}
This attribute is only applied when mapping the fields to the C# object. Performing a query on the field will still work as expected. For example, the following query will retrieve every airport in Montreal.
var result = context.GetQueryable<Airport>()
.Where(item => item.City == "Montreal")
.ToList();