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

Forums / Developing with Sitefinity / Image library search

Image library search

7 posts, 0 answered
  1. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    30 Jul 2009
    Link to this post
    Hello fellow Sitefinity users,
    Is there a way to index an image library based on alt tags and display the results in a gallery format?

    Thanks,
    Devin
  2. Dido
    Dido avatar
    149 posts
    Registered:
    24 Sep 2012
    03 Aug 2009
    Link to this post
    Hello Devin,

    Yes, this is possible. You have to do two things:
    • Implement a a search index (there is an example on Ivan's Blog)
    • Modify the SearchResults template and add a code-behind to handle the binding logic

    Please inform us if you have problems in implementing this functionality.

    All the best,
    Dido
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    19 Aug 2009
    Link to this post
    Hi Dido,
    How do I get the images in a library into an IndexProvider class?

    Thanks,
    Devin
  4. Parvan
    Parvan avatar
    151 posts
    Registered:
    24 Sep 2012
    20 Aug 2009
    Link to this post
    Hi Devin,

    Your index provider is implementing the interface IIndexingServiceClient.
    You need to implement adding of images in its method GetContentToIndex.

    I hope this helps you.

    Regards,
    Parvan
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  5. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    16 Sep 2009
    Link to this post
    ....See below....
  6. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    18 Sep 2009
    Link to this post
    Hi Paravan,
    I've implemented the search index as per Ivan's blog.  My goal is to build a search results page that is similar to Google Images.  All of the images that I want to search exist in Sitefinity Libraries.  I think I understand your last post.  Can you please explain how I can add the binding logic to the code-behind in the SearchResults template?

    Thanks,
    Devin
  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    22 Sep 2009
    Link to this post
    Hello Devin,

    If I understood you correctly, you have already managed to include the images metadata and tags in the search index. Now we should work on the search results.

    The best I think is to create your own Results code.

    Here is what we are doing in the SearchResults control:
    int count;        
          
    IList<Telerik.Search.Engine.ResultItem> results = Telerik.Search.Engine.SearchManager.Search(q, "SearchTerm", 0, 10, "AnyWord"out count);           
          
    if (count == 0)           
         rptResults.Visible = false;          
    else          
    {         
         rptResults.DataSource = results;         
         rptResults.DataBind();           
    }     

    You can subscribe to the DataBind event and check each ResultItem.URL property - it should point to the image. Then include this url to an Image control.

    I hope this makes sense. 

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
7 posts, 0 answered