More in this section

Forums / Developing with Sitefinity / Filters on seacrh box

Filters on seacrh box

7 posts, 0 answered
  1. Gokhan
    Gokhan avatar
    6 posts
    Registered:
    14 Jul 2008
    28 Aug 2009
    Link to this post
    Hi ;

    I m using Sitefinity 3.6 and adding some custom attributes to pages then i want to add more fields into search box user control and filter search results by those selected values. It is so obvious to put some more controls into search template but how can i pass these parameters to search results page and filter results by those values ?

    Thank you 
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    31 Aug 2009
    Link to this post
    Hello Gokhan,

    It really depends on the fields you want to include. Generally it is possible, but you may end up creating a custom search logic. We can provide you with some samples for this. Just let me know what fields you want to use.

    Kind regards,
    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.
  3. Gokhan
    Gokhan avatar
    6 posts
    Registered:
    14 Jul 2008
    31 Aug 2009
    Link to this post
    hi;

    Actually my custom fields will be my custom metadata fields such as a "vendor of page","Index code"... i create my tables(i know it is kind of database hack but this was the best option) related to page and created my own index provider but i want to be able to add some filters to search box control and change query regarding to this selected fields. 

    This was the method  i applied . Now i wanna put these new fields into search box and populate data with this query 
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    01 Sep 2009
    Link to this post
    Hello Gokhan,

    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();     
    }  
     

    Perhaps you can subscribe to the rptResults.DataBind and check the ResultItems?

    Greetings,
    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.
  5. Gokhan
    Gokhan avatar
    32 posts
    Registered:
    11 Jul 2008
    03 Sep 2009
    Link to this post
    Hi Georgi;

    Sorry i was busy with another implementation recently, i couldnt respond. This inspiration will help a lot Thank you But i have still query in mind how i ll be able to add custom fields to this collection?Is there a way to achieve this when i fetch the data or do i have to do merge Search data and my custom data via PageId?

    Thank you a lot .
  6. Gokhan
    Gokhan avatar
    32 posts
    Registered:
    11 Jul 2008
    07 Sep 2009
    Link to this post
    Hi ;

    Is there any work around solution that i can extend default ResultItem and put extra fields into new one and populate those data from Database? Telerik.Search.Engine.ResultItem returns just 4 fields.i need to add more fields into it or override "Telerik.Search.Engine.SearchManager.Search " and add my filtering fields into search method. Please update this quickly as i need to find a solution asap.
  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    09 Sep 2009
    Link to this post
    Hello Gokhan,

    Please take a look at the following forum thread - http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/custom-search-provider.aspx

    It shows you how to do custom filtering, and override the ResultItem.

    Kind regards,
    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