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:
public class IndexPrice
{
public string MarketId { get; set; }
public decimal MinQuantity { get; set; }
public decimal UnitPriceAmount { get; set; }
}
with following conventions applied:
SearchClient.Instance.Conventions.ForInstancesOf<GenericProduct>().IncludeField(x => x.GetIndexPrices());
SearchClient.Instance.Conventions.NestedConventions.ForInstancesOf<GenericProduct>().Add(v => v.GetIndexPrices());
This results in the correct indexing of the document (shortend a bit for brevity) with correct nested document "GetIndexPrices$$nested"
{"Bury$$bool": false,"CommerceMediaCollection": [],"Inventories": [],"ContentType": 0,"_TypeDisplayName": "Generic Product","ExistingLanguages$$string": ["en","fr","sv"
],"MarketFilter": [],"SetChangedOnPublish$$bool": true,"NewArrival$$bool": false,"Ancestors$$string": ["1073741831__CatalogContent","1073741825__CatalogContent","-2147483646__CatalogContent","-1073741823__CatalogContent"
],"ChildNodeRelations": [],"OnSale$$bool": false,"Prices": [],"MasterLanguage": "en","StartPublishedNormalized$$date": "2015-04-22T11:47:00Z","AvailableColors": ["WHITE/LIGHT GREY MIX","LIMESTONE/NAVY/WHITE MIX"
],"Boost$$number": 1,"StartPublish$$date": "2015-04-22T11:47:52Z","ContentApiModel": {},"ContentTypeID$$number": 157,"ThumbnailUrl$$string": "/globalassets/catalogs/mosey/mens/shoes/robert-sneaker/25933-1009-s19-1-f-0-0.jpg/thumbnail","StopPublish$$date": "2035-04-22T11:47:52Z","Status": 4,"ParentPackages": [],"Created$$date": "2024-10-24T17:00:45.353Z","GetTimestamp$$date": "2024-10-24T18:05:36.7448974Z","SearchSummary$$string": "DETAILS This vintage basketball-inspired low top lined with calf leather, and made with tumbled cow nappa. It has a perforated toe vamp for breathability and a padded heel tab for comfort. Wear it with jeans for a classic look. Removable insole Padded heel tabs Perforated toe vamp\r\nPRODUCT ORIGIN We believe that openness and transparency throughout the production chain plays an important role in modern, sustainable manufacturing. Made in: Portugal Factory (Sub Contractor): Samba Address: Lugar Cabeca de Porca - Sendim, 4610-733, Felgueiras, Portugal Number of employees: 92 (50 men/42 women) Visited by the Filippa K supply team Vendor (Main Supplier): Eurostep Address: Via Carlos Mota Pinto,30 - 3 piso, Moreira, 4470-034, Maia, Portugal Number of employees: 6 (4 men/2 women) Visited by the Filippa K supply team ","Categories": {"ContentTypeID$$number": 93,"___types": ["EPiServer.Commerce.Catalog.ContentTypes.Categories_DynamicProxy","EPiServer.Commerce.Catalog.ContentTypes.Categories","EPiServer.Core.BlockData","EPiServer.Core.ContentData","System.Object","EPiServer.Core.IContentData","EPiServer.Core.IInitializableContent","EPiServer.Core.IModifiedTrackable","EPiServer.Data.Entity.IReadOnly","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.BlockData, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]"
],"ContentLink": {"ProviderName$$string": "CatalogContent","ID$$number": 51,"WorkID$$number": 0,"IsExternalProvider$$bool": true,"___types": ["EPiServer.Find.Cms.IndexableContentReference","EPiServer.Core.ContentReference","System.Object","System.IComparable","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Data.Entity.IReadOnly","System.IComparable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","System.IEquatable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Core.IModifiedTrackable"
],"GetPublishedOrLatest$$bool": false,"$type": "EPiServer.Find.Cms.IndexableContentReference, EPiServer.Find.Cms"
},"$type": "EPiServer.Commerce.Catalog.ContentTypes.Categories, EPiServer.Business.Commerce"
},"CreatedBy$$string": "Importer","VariationModels$$nested": [
{"LanguageId$$string": "en","Name$$string": "ROBERT SNEAKER","Code$$string": "SKU-39850363","DefaultAssetUrl$$string": "","___types": ["Foundation.Features.Search.VariationModel","System.Object"
],"$type": "Foundation.Features.Search.VariationModel, Foundation"
},
{"LanguageId$$string": "en","Name$$string": "ROBERT SNEAKER","Code$$string": "ROBERT-SNEAKER_1","DefaultAssetUrl$$string": "","___types": ["Foundation.Features.Search.VariationModel","System.Object"
],"$type": "Foundation.Features.Search.VariationModel, Foundation"
}
],"Code$$string": "P-39850363","Markets": [],"ProductStatus$$string": "Active","CatalogId$$number": 2,"Outline$$string": ["Fashion/mens/shoes"
],"Associations": [],"ParentProducts": [],"ContentGuid": "c403f8d8-c6e1-415c-895a-d5411fdc483d","DefaultImageUrl$$string": "/globalassets/catalogs/mosey/mens/shoes/robert-sneaker/25933-1009-s19-1-f-0-0.jpg","SeoUri$$string": "P-39850363","ClassTypeId$$string": "Product","Saved$$date": "2024-10-24T17:31:22.503Z","_TypeShortName": "GenericProduct","HideSiteHeader$$bool": false,"EscapedQueryableCode$$string": "P2D39850363","SearchText$$string": "ROBERT SNEAKER\r\ntest1\r\nThis vintage basketball-inspired low top lined with calf leather, and made with tumbled cow nappa. It has a perforated toe vamp for breathability and a padded heel tab for comfort. Wear it with jeans for a classic look.\r\nEurostep\r\nDETAILS This vintage basketball-inspired low top lined with calf leather, and made with tumbled cow nappa. It has a perforated toe vamp for breathability and a padded heel tab for comfort. Wear it with jeans for a classic look. Removable insole Padded heel tabs Perforated toe vamp\r\nPRODUCT ORIGIN We believe that openness and transparency throughout the production chain plays an important role in modern, sustainable manufacturing. Made in: Portugal Factory (Sub Contractor): Samba Address: Lugar Cabeca de Porca - Sendim, 4610-733, Felgueiras, Portugal Number of employees: 92 (50 men/42 women) Visited by the Filippa K supply team Vendor (Main Supplier): Eurostep Address: Via Carlos Mota Pinto,30 - 3 piso, Moreira, 4470-034, Maia, Portugal Number of employees: 6 (4 men/2 women) Visited by the Filippa K supply team \r\nYou May Also Like\r\nActive\r\nP-39850363","Language.Name$$string": "en","MasterLanguage.Name$$string": "en","Sizing": {"IsEmpty$$bool": false,"___types": ["EPiServer.Core.XhtmlString","System.Object","System.Runtime.Serialization.ISerializable","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.XhtmlString, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Data.Entity.IReadOnly","EPiServer.Core.IModifiedTrackable"
],"AsViewedByAnonymous$$string": "test1","$type": "EPiServer.Core.XhtmlString, EPiServer"
},"AssociationsTitle$$string": "You May Also Like","Description": {"IsEmpty$$bool": false,"___types": ["EPiServer.Core.XhtmlString","System.Object","System.Runtime.Serialization.ISerializable","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.XhtmlString, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Data.Entity.IReadOnly","EPiServer.Core.IModifiedTrackable"
],"AsViewedByAnonymous$$string": "DETAILS This vintage basketball-inspired low top lined with calf leather, and made with tumbled cow nappa. It has a perforated toe vamp for breathability and a padded heel tab for comfort. Wear it with jeans for a classic look. Removable insole Padded heel tabs Perforated toe vamp","$type": "EPiServer.Core.XhtmlString, EPiServer"
},"HideSiteFooter$$bool": false,"PublishedInLanguage": {"Values": [
{"StopPublish$$date": "2035-04-22T11:47:52Z","StartPublish$$date": "2015-04-22T11:47:00Z","___types": ["EPiServer.Find.Cms.LanguagePublicationStatus","System.Object"
],"$type": "EPiServer.Find.Cms.LanguagePublicationStatus, EPiServer.Find.Cms"
}
],"en": {"StopPublish$$date": "2035-04-22T11:47:52Z","StartPublish$$date": "2015-04-22T11:47:00Z","___types": ["EPiServer.Find.Cms.LanguagePublicationStatus","System.Object"
],"$type": "EPiServer.Find.Cms.LanguagePublicationStatus, EPiServer.Find.Cms"
},"Keys": ["en"
],"$type": "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[EPiServer.Find.Cms.LanguagePublicationStatus, EPiServer.Find.Cms, Version=16.3.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]"
},"SortOrder$$number": 300,"IsPendingPublish$$bool": false,"SearchUpdateDate$$date": "2024-10-24T17:31:22.503Z","ParentBundles": [],"AvailableSizes": ["11"
],"ContentLink": {"ProviderName$$string": "CatalogContent","ID$$number": 51,"WorkID$$number": 0,"IsExternalProvider$$bool": true,"___types": ["EPiServer.Find.Cms.IndexableContentReference","EPiServer.Core.ContentReference","System.Object","System.IComparable","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Data.Entity.IReadOnly","System.IComparable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","System.IEquatable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Core.IModifiedTrackable"
],"GetPublishedOrLatest$$bool": false,"$type": "EPiServer.Find.Cms.IndexableContentReference, EPiServer.Find.Cms"
},"RouteSegment$$string": "p-39850363","SearchPublishDate$$date": "2015-04-22T11:47:52Z","Brand$$string": "Eurostep","SeoInformation": {"___types": ["EPiServer.Commerce.Catalog.ContentTypes.SeoInformation_DynamicProxy","EPiServer.Commerce.Catalog.ContentTypes.SeoInformation","EPiServer.Core.BlockData","EPiServer.Core.ContentData","System.Object","EPiServer.Core.IContentData","EPiServer.Core.IInitializableContent","EPiServer.Core.IModifiedTrackable","EPiServer.Data.Entity.IReadOnly","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.BlockData, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]"
],"ContentTypeID$$number": 95,"$type": "EPiServer.Commerce.Catalog.ContentTypes.SeoInformation, EPiServer.Business.Commerce"
},"Changed$$date": "2024-10-24T17:31:22.503Z","Name$$string": "ROBERT SNEAKER","VariantsReference": {"ProviderName$$string": "CatalogContent","ID$$number": 51,"WorkID$$number": 0,"IsExternalProvider$$bool": true,"___types": ["EPiServer.Find.Cms.IndexableContentReference","EPiServer.Core.ContentReference","System.Object","System.IComparable","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Data.Entity.IReadOnly","System.IComparable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","System.IEquatable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Core.IModifiedTrackable"
],"GetPublishedOrLatest$$bool": false,"$type": "EPiServer.Find.Cms.IndexableContentReference, EPiServer.Find.Cms"
},"_Name": "ROBERT SNEAKER","SearchTypeName$$string": "Product","ProductTeaser": {"IsEmpty$$bool": false,"___types": ["EPiServer.Core.XhtmlString","System.Object","System.Runtime.Serialization.ISerializable","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.XhtmlString, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Data.Entity.IReadOnly","EPiServer.Core.IModifiedTrackable"
],"AsViewedByAnonymous$$string": "This vintage basketball-inspired low top lined with calf leather, and made with tumbled cow nappa. It has a perforated toe vamp for breathability and a padded heel tab for comfort. Wear it with jeans for a classic look.","$type": "EPiServer.Core.XhtmlString, EPiServer"
},"ParentNodeRelations": [
{"ProviderName$$string": "CatalogContent","ID$$number": 1073741831,"WorkID$$number": 0,"IsExternalProvider$$bool": true,"___types": ["EPiServer.Core.ContentReference","System.Object","System.IComparable","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Data.Entity.IReadOnly","System.IComparable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","System.IEquatable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Core.IModifiedTrackable"
],"GetPublishedOrLatest$$bool": false,"$type": "EPiServer.Core.ContentReference, EPiServer"
}
],"ShowRecommendations$$bool": true,"IsNull$$bool": false,"_Type": "Foundation.Features.CatalogContent.Product.GenericProduct","HasTemplate$$bool": true,"ParentLink": {"ProviderName$$string": "CatalogContent","ID$$number": 1073741831,"WorkID$$number": 0,"IsExternalProvider$$bool": true,"___types": ["EPiServer.Find.Cms.IndexableContentReference","EPiServer.Core.ContentReference","System.Object","System.IComparable","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Data.Entity.IReadOnly","System.IComparable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","System.IEquatable`1[[EPiServer.Core.ContentReference, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Core.IModifiedTrackable"
],"GetPublishedOrLatest$$bool": false,"$type": "EPiServer.Find.Cms.IndexableContentReference, EPiServer.Find.Cms"
},"MetaClassId$$number": 8,"GetIndexPrices$$nested": [
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 10.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "AUS","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 103,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "BRA","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 41.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "CAN","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 20763,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "CHL","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 31.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "DEU","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 31.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "ESP","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 31.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "FR","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 4047,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "JPN","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 31.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "NLD","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 264.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "NOR","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 46.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "SAU","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 280,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "SWE","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 280,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "SWE","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 280,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "UK","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 280,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "US","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 10.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "AUS","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 103,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "BRA","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 41.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "CAN","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 20763,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "CHL","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 31.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "DEU","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 31.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "ESP","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 31.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "FR","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 4047,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "JPN","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 31.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "NLD","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 264.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "NOR","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 46.5,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "SAU","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 280,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "SWE","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 280,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "SWE","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 280,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "UK","$type": "Foundation.Features.Search.IndexPrice, Foundation"
},
{"MinQuantity$$number": 0,"UnitPriceAmount$$number": 280,"___types": ["Foundation.Features.Search.IndexPrice","System.Object"
],"MarketId$$string": "US","$type": "Foundation.Features.Search.IndexPrice, Foundation"
}
],"DefaultPrice$$number": 10.5,"SearchTitle$$string": "ROBERT SNEAKER","___types": ["Foundation.Features.CatalogContent.Product.GenericProduct_DynamicProxy","Foundation.Features.CatalogContent.Product.GenericProduct","EPiServer.Commerce.Catalog.ContentTypes.ProductContent","EPiServer.Commerce.Catalog.ContentTypes.EntryContentBase","EPiServer.Commerce.Catalog.ContentTypes.CatalogContentBase","EPiServer.Core.ContentData","System.Object","EPiServer.Core.IContentData","EPiServer.Core.IInitializableContent","EPiServer.Core.IModifiedTrackable","EPiServer.Data.Entity.IReadOnly","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Commerce.Catalog.ContentTypes.CatalogContentBase, EPiServer.Business.Commerce, Version=14.29.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Core.IContent","EPiServer.Core.ILocalizable","EPiServer.Core.ILocale","EPiServer.Core.IVersionable","EPiServer.Web.Routing.IRoutable","EPiServer.Security.ISecurable","EPiServer.Commerce.Catalog.ContentTypes.IMetaClass","EPiServer.Commerce.Catalog.ContentTypes.ISearchEngineInformation","EPiServer.Core.IChangeTrackable","EPiServer.Commerce.Catalog.ContentTypes.ICategorizable","EPiServer.Commerce.Catalog.ContentTypes.IAssociating","EPiServer.Commerce.Catalog.ContentTypes.IAssetContainer","EPiServer.Commerce.Catalog.ContentTypes.IVariantContainer","Foundation.Features.CatalogContent.IProductRecommendations","Foundation.Features.Shared.IFoundationContent"
],"ChangedBy$$string": "admin@example.com","$type": "Foundation.Features.CatalogContent.Product.GenericProduct, Foundation","ContentTypeName$$string": "Generic Product","DisplayName$$string": "ROBERT SNEAKER","LongDescription": {"IsEmpty$$bool": false,"___types": ["EPiServer.Core.XhtmlString","System.Object","System.Runtime.Serialization.ISerializable","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Core.XhtmlString, EPiServer, Version=12.21.8.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Data.Entity.IReadOnly","EPiServer.Core.IModifiedTrackable"
],"AsViewedByAnonymous$$string": "PRODUCT ORIGIN We believe that openness and transparency throughout the production chain plays an important role in modern, sustainable manufacturing. Made in: Portugal Factory (Sub Contractor): Samba Address: Lugar Cabeca de Porca - Sendim, 4610-733, Felgueiras, Portugal Number of employees: 92 (50 men/42 women) Visited by the Filippa K supply team Vendor (Main Supplier): Eurostep Address: Via Carlos Mota Pinto,30 - 3 piso, Moreira, 4470-034, Maia, Portugal Number of employees: 6 (4 men/2 women) Visited by the Filippa K supply team ","$type": "EPiServer.Core.XhtmlString, EPiServer"
},"IsDeleted$$bool": false,"ExistingLanguages": ["en","fr","sv"
],"SearchHitUrl$$string": "https://localhost:5001/en/fashion/mens/mens-shoes/p-39850363/"
}
However, if I use the search client to filter and sort
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.Ascending);
var result = query.GetContentResult();
Following query is generated:
{"query": {"filtered": {"query": {"constant_score": {"filter": {"and": [
{"or": [
{"term": {"Name$$string": "ROBERT SNEAKER"
}
},
{"term": {"Name$$string": "MORGAN SNEAKER"
}
}
]
},
{"term": {"Language.Name$$string": "en"
}
},
{"nested": {"path": "GetIndexPrices$$nested","filter": {"term": {"GetIndexPrices$$nested.MarketId$$string": "AUS"
}
}
}
},
{"term": {"___types": "EPiServer.Core.IContent"
}
}
]
}
}
},"filter": {"term": {"___types": "Foundation.Features.CatalogContent.Product.GenericProduct"
}
}
}
},"sort": [
{"GetIndexPrices$$nested.UnitPriceAmount$$number": {"order": "asc","missing": "_last","nested_path": "GetIndexPrices$$nested","nested_filter": {"term": {"GetIndexPrices$$nested.MarketId$$string": "AUS"
}
}
}
}
],"fields": ["___types","ContentLink.ID$$number","ContentLink.ProviderName$$string","Language.Name$$string"
]
}
And it returns results without throwing exceptions in .NET, yet some errors are reported at API level:
{"took": 146,"timed_out": false,"_shards": {"total": 6,"successful": 4,"failed": 2,"failures": [
{"index": "foundationoct001","shard": 0,"status": 400,"reason": "RemoteTransportException[[demo04pv7data00000F][inet[/10.130.52.22:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[foundationoct001][0]: query[filtered(ConstantScore(+cache(Name$$string:ROBERT SNEAKER) cache(Name$$string:MORGAN SNEAKER) +cache(Language.Name$$string:en) +QueryWrapperFilter(ToParentBlockJoinQuery (filtered(ConstantScore(cache(GetIndexPrices$$nested.MarketId$$string:AUS)))->cache(_type:__GetIndexPrices$$nested))) +cache(___types:EPiServer.Core.IContent)))->cache(___types:Foundation.Features.CatalogContent.Product.GenericProduct)],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"filtered\":{\"filter\":{\"term\":{\"___types\":\"Foundation.Features.CatalogContent.Product.GenericProduct\"}},\"query\":{\"constant_score\":{\"filter\":{\"and\":[{\"or\":[{\"term\":{\"Name$$string\":\"ROBERT SNEAKER\"}},{\"term\":{\"Name$$string\":\"MORGAN SNEAKER\"}}]},{\"term\":{\"Language.Name$$string\":\"en\"}},{\"nested\":{\"filter\":{\"term\":{\"GetIndexPrices$$nested.MarketId$$string\":\"AUS\"}},\"path\":\"GetIndexPrices$$nested\"}},{\"term\":{\"___types\":\"EPiServer.Core.IContent\"}}]}}}}},\"_source\":[\"___types\",\"ContentLink.ID$$number\",\"ContentLink.ProviderName$$string\",\"Language.Name$$string\"],\"sort\":[{\"GetIndexPrices$$nested.UnitPriceAmount$$number\":{\"nested_path\":\"GetIndexPrices$$nested\",\"nested_filter\":{\"term\":{\"GetIndexPrices$$nested.MarketId$$string\":\"AUS\"}},\"missing\":\"_last\",\"order\":\"asc\"}}]}]]]; nested: SearchParseException[[foundationoct001][0]: query[filtered(ConstantScore(+cache(Name$$string:ROBERT SNEAKER) cache(Name$$string:MORGAN SNEAKER) +cache(Language.Name$$string:en) +QueryWrapperFilter(ToParentBlockJoinQuery (filtered(ConstantScore(cache(GetIndexPrices$$nested.MarketId$$string:AUS)))->cache(_type:__GetIndexPrices$$nested))) +cache(___types:EPiServer.Core.IContent)))->cache(___types:Foundation.Features.CatalogContent.Product.GenericProduct)],from[-1],size[-1]: Parse Failure [No mapping found for [GetIndexPrices$$nested.UnitPriceAmount$$number] in order to sort on]]; "
},
{"index": "foundationoct001","shard": 1,"status": 400,"reason": "RemoteTransportException[[demo04pv7data00000H][inet[/10.130.52.36:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[foundationoct001][1]: query[filtered(ConstantScore(+cache(Name$$string:ROBERT SNEAKER) cache(Name$$string:MORGAN SNEAKER) +cache(Language.Name$$string:en) +QueryWrapperFilter(ToParentBlockJoinQuery (filtered(ConstantScore(cache(GetIndexPrices$$nested.MarketId$$string:AUS)))->cache(_type:__GetIndexPrices$$nested))) +cache(___types:EPiServer.Core.IContent)))->cache(___types:Foundation.Features.CatalogContent.Product.GenericProduct)],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"filtered\":{\"filter\":{\"term\":{\"___types\":\"Foundation.Features.CatalogContent.Product.GenericProduct\"}},\"query\":{\"constant_score\":{\"filter\":{\"and\":[{\"or\":[{\"term\":{\"Name$$string\":\"ROBERT SNEAKER\"}},{\"term\":{\"Name$$string\":\"MORGAN SNEAKER\"}}]},{\"term\":{\"Language.Name$$string\":\"en\"}},{\"nested\":{\"filter\":{\"term\":{\"GetIndexPrices$$nested.MarketId$$string\":\"AUS\"}},\"path\":\"GetIndexPrices$$nested\"}},{\"term\":{\"___types\":\"EPiServer.Core.IContent\"}}]}}}}},\"_source\":[\"___types\",\"ContentLink.ID$$number\",\"ContentLink.ProviderName$$string\",\"Language.Name$$string\"],\"sort\":[{\"GetIndexPrices$$nested.UnitPriceAmount$$number\":{\"nested_path\":\"GetIndexPrices$$nested\",\"nested_filter\":{\"term\":{\"GetIndexPrices$$nested.MarketId$$string\":\"AUS\"}},\"missing\":\"_last\",\"order\":\"asc\"}}]}]]]; nested: SearchParseException[[foundationoct001][1]: query[filtered(ConstantScore(+cache(Name$$string:ROBERT SNEAKER) cache(Name$$string:MORGAN SNEAKER) +cache(Language.Name$$string:en) +QueryWrapperFilter(ToParentBlockJoinQuery (filtered(ConstantScore(cache(GetIndexPrices$$nested.MarketId$$string:AUS)))->cache(_type:__GetIndexPrices$$nested))) +cache(___types:EPiServer.Core.IContent)))->cache(___types:Foundation.Features.CatalogContent.Product.GenericProduct)],from[-1],size[-1]: Parse Failure [No mapping found for [GetIndexPrices$$nested.UnitPriceAmount$$number] in order to sort on]]; "
}
]
},"hits": {"total": 2,"max_score": null,"hits": [
{"_index": "foundationoct001-standard","_type": "Foundation_Features_CatalogContent_Product_GenericProduct","_id": "CatalogContent_c403f8d8-c6e1-415c-895a-d5411fdc483d_en","_score": null,"_source": {"ContentLink": {}
},"fields": {"___types": ["Foundation.Features.CatalogContent.Product.GenericProduct_DynamicProxy","Foundation.Features.CatalogContent.Product.GenericProduct","EPiServer.Commerce.Catalog.ContentTypes.ProductContent","EPiServer.Commerce.Catalog.ContentTypes.EntryContentBase","EPiServer.Commerce.Catalog.ContentTypes.CatalogContentBase","EPiServer.Core.ContentData","System.Object","EPiServer.Core.IContentData","EPiServer.Core.IInitializableContent","EPiServer.Core.IModifiedTrackable","EPiServer.Data.Entity.IReadOnly","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Commerce.Catalog.ContentTypes.CatalogContentBase, EPiServer.Business.Commerce, Version=14.29.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Core.IContent","EPiServer.Core.ILocalizable","EPiServer.Core.ILocale","EPiServer.Core.IVersionable","EPiServer.Web.Routing.IRoutable","EPiServer.Security.ISecurable","EPiServer.Commerce.Catalog.ContentTypes.IMetaClass","EPiServer.Commerce.Catalog.ContentTypes.ISearchEngineInformation","EPiServer.Core.IChangeTrackable","EPiServer.Commerce.Catalog.ContentTypes.ICategorizable","EPiServer.Commerce.Catalog.ContentTypes.IAssociating","EPiServer.Commerce.Catalog.ContentTypes.IAssetContainer","EPiServer.Commerce.Catalog.ContentTypes.IVariantContainer","Foundation.Features.CatalogContent.IProductRecommendations","Foundation.Features.Shared.IFoundationContent"
],"Language.Name$$string": "en","ContentLink.ProviderName$$string": "CatalogContent","ContentLink.ID$$number": 51
},"sort": [
10.5
]
},
{"_index": "foundationoct001-standard","_type": "Foundation_Features_CatalogContent_Product_GenericProduct","_id": "CatalogContent_c440111b-1cb1-42e4-a0f9-efbbc4b6ed0f_en","_score": null,"_source": {"ContentLink": {}
},"fields": {"___types": ["Foundation.Features.CatalogContent.Product.GenericProduct_DynamicProxy","Foundation.Features.CatalogContent.Product.GenericProduct","EPiServer.Commerce.Catalog.ContentTypes.ProductContent","EPiServer.Commerce.Catalog.ContentTypes.EntryContentBase","EPiServer.Commerce.Catalog.ContentTypes.CatalogContentBase","EPiServer.Core.ContentData","System.Object","EPiServer.Core.IContentData","EPiServer.Core.IInitializableContent","EPiServer.Core.IModifiedTrackable","EPiServer.Data.Entity.IReadOnly","EPiServer.Data.Entity.IReadOnly`1[[EPiServer.Commerce.Catalog.ContentTypes.CatalogContentBase, EPiServer.Business.Commerce, Version=14.29.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]","EPiServer.Core.IContent","EPiServer.Core.ILocalizable","EPiServer.Core.ILocale","EPiServer.Core.IVersionable","EPiServer.Web.Routing.IRoutable","EPiServer.Security.ISecurable","EPiServer.Commerce.Catalog.ContentTypes.IMetaClass","EPiServer.Commerce.Catalog.ContentTypes.ISearchEngineInformation","EPiServer.Core.IChangeTrackable","EPiServer.Commerce.Catalog.ContentTypes.ICategorizable","EPiServer.Commerce.Catalog.ContentTypes.IAssociating","EPiServer.Commerce.Catalog.ContentTypes.IAssetContainer","EPiServer.Commerce.Catalog.ContentTypes.IVariantContainer","Foundation.Features.CatalogContent.IProductRecommendations","Foundation.Features.Shared.IFoundationContent"
],"Language.Name$$string": "en","ContentLink.ProviderName$$string": "CatalogContent","ContentLink.ID$$number": 44
},"sort": [
24.5
]
}
]
}
}