Get no Results on GetPropertyValue


I want to search on pages with GetPropertyValue but I don't get any result with:

var results =
            .Filter(p => p.GetPropertyValue("Name").Exists())

But with this I get results:

var results =
            .Filter(p => p.Name.Exists())

Is this a Bug?
Mar 18, 2015 3:09

Hello Aldo,

GetPropertyValue is an extension method that Filter function does not support. Under the hood, an expression passed to the Filter function is translated into ElasticSearch query, so there are certain limitations on what can be used in Filter. 

if you need to speicfy a property name dynamically, you can use ExistsFilter:

var results = searchClient.Search<PageData>()
    .Filter(new ExistsFilter(TypeSuffix.GetSuffixedFieldName("Name", typeof(String))))

Note that you need to speicfy the property type as a second argument of the GetSuffixedFieldName function.

Mar 18, 2015 11:58
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.