The censhare Expert search is a tool for experienced users to search for assets. Search all features and relations in your system. Build comprehensive searches using the logical NOT and the RELATION operator.


Purpose

  • Search within all asset properties and asset relations.

  • Search over relations in an asset structure.

  • Exclude results from the search with the logical operator NOT.

Context

  • General functionality of the censhare user interface.

  • The Expert search is part of the overall search functionality in censhare.

  • The Expert search can be used together with the Quick search.

Introduction

The Expert search is a powerful tool that allows you to define complex search queries in censhare. There are different operators that you can combine to search for asset properties and relations. This article introduces the following operators:

  • The RELATION operator

  • The logical operator NOT

It requires the following knowledge of the Expert search:

  • Search for any asset property in your system.

  • Combine search terms for asset properties with AND respective OR.

  • Use the RELATION operator to search for assets that have a certain relation.

Besides that, you can:

  • Combine AND and OR in several ways to define complex searches.

For more information, see Related articles.

RELATION: Find related assets

The RELATION operator allows to search for assets within an asset structure that are related with each other by different relations. For example, you can search for Image assets that are assigned to an Article asset:

(Type = Article) AND RELATION(Direction = Child relation, Type = Assignment)
CODE

Use the RELATION operator to search for assets that have multiple relations. For example, search for layouts that are planned and in which assets have already been placed: 

(Type = Layout) AND RELATION(Direction = Parent relation, Type = Planning) AND RELATION(Direction = Childrelation, Type = Placement)
CODE

Use the RELATION operator to search for hierarchical relations, for example images that are placed in a layout. The layout, in turn, should be planned for an issue: 

(Type = Image) AND RELATION(Direction = Parent relation, Type = Placement) AND ((Type = Layout) AND RELATION((Direction = Parent relation, Type = Planning) AND (Type = Issue))))
CODE

NOT: Exclude results

The NOT operator allows you to exclude assets from the search result. For example, search for images that do not have the topics "mountain" or "people":

(Type = Image) AND NOT((Topic = Mountains) OR (Topic = People))
CODE

For simple operations, the NOT operator is not required. Instead, use the relational operator "!=" for these purposes. For example, search for images that do not have the MIME type "TIFF image":

(Type = Image) AND (MIME Type != "TIFF image")
CODE

RELATION

The RELATION operator

The RELATION operator allows to search over one or more asset relations. For more information, see Basic operations.

Multiple parallel relations

You can search assets that have more than one relation to other assets. For example, search layouts that are planned and in which assets have been placed:

AND ( 
	(Type = Layout) 
	RELATION ( 
		(Direction = Parent relation, 
		Type = Planning) 
	) 
	RELATION ( 
		(Direction = Child relation, 
		Type = Placement) 
	)
) 
CODE

To add a search for parallel relations. For example, the asset you are looking for has relation A to asset B and also relation C to asset D:

  1. Click "+" icon on the bottom left and select RELATION.

  2. A new relation block is displayed aligned with the previous block.

    Specify the RELATION parameters like Direction andType. 

Multiple hierarchical relations

You can search assets that are part of greater asset structures. The hierarchical relation search follows relations in asset structures over multiple levels. For example, the asset you are looking for has relation A to asset B, and asset B has relation C to asset D and so forth. For example, search images that are placed in a layout which, in turn, is planned for a task:

AND (               
	(Type = image) 
	RELATION( 
		(Direction = Parent relation, 
		Type = Placement) 
		AND ( 
			(Type = Layout) 
			RELATION( 
				(Direction = Parent relation, 
				Type = Planning) 
				AND ( 
					(Type = Issue) 
				) 
			) 
		) 
	)
)
CODE

Follow the steps to add a hierarchical RELATION search entry to an existing RELATION block:    

  1. Click the "+" icon below the RELATION block: An AND block for the existing RELATION is added.

  2. Click the "+" icon at the end of the added AND block.

  3. Select RELATION.

  4. Add the parameters for the RELATION.

The search: (TYPE = Image) AND RELATION (Direction = Parent relation, Type = Placement).

After creating the operator for the target asset (4) click the "+" icon (3) to add a condition for it. Use the "+" icon (2) to create an additional RELATION condition in order to search for relations to the target asset.

NOT

The NOT operator

If you want to exclude assets with certain properties from the query, use the NOT operator and specify the property and values that must not match. For example, search images that do not have a "Mountains" keyword:

AND ( (Type = Image) NOT( (Topic = Mountains) ) )
CODE

To add a NOT operator:

  1. Click the "+" icon below for the operators and select NOT.

  2. Click the right-indented "+" icon. This adds a new search term to the NOT block.

  3. Define the search parameter that must not match.

The search = (Type = Image).
After adding the NOT operator (3) you can use the "+" icon (2) to add parameters. Use the "Remove operator" icon (1) to delete the NOT condition.

Add additional parameters to the NOT operator:

  1. Click "+" icon next to the search term. This adds a new search term below the NOT operator. 

If you add multiple parameters to a NOT operator, the search only shows results in which all parameters are false. If you add the two search terms "Topic = Mountain" and "Topic = People", the result only shows assets that do not have both keywords "Mountain" and "People": 

