A comprehensive Expert search example that guides you to build the search step-by-step.
Prerequisites
To use the Expert search, you need a deeper understanding of the data model in censhare and assets relations.
Introduction
You can use the Expert search to create complex queries. If you want to setup such a query, we recommend you take systematic approach to build your search:
Write search terms in a formal language.
Use a hierarchical tree structure to put the query parts together.
Add search query blocks one-by-one in the Expert search dialog, starting with the top-level block.
Test each step in the Expert search and check if the results are as you expect.
The following part guides you though the build process of a complex query step by step.
Example
This article shows how the following search is translated step-by-step into a formal query notation and entered in the Expert search dialog of censhare Web:
Search for images in the "World Publisher" domain and layouts that are planned for an issue. Additionally, layouts in the second domain “root” or "Nature Travel Magazine" are wanted as well.
Key steps
Write down the search in the formal notation.
Convert the formal notation into the prefixnotation.
Use the prefix notation to enter the query in the Expert search.
Formal notation
In the first step, search for images in the "World Publisher" domain. The formal notation is:
(Type = Image) AND (Domain = World Publisher)
(Type = Layout) AND RELATION((Direction = Parent, Type = Planning) AND Target(Type = Issue)))
((Type = Image) AND (Domain = World Publisher)) OR ((Type = Layout) AND RELATION((Direction = Parent, Type = Planning) AND (Target(Type = Issue)))
Write the additional conditions for the layouts:
(2. Domain = Root) OR (2. Domain = Nature Travel Magazine)
(Type = Layout) AND ((2. Domain = Root) OR (2. Domain = Nature Travel)) AND RELATION((Direction = Parent, Type = Planning) AND (Target(Type = Issue)))
((Type = Image) AND (Domain = World Publisher)) OR ((Type = Layout) AND ((2. Domain = Root) OR (2. Domain = Nature Travel)) AND RELATION((Direction = Parent, Type = Planning) AND (Target(Type = Issue))))
(Image AND World Publisher) OR (Layout AND (Root OR Nature Travel) AND RELATION((Parent, Planning) AND TARGET (Issue)))
Prefix notation
1. Step
First, identify the top-level query. Look for the operator that is not placed inside brackets:
(Image AND World Publisher) OR (Layout AND (Root OR Nature Travel) AND RELATION((Parent, Planning) AND TARGET (Issue)))
OR (Image AND World Publisher) (Layout AND (Root OR Nature Travel) AND RELATION((Parent, Planning) AND TARGET (Issue)))
Proceed in the same way with each branch or query part. The transformation eliminates the brackets step-by-step.
2. Step
Look forthe next level of brackets:
(Image AND World Publisher) OR (Layout AND (Root OR Nature Travel) AND RELATION((Parent, Planning) AND TARGET (Issue)))
If there is no next level of brackets for a part of the search query, look there for the search terms:
( Image AND World Publisher ) OR ( Layout AND (Root OR Nature Travel) AND RELATION((Parent, Planning) AND TARGET (Issue)))
OR AND Image WorldPublisher AND Layout (Root OR Nature Travel) RELATION((Parent, Planning) AND TARGET (Issue))
3. Step
Look for the next level of brackets:
(Image AND World Publisher) OR (Layout AND (Root OR Nature Travel) AND RELATION( (Parent, Planning) AND TARGET (Issue)))
Look for search terms:
(Image AND World Publisher) OR (Layout AND ( Root OR Nature Travel ) AND RELATION((Parent,Planning) AND TARGET (Issue)))
The prefix notation:
OR AND Image WorldPublisher AND Layout OR Root NatureTravel RELATION (Parent, Planning AND TARGET (Issue))
4. Step
Look for the next level of brackets:
(Image AND World Publisher) OR (Layout AND (Root OR Nature Travel) AND RELATION((Parent, Planning) AND TARGET (Issue)))
Look for search terms:
(Image AND World Publisher) OR (Layout AND (Root OR Nature Travel) AND RELATION( (Parent, Planning) AND TARGET (Issue) ))
The prefix notation:
OR AND Image World Publisher AND Layout OR Root Nature Travel RELATION (Parent, Planning) AND TARGET(Issue)
Enter the query
With the tree structure, you can create the search query in the Expert search dialog. Add the OR and the two AND operators inside:
OR AND AND
Add the first parameters, the second OR operator and the RELATION:
OR AND Type = Image Domain = World Publisher AND Type = Layout OR RELATION
Enter the parameters for the OR relation and the first part of the RELATION:
OR AND Type = Image Domain = World Publisher AND Type = Layout OR 2. Domain = Root 2. Domain = Nature Travel RELATION Direction = Parent Type = Planning Target
Finally, add the condition for the target asset:
OR AND Type = Image Domain = World Publisher AND Type = Layout OR 2. Domain = Root 2. Domain = Nature Travel RELATION Direction = Parent Type = Planning Target Type = Issue
Result
You have written down an a complex search example in a formal notation. You have converted the formal notation into the prefix notation. Following the prefix notation, you have entered the query inthe Expert search.