Try our conversational search powered by Generative AI!

Episerver Find - .ThenBy with a string gives Exceptions on DXC integration



Find version 13.0.5

I am having two versions of the same code, one using ThenBy with an int (SortIndex) and the other using ThenBy with a string (Name). Both are searching an ISearchable, implemented by all page types (_findClient.Search() is used) and Name is defined in the interface (inherited essentially by PageData), same with SortIndex.

Order by Name works:

                    result = query
                        .OrderBy(q => q.Name)
                        .GetContentResultSafe(searchCacheSettings, cacheForEditorsAndAdmins);

Then by SortIndex works:

                    result = query
                        .OrderByDescending(q => q.Ranking)
                        .ThenBy(q => q.SortIndex)
                        .GetContentResultSafe(searchCacheSettings, cacheForEditorsAndAdmins);

Then by Name works locally, but not in integration environment:

                    result = query
                        .OrderByDescending(q => q.Ranking)
                        .ThenBy(q => q.Name)
                        .GetContentResultSafe(searchCacheSettings, cacheForEditorsAndAdmins);

The error I get by default is the following:

ReduceSearchPhaseException[Failed to execute phase [query], [reduce] ]; nested: ClassCastException; 

Then, I found this post related to OrderBy:

Overload of ThenBy with IgnoreUnmapped:true gives the same exception, overload with ThenBy with IgnoreUnmapped:false gives (in a really long error):

Parse Failure [No mapping found for [Name$$string.sort] in order to sort on]];

Any ideas?

Edited, Nov 02, 2018 13:08

Do you get the same error when running against Integration Find index locally?

Nov 06, 2018 14:00

I wanted to try that, but couldn't find the URL in the files on integration.

On production, there seems to be no error (client will verify). So, my best guess is that it's the index.

Nov 06, 2018 14:02

You can view the details in the Azure portal or by iterating ConfigurationManager.AppSettings if you want to dig further.

I recall hearing that there were different service versions planned and that you needed to contact Epi if you moved over some version. Not sure on the status here though.

Nov 06, 2018 14:14

Maybe it can be that one is still on Amazon and the others on Azure (or the other way).

Nov 06, 2018 14:19

Thx a lot, guys! I've opened the support request referring to this post and the answers!

Nov 07, 2018 15:25

Great, keep us updated!

Nov 07, 2018 15:27
* 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.