Umbraco commerce 16.5.1
Umbraco 16.4.1
I have created a custom order advanced filter on my project which I use to allow users to filter based on a tracking number (this comes from a custom package which adds a textbox to each order for tracking numbers. It is referenced in the OrderReadOnly properties but when I go to use my custom filter to filter the results, it is significantly slower than the rest of the filters. Is there anything I am missing in terms of optimizing it.
Below is the filter base I have created
[AdvancedFilter("telephone", Group = "customer", EditorUiAlias = "Umb.PropertyEditorUi.TextBox",
Label = "Phone Number", Description = "The shipping telephone number for the order")]
public class OrderPhoneNumberAdvancedFilter : OrderAdvancedFilterBase
{
public override bool CanApply(string value)
{
return !string.IsNullOrWhiteSpace(value);
}
public override IQuerySpecification<OrderReadOnly> Apply(IQuerySpecification<OrderReadOnly> query, IOrderQuerySpecificationFactory where, string value)
{
return query.And(where.HasProperty("telephone", value, StringComparisonType.Contains));
}
}
And here is my composer
namespace ProfileStore.Web.Composing
{
public class OrderFiltersComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.WithUmbracoCommerceBuilder().WithOrderAdvancedFilters()
.Add<OrderPhoneNumberAdvancedFilter>()
.Add<OrderDxTrackingAdvancedFilter>()
.Add<OrderDpdTrackingAdvancedFilter>();
}
}
}