8

I want to add a search filter which can be used for building search queries in Sitecore as per described in the documentation. The search filter should filter by inherited templates.

I have followed the description here:

  1. In the content tree, navigate to /sitecore/system/Settings/Buckets/Search Types. Sitecore recommends that you add new search filters in the User Defined folder.
  2. Select the User Defined folder, and on the Home tab, in the Insert group click Field Search Type. Give the new search type an appropriate name. This is the name that users enter in the search box to apply the filter. For example: if you name the search type Date, the user must type in Date: in the search box to apply the filter. The name is case sensitive.
  3. In the new search type item, in the Search Type section, in the Control Type field select the type of control that is most appropriate for your search.
  4. In the Display Text field, enter an appropriate text and ensure that the wording is consistent with all the other search filters. This text is displayed in the drop-down menu when users browse the search filters.
  5. If you want to apply a custom syntax to the Control Type field to create specific output., enter this in the Web Method field. For example, if the Control Type field is a calendar, the Web Method field can make a request to a web service to tell Sitecore to display a calendar control that only allows you to select a date from the last 2 calendar years.

However, the filter doesn't appear when I try to use it: No filter named inherit

I can see an XHR request to https://url/sitecore/shell/Applications/Buckets/ItemBucket.asmx/GetAllSearchFilters

Which returns all the filters in a JSON format, where mine is not included. The full response can be posted per request.

The data entered in the Field Type Search item is as follows:

  • Icon: /sitecore/shell/Applications/Buckets/images/text.png
  • Name: inherited
  • Field: _templatesimplemented
  • Control Type: Auto Suggest
  • Control Type Parameter:
  • Display Text: Search by Base Template
  • Web Method: ItemBucket.asmx/GetTemplates
  • Client Side Hook: id

The question is, what am I missing, to configure a Search Filter?

  • 1
    Which version of Sitecore are you on? I just followed the exact instructions with the data you entered and seems to work fine in 8.1 u3 – Christian Hagelid Oct 12 '16 at 11:26
  • I am actually on 8.1 u3. Maybe it is because I placed it in the User Defined folder. Did you do that as well? – AndreasPK Oct 12 '16 at 11:39
  • Yes I did that as well. The only difference I can see is that the control type is called Auto Suggest List. There is no Auto Suggest option – Christian Hagelid Oct 12 '16 at 11:40
  • How are you testing it? – Christian Hagelid Oct 12 '16 at 11:43
  • It is indeed called Auto Suggest List, that is a typo on my behalf. – AndreasPK Oct 12 '16 at 11:45
5

With the working examples from K. Heye and christian-hagelid, I realized that I had an assumption, and had created the Field Search Type in the Core database, where all the items lies as well.

However, it works by creating it directly in the master database.

  • 1
    I'd suggest rewording this so it's a bit clearer, and then accepting as your answer. – Chris Berg Oct 12 '16 at 13:59
2

Can you try moving your item to the root folder? /sitecore/system/Settings/Buckets/Search Types

I think Sitecore doesn't pick up the ones in the User Defined folder by default.

Tried adding it myself in 8.1 update 3 and I see the search type: enter image description here

  • I tried this, but unfortunately it did not change anything. – AndreasPK Oct 12 '16 at 11:47
  • 1
    Tried it myself now, see screenshot. It shows up in my version. – Koen Heye Oct 12 '16 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.