AI OnAI Off
For future reference - I got answer from support:
Find has several sub indices depending on language analyzers. In your case, it looks like the content doesn't have a mapping in the index where we store content that is not ILocalizable (ie an index that supports all languages). This is normal and not a problem.
If you still want to be rid of this, you can set the optional parameter ignoreUnmapped
to true in the OrderBy
method.
With following code the error is no longer present in API response:
var query = _searchClient.Search<GenericProduct>()
.Filter(x => (x.Name.Match("ROBERT SNEAKER") | x.Name.Match("MORGAN SNEAKER") ) & x.Language.Name.Match("en"))
.Filter(x => x.GetIndexPrices(), x => x.MarketId.Match("AUS"))
.OrderBy(
x => x.GetIndexPrices(),
x => x.UnitPriceAmount,
x => x.MarketId.Match("AUS"),
EPiServer.Find.Api.SortMissing.Last,
EPiServer.Find.Api.SortOrder.Descending,
ignoreUnmapped: true);
var result = query.GetContentResult();
Hi,
I'm using simple POCO class on the Variation as a nested document, and using OrderBy on nested document value the Find API returns errors
Parse Failure [No mapping found for [GetIndexPrices$$nested.UnitPriceAmount$$number] in order to sort on]]
Is this something expected, or might this fail on the bigger scale when I will try to use it on production environment?
The following example has been reproduced on Foundation project with latest versions of packages:
EPiServer.CMS 12.31.2
EPiServer.Framework 12.21.8
EPiServer.Find.Cms 16.3.0
EPiServer.Find.Commerce 12.2.0
Nested document class:
with following conventions applied:
This results in the correct indexing of the document (shortend a bit for brevity) with correct nested document "GetIndexPrices$$nested"
However, if I use the search client to filter and sort
Following query is generated:
And it returns results without throwing exceptions in .NET, yet some errors are reported at API level: