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

Forums / Developing with Sitefinity / How to make the search control find categories and tags?

How to make the search control find categories and tags?

4 posts, 0 answered
  1. Bruno Michels
    Bruno Michels avatar
    125 posts
    Registered:
    16 Apr 2010
    16 Jul 2010
    Link to this post
    How can I make the search control find content by categories and tags?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Jul 2010
    Link to this post
    Hi Bruno Michels,

    There are two options

    1. Filter SearchResults control by adding the content id to the snippet and then from there you can check whether an item has been tagged/categorized. Here is a similar request - Extending SearchResult

    2. Another option is filtering the items directly from a custom Search provider( bonus track) where you have to override GetContentToIndex and add the items you want.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Bruno Michels
    Bruno Michels avatar
    125 posts
    Registered:
    16 Apr 2010
    20 Aug 2010
    Link to this post
    So I should add category and tags in this file? How?

    fieldsInfoProvider.xml
    <?xml version="1.0" encoding="utf-8"?>
    <fields>
      <field name="title" weight="1" indexAttribute="" filterTag="title" filterAttributes="" />
      <field name="keywords" weight="1" indexAttribute="content" filterTag="meta" filterAttributes="name:keywords;" />
      <field name="description" weight="1" indexAttribute="content" filterTag="meta" filterAttributes="name:description;" />
      <field name="script" weight="-1" indexAttribute="" filterTag="script" filterAttributes="" />
      <field name="style" weight="-1" indexAttribute="" filterTag="style" filterAttributes="" />
    </fields>
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Aug 2010
    Link to this post
    Hello Bruno Michels,

    You cannot add category or tag in this file. You can add the guid of the item and then extract the ID from the ResultItem snippet. This will give you the id of the content item and then category for this content item.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered