+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Dynamic Content filtering in backend have to many ORs and query returns Timeout

Dynamic Content filtering in backend have to many ORs and query returns Timeout

1 posts, 0 answered
  1. Setxi
    Setxi avatar
    7 posts
    Registered:
    16 Mar 2015
    10 Oct
    Link to this post

    Hi all,

    When in the backend of sitefinity we search in NewsItem it looks on the Title if Contains the word.

    http://www.fxstreet.com/Sitefinity/Services/Content/NewsItemService.svc/?managerType=&providerName=&itemType=Telerik.Sitefinity.News.Model.NewsItem&provider=OpenAccessDataProvider&sortExpression=DateCreated%20DESC&skip=0&take=500&filter=(Title.ToUpper().Contains(%22trade%22.ToUpper())
    Title%5B%22%22%5D.ToUpper().Contains(%22trade%22.ToUpper()))

    But when we search in DynamicContent let says Analysis(in our system is quite similar to NewsItem table structure) it looks in all the string fields if they Contains the word  so the query its to slow and results in a timeout.

    http://www.fxstreet.com/Sitefinity/Services/DynamicModules/Data.svc/?managerType=Telerik.Sitefinity.DynamicModules.DynamicModuleManager&providerName=OpenAccessProvider&itemType=Telerik.Sitefinity.DynamicTypes.Model.FXVideos.FXVideo&provider=OpenAccessProvider&sortExpression=LastModified%20DESC&skip=0&take=50&filter=
    (FXContent.ToUpper().Contains(%22trade%22.ToUpper()) %20OR%20    
    Title.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    Content.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    Summary.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    PostId.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    PostAuthorId.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    PostCompanyId.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    PostLanguageId.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    PostImageUrl.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    PostImageCaption.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    PostImageCopyright.ToUpper().Contains(%22trade%22.ToUpper())  %20OR%20   
    FullUrl.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    PostFeedId.ToUpper().Contains(%22trade%22.ToUpper())   %20OR%20 
    MetaTitle.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    MetaDescription.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    MetaKeywords.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    VideoUrl.ToUpper().Contains(%22trade%22.ToUpper())     %20OR%20
    SponsorTitle.ToUpper().Contains(%22trade%22.ToUpper())    %20OR%20
    SponsorUrl.ToUpper().Contains(%22trade%22.ToUpper())   %20OR%20  
    SponsorImageUrl.ToUpper().Contains(%22trade%22.ToUpper()))

     

    So my question the DynamicContent filter can be customizables and how to do it?

    Regards

1 posts, 0 answered