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

Forums / Developing with Sitefinity / GetDocuments partial match

GetDocuments partial match

3 posts, 1 answered
  1. Richard
    Richard avatar
    103 posts
    Registered:
    04 Apr 2013
    06 Feb 2015
    Link to this post

    First off, nice documentation on the api. But, I'm looking to go one step further in the GetDocuments method. Currently when I want to find a document(s), I can search by title. This has to be an exact match using the examples but no information on partial matching. I'd like to supply a criteria using a wild card(s). Ie, 'search item*', '%item' or '%ear%' to find me a file(s). This is my exact match using title method. 

                var document = libManager.GetDocuments().Where(d => d.Title == title).FirstOrDefault();

  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    06 Feb 2015 in reply to Richard
    Link to this post
    d.Title.Contains("searchterm") or maybe d.Title.ToString().Contains("searchterm")?
    Answered
  3. Richard
    Richard avatar
    103 posts
    Registered:
    04 Apr 2013
    06 Feb 2015 in reply to Steve
    Link to this post
    (thumbs up)
3 posts, 1 answered