More in this section

Forums / Developing with Sitefinity / Searching for a keyword in specific categories.

Searching for a keyword in specific categories.

4 posts, 0 answered
  1. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    16 Dec 2008
    Link to this post
    I have two categories in my project.Each category has some sub categories in it.
    Here I am able to see the list of categories and the total items in the category ,using the control  'category list'.
    My requirement is  to limit my search  or search results shown to that category/sub category only.

    When a user searching for a keyword by entering the keyword in the textbox and  selecting  the category also from the drop down box provided below the text box.The search should show the results belongs to the specified category only.

    I know that sitefinity not providing search , based on categories.can any one tell me how the search functionality in sitefinity works.

    Here I got a clue...

    IndexCatalogue=NewProductsIndex&SearchQuery=home+services+industry

    if this is my query string ,the search engine trying to match all words home,servises,industry. if any of those words missed it showing no results.

    Is there any way like this to append the category to the query string to restrict the search results that are shown should belong to the specific category.

    Thank you
    Venkat.
  2. valio b
    valio b avatar
    33 posts
    Registered:
    24 Sep 2012
    16 Dec 2008
    Link to this post
    Hello Venkat,

    As you are probably already aware, Sitefinity utilizes the Lucene Search engine. Basically you need to index somehow content in text format (creating your index catalog). Then search for it.
    In Sitefinity you can specify how different terms in your query should be parsed e.g.(home+services+industry) can be set to search for (home AND services AND industry) or (home OR services OR industry). This depends on the mode of the search e.g. AllWords or "AnyWord".
    One way of implementing Search By Category would be to create separate indexes for the different categories of content. This would cause different result sets based on category.

    All the best,
    valio b
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    16 Dec 2008
    Link to this post
    Hi Valio ,

    Thank you for your reply.

    You said that we have to create indexes based on the categories.Can you please tell me how can we create indexes based on the categories or tags.

    I think this solution will solve my problem.

    thank you
    Venkat
  4. valio b
    valio b avatar
    33 posts
    Registered:
    24 Sep 2012
    16 Dec 2008
    Link to this post
    Hi Venkat,
    The idea behind using meta tags for searching by category is to define a metatag, which will hold as a value the name of your category, the you will need to add it to the fieldsInfoProvider.xml file with a relevant weight value.
    Next you need to provide some logic to check if the page in the result set contains this tag. If it does, show it, else ignore.

    Hope that helps!

    Kind regards,
    valio b
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered