2

In the content editor's search functionality, is there a way to perform a search to find items where I'm checking for the value of a boolean/checkbox field? Like if I have an "active" checkbox in my item template, can I do a content editor search to find just those checked on?

Secondarily, is there a way to save content editor searches for reusability that's easy? Or is this looking at building a SPEAK interface for an author to use?

  • 1
    Why not use Sitecore Powershell Extensions? Those can do all you seek.. (searching for actives and saving for reusability) – Gatogordo Sep 13 at 15:01
5

Yes, It's possible.

Click on Search by a field value as shown in the below screenshot and search for active|1.

It will show all items having active checkbox checked.

enter image description here

To save queries as default query or make it persistent you have options available on the item under Item Buckets section

To define a default search:

  1. In the content tree, navigate to the item you want to create a default search for.

  2. On the Content tab, in the Item Buckets section, in the Default bucket query field, enter a query. For example

enter image description here

You can enter a query manually, paste in a query, or you can build a query in the Build Search Query dialog:

enter image description here

When users open a new search tab, it looks, for example, like this:

enter image description here

Make a search query persistent

When users open a new search tab, they can delete the filters in the query by clicking X. If you do not want users to be able to remove parts of the query, you can make the search query persistent.

To make a search query persistent:

  1. In the content tree, navigate to the item you want to define a persistent query for.

  2. On the Content tab, in the Item Buckets section, in the Persistent bucket filter field, enter a query.

Sitecore supports these filters:

  • tag

  • template

  • location

  • sort

  • custom

  • tag

  • start

  • end

You can add multiple filters with a semicolon between the filters.

Note

Every filter is case sensitive.

For example, to search for the keyword pineapple between a start date of 03/03/2012 and an end date of 04/04/2012, the filter string is:

text:pineapple;start=03/03/2012;end=04/04/2012

References

3

I am writing this for the second part of your question. If you want regularly run the same search query from the same item in the content editor then you can save the search but OOTB Sitecore will save only one search for one item. That is actually same which we use in bucket search in the content editor but will work on non-bucket items as well-
https://doc.sitecore.com/users/81/sitecore-experience-platform/en/save-a-search-query-for-an-item-bucket.html

NOTE - The search queries that you save on an item bucket are unique to your own Sitecore account. However, your Sitecore administrator should set up all the saved searches and determine whether they should be available to a specific user or to all users.

  • Default Bucket Query – a query that appears in the search field every time you open the search tab. If necessary, you can delete the query from the search field. The default query is ‘text:*’, which results in returning everything.
  • Persistent Bucket Filter – a query that appears in the search field every time you open it and that you cannot delete. The default query consists of the ‘location:{ID of the parent item}’, which states the location from where the search should be run, and the ‘-template:{ID of the saved search template}’, which states that items based on the saved search template should not be displayed.

To save a search query on an item bucket:

  1. Click the item on which you want to save the search query and on the Content tab scroll down to the Item Buckets section.
  2. Click Build Query above the query you want to build.

enter image description here

  1. In the Build a Search Query dialog box, in the Search field, build your search query by adding the relevant filters and search keywords and then click OK. For example, the search query for the checkbox field in your question, save the changes. enter image description here

Now next time you will click on the search tab it will filter the result based on your query. I guess this will help.

  • Excellent, thanks! Wish I could double-answer this one... – Ken McAndrew Sep 14 at 10:02

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.