Try our conversational search powered by Generative AI!

Parse failure on orderby

Ed
Ed
Vote:
 

I have indexed my content. I have a field that is an int (my_custom_field below) and would like to sort on it. I'm getting the error below:

Parse Failure [No mapping found for [ContentApiModel.my_custom_field] in order to sort on]];

The API URI looks like this:

'v2.0/search/content/?query=halle&orderby=my_custom_field desc&skip=0&top=10'

#245752
Dec 18, 2020 14:57
Ed
Vote:
 

Well, I changed the query to this. I no longer get a nasty 500 error. It returns results, but they aren't sorted as expected.


Well, only enough, this does NOT produce an error: 'v2.0/search/content/?query=some string&orderby=my_custom_field/value&skip=0&top=10'

This is what I see in my log:

2020-12-18 11:27:12,932 [172] ERROR EPiServer.ContentApi.Search.Internal.FilterHelper: Fail to build lamda expression
System.ArgumentException: Property 'my_custom_field' is not defined for type 'EPiServer.ContentApi.Core.Serialization.Models.ContentApiModel'
at System.Linq.Expressions.Expression.Property(Expression expression, Type type, String propertyName)
at EPiServer.ContentApi.Search.Internal.FilterHelper.GetPropertyNameAsLambdaExpression(Type type, String dotNotation)

#245758
Dec 18, 2020 16:37
Vote:
 

How does tour query look like (C# code)? 

#246493
Jan 07, 2021 7:43
Vote:
 

Is Episerver Find - sorry Search & Navigation - hosted on-prem, og are you using the normal cloud hosted index?

#246496
Jan 07, 2021 8:26
Vote:
 

Is Episerver Find - sorry Search & Navigation - hosted on-prem, og are you using the normal cloud hosted index?

#246497
Jan 07, 2021 8:26
Vote:
 

About the EPiServer.ContentApi.Search.Internal.FilterHelper: Fail to build lamda expression ERROR  

"Currently when we filter by an "extend" property (which is not pre-defined in ContentApiModel) then the FilterHelper will throw an exception since it cannot find this field from ContentApiModel. The error can be ignored though since in this case, the FilterHelper will try to use plain propertyName instead. We may consider removing the error log later in an upcoming version."

This was done in EPiServer.ContentDeliveryApi 2.18.0

#247362
Jan 20, 2021 22:26
* 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.