Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Powerslice not working as expected

$
0
0

I am using powerslice for pages and blocks and Media documents in my application. Below is the sample. However when I try to query with file name I dont see something matching the searched text rather the result is just alphabetical list.

I tried to add wildcard search filter but still the result is same. What am I missing.

[ServiceConfiguration(typeof(IContentQuery)), ServiceConfiguration(typeof(IContentSlice))]
public class DocumentsSlice : ContentSliceBase<CategorizableMedia>
{
public override string Name => "Documents";

public override int SortOrder => 2;
protected override ITypeSearch<CategorizableMedia> Filter(ITypeSearch<CategorizableMedia> searchRequest, ContentQueryParameters parameters)
{
var searchText = parameters?.AllParameters["q"] ?? "";
var filter = searchRequest.WildCardSearch($"{searchText.ToLower()}*", f => f.Name);

return base.Filter(filter, parameters);
}
}


Viewing all articles
Browse latest Browse all 8020

Trending Articles