(Type = Image) AND NOT((Topic = Mountains) AND (Topic = People))
CODE

If an asset has only one of the keywords "Mountain" or "People", it will be shown. To exclude assets that have either the keyword "Mountain" or "People", the search must be formulated as shown in the following section.

Combine multiple NOT conditions

If you want to use multiple NOT conditions that match individually, you must combine the NOT operator with an OR operator or add a NOT operator for each search term. For example, you want to exclude assets that have either the "Mountains" keyword or the "People" keyword:

AND ( (Type = Image) NOT( OR ( (Topic = Mountains) (Topic = People) ) ) )
CODE

To build this search query:

  1. Click the "+" icon below the AND operator and enter the search term "Type = Image".

  2. Click the "+" icon at the bottom left (operator button) and select NOT. 

  3. Click the "+" icon for the operators below the NOT query block and select OR.

  4. Click the "+" icon below the OR and add the search term "Topic = Mountains".

  5. Click the "+" icon behind the search term to add another search term.

  6. Enter the search term "Topic = People".

NOT: Exclude results from an OR condition

If you combine the OR logic with a NOT logic, they must be nested inside an AND. This creates a search where either A or B must be true and C must not be true.

For example, search for assets that have either Person 1 or Person 2 as a Workflow target, but were not created by Person 3:

AND ( 
	OR ( 
		(Workflow target = Person 1) 
		(Workflow target = Person 2) 
		) 
		NOT 
			(Createdby = Person 3) 
		) 
	)
CODE

To build this search query:

  1. Click "+" icon at the bottom left (operator button) and select OR.

  2. Click "+" icon below the OR query block and enter the search term "Workflow target = Person 1".

  3. Click "+" icon at the end of search term you entered in the previous step to add anothers earch term.

  4. Enter the search term "Workflow target = Person 2".

  5. Click the "+" icon at the bottom left (operator button) and select NOT. A new NOT query block is displayed aligned with the previous OR query block.    

    Important: Do not select the right-indented operator button below the search term. This creates a nested NOT query block inside the OR block! 

  6. Click theright-indented "+" icon below the NOT query block and enter the search term "Created by = Person 3".

The search query for ((Workflow target = Person 1) OR (Workflow target = Person 1)) AND NOT(Created by = Person 3)

AND, NOT and RELATION combined

You can combine AND, RELATION and NOT operators with one another. For example, you are searching for all images that do not have the topic "mountains" and that are placed in a layout:

AND ( 
	(Type = Image) 
	NOT 
		(Topic = Mountains) 
	RELATION( 
		(Direction = Parent relation, 
		Type = Placement) 
		AND ( 
			(Type = Layout) 
		) 
	) 
)
CODE

To build this search query:

  1. Click the "+" icon below the AND operator and enter the search term "Type = Image".

  2. Click the"+" icon at the bottom left (operator button) and select NOT.

  3. Click the "+" icon for the parameters below NOT to add a search term.

  4. Enter the search term "Topic = Mountains".

  5. Click the "+" icon at the bottom left (operator button) and select RELATION. A new relation block is displayed.

  6. Specify the RELATION parameters "Direction = Parent relation, Type = Placement".

  7. Click the"+" icon below the RELATION block and add a condition for the related asset.

  8. Enter the search term "Type = Layout".

First, add the parameter for the "Image" type. Whether you now add the NOT operator and then the RELATION operator, orvice-a-versa, does not matter. All three conditions will be linked with AND.

The search: (TYPE = Image) AND NOT(Topic = Mountains) AND RELATION((Direction = Parent relation, Type = Placement) AND (Type = Layout)).

If you follow the respective line (1) upward you will see that all of them point to an AND. All three conditions are linked with AND.

Workflows and workflow steps

Workflow steps are assigned to a workflow. Therefore, whenever you search for assets with a certain workflow step, you must add a workflow value. Otherwise, the "Workflow step" condition does not show any options to select.

For example, you search for image assets in the workflow step "approved". Enter first the condition with the respective workflow to which the workflow step is assigned:

((Workflow = Image editing) AND (Workflow step = approved))
CODE

In this case, the workflow is "Image editing". The available workflows and workflow steps are specific in your system.

To search for assets that are NOT assigned to a workflow step, the search query must be written likewise. Instead of the "="relational operator, use the "!=" relational operator:

((Workflow = Image editing) AND (Workflow step != approved))
CODE

However, in large data bases, this query syntax causes performance issues and slows down the search significantly. This is because censhare cannot execute the search for the workflow and the workflow step in parallel.

If you experience performance issues in searches of the above type, you can rewrite the search as follows:

(Workflow = Image editing) NOT ((Workflow = Image editing) AND (Workflow step = approved))
CODE

This notation combines both, the workflow and workflow step to be excluded from the results in an AND condition. This allows censhare to search for the workflow and the workflow step in parallel. As of that, the search can be executed faster and avoids low performance on this type of search queries in large databases.

Result

You have learned to use the logical operator NOT and the operator RELATION in different situations.