Manage stored and shared searches
Create search groups, create and assign searches to share within your organization. Manage searches that users created in their personal workspaces.
Introduction
Users can store their searches in their personal workspace, and share the searches. Searches can be shared within a role, in a domain, or with other users. For more information, see Store, share & manage searches.
As an administrator, you can access the Search assets that store search queries of stored searches. To create a structured hierarchy and organize the shared searches across your organization, you can create Search group assets and build a tree structure to store shared searches.
As an administrator, you can also create and share searches with all users in the system. To do this, follow the user guide for stored and shared searches.
Concept
Stored searches are stored in the system as assets of the type Module / Search. Search assets contain two properties:
- The XML-formatted search query which can be edited directly in the asset.
- A URL-encoded representation of the search query in the URL property.
The XML-formatted query is transformed into the URL-encoded query when the search is stored. When a user runs a stored search, the URL-encoded query is sent to the censhare Server.
The query syntax differs if you perform a Quick search or a Detailed search / Expert search.
The following example searches for Image assets with the Mime type = JPEG.
1. Quick search syntax
If you perform a Quick search with the conditions above and store the search, the simplified XML-formatted query in the master file is as follows:
<search>
<config sorting="-relevance" viewMode="list">
<filter vid="1"/>
</config>
<query>
<view trafo="censhare:cs5.query.asset.list" viewName="assetQueryList"/>
<and>
<condition name="censhare:asset.type" value="picture."/>
<condition name="censhare:storage_item.mimetype" value="image/jpeg"/>
</and>
</query>
</search>
The URL-encoded query that is stored in the URL property is as follows:
/search?query=&sorting=-relevance&filters=%5B%7B%22k%22:%22censhare:asset.type%22,%22g%22:%22Type%22,%22l%22:%22Image%22,%22v%22:%22picture.%22%7D,%7B%22k%22:%22censhare:storage_item.mimetype%22,%22g%22:%22Mime%20type%22,%22l%22:%22JPEG%20image%22,%22v%22:%22image%2Fjpeg%22%7D%5D
2. Detailed search / Expert search syntax
If you perform a Detailed search or Expert search with the same conditions and store the search, the simplified XML-formatted query in the master file is as follows:
<search>
<config sorting="-relevance" viewMode="list">
<advancedSearch version="1">
<query>
<condition name="censhare:asset.type" value="picture." op="=" refid="18"/>
<condition name="censhare:storage_item.mimetype" value="image/jpeg" op="=" refid="27"/>
</query>
<tag type="csSearchPage.advancedSearch" conditionCount="2" id="7"/>
</advancedSearch>
</config>
</search>
In this case, the URL-encoded query only contains a reference to the Asset ID of the Search asset:
/search?query=&sorting=-relevance&filters=%5B%5D&es=2&tag=1&searchId=22373
The searchID parameter is optional. If you do not explicitly set this parameter, censhare uses the context asset ID, which is normally the Search asset that stores the query.
Access shared and non-shared stored searches
Users can share their stored searches with user roles, in domains, or with other users/user groups. If a stored search is not shared, the non_owner_access is set to 2 (restricted access), and two owner attributes are added:
- The current user (the one who stored the search).
- The administrator group.
This makes sure that the search asset can be accessed by an administrator, even if the current user is disabled or deleted.
If a user shares a search, censhare removes the owner attribute and sets the non_owner_access attribute to 0 (full access).
The logic of sharing options (set by the user who shares a search) and access attributes (set automatically by censhare) is as follows:
(Shared Domains permissions AND Shared Roles permissions OR Shared Users permissions) AND Ownership Permissions
The domain restrictions are inherited downwards in the domain hierarchy. For example, if a search is shared in root., it is also shared in the root.domain1. and root.domain.1.domain2. If a search is shared in root.domain1.domain2., it is also shared in the root.domain1.domain2.domain3., but not in the root. and root.domain1.
Build a search group hierarchy
If you have many stored searches in your workspace, it is convenient to organize them in Search groups. You can do this on the System asset, in the Searches tab. The table on the Searches tab shows the hierarchical search group structures and assigned searches.
Asset structure of stored searches in search groups
Search groups and stored searches use the following asset relations:
Relation | Type |
---|---|
censhare:search | Asset key reference |
user.search-group-hierarchy. | Asset relation |
Or:
Example
- My searches
- My images
- My tasks
Searches can be assigned to any search group in the hierarchy:
- My searches
- My images
- My tasks
- Open tasks
- Tasks in progress
If a stored search is not assigned to a search group, it displays on top-level in Stored searches.
Build top-level search groups
To build a search group hierarchy, log in with your administrator user and do the following:
- Open the user menu and select Show system.
- On the System page, go to the Searches tab.
- In the table toolbar, click .
- Enter a name for the search group.
- Generate a resource key.
- Add sharing options.
- Click OK to save the search group.
- To create further top-level search groups, repeat the steps.
Add child search groups
To create child search groups, do the following:
- Move the cursor over the parent search group, click and select Add child search group(s) to hierarchy.
- Enter the desired details as in the steps above.
Alternatively, you can add child search groups and set the sharing options on the asset page of a search group, in the respective widgets.
Reorganize search group hierarchy
If you want to change the search group hierarchy, drag & drop a search group into another search group.
Add stored searches to a search group
To add a stored search to a search group, do the following:
Move the cursor to the parent search group and click .
Select Add search to search group.
In the dialog, the Existing asset tab is preselected. Search for the desired Stored search and click to select it.
You can only add existing searches. You cannot create a new stored search in this dialog! To create a new search, see Store, share & manage searches.
- Click OK to save your changes and close the dialog.
Remove a stored search from a search group
- Expand the search group hierarchy until the desired search item is displayed.
- Move the cursor over the search item and click .
- Click OK to confirm the action.
This action removes only the assignment of the stored search to a search group, not the search itself. If you remove the assignment of a search to a search group, it displays in the Stored searches on top level. To completely delete a stored search, see the following section.
Delete stored searches
To fully delete a stored search, you must delete the respective Search asset.