Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Sorting on property with JsonProperty with PropertyName set

$
0
0

I have the following product content:

public class SampleProduct : ProductContent
{
    [JsonProperty(PropertyName = "heading")]
    public override string DisplayName { get => base.DisplayName; set => base.DisplayName = value; }
}

When its indexed I can see that the field in the index is name: heading$$string. And when trying to sort on this property with:

var searchResult = _client.Search<SampleProduct>()
    .PublishedInCurrentLanguage();
    .Order(p => p.DisplayName)
    .GetContentResult();

The documents does not get sorted correctly. If I remove the JsonProperty-attribute it works correctly.


Viewing all articles
Browse latest Browse all 6894

Trending Articles