Documentation
Search in CATEGORIES
Searching elements of a category :
<SEARCH>
<MEDIA>
<CATEGORY operator="descendant" name='Music'/>
</MEDIA>
</SEARCH>
This query will also match the elements of the subcategories of "Music" (e.g. Jazz, Blues, Rock). If you don't want the elements in the subcategories, but only the elements in this exact category, you must indicate the operator IS. If you don't put an operator, the descendant operator is used.
<SEARCH>
<MEDIA>
<CATEGORY operator="IS" name='Music'/>
</MEDIA>
</SEARCH>
Searching the elements that are not in a category
<SEARCH>
<MEDIA>
<CATEGORY operator="not" name='Music'/>
</MEDIA>
</SEARCH>
Searching elements of a category or another : A or B
<SEARCH>
<MEDIA>
<CATEGORY name='Blues'/>
<CATEGORY name='Jazz'/>
</MEDIA>
</SEARCH>
This search will match the medias that were assigned one of the two categories : Blues OR Jazz.
Searching elements in both categories : A and B
<SEARCH>
<MEDIA>
<CATEGORY and_group='BluesJazzFusion' name='Blues'/>
<CATEGORY and_group='BluesJazzFusion' name='Jazz'/>
</MEDIA>
</SEARCH>
This search will match the medias that were assigned the two categories : Blues AND Jazz.
Grouping is used to indicate that two conditions must be applied together for the media to match.
Be aware that and_group and or_group is a feature only available for categories.
(A and B) or (X and Y)
<SEARCH>
<MEDIA>
<CATEGORY and_group='BluesJazzFusion' name='Blues'/>
<CATEGORY and_group='BluesJazzFusion' name='Jazz'/>
<CATEGORY and_group='PopRock' name='Pop'/>
<CATEGORY and_group='PopRock' name='Rock'/>
</MEDIA>
</SEARCH>
This search will match the medias with (Blues AND Jazz) OR (Pop AND Rock).
The OR logical operator is applied between the groups.
Grouping differently : (A or B) AND (X or Y)
<SEARCH>
<MEDIA>
<CATEGORY or_group='DocumentType' name='Book'/>
<CATEGORY or_group='DocumentType' name='Novel'/>
<CATEGORY or_group='Theme' name='SQL'/>
<CATEGORY or_group='Theme' name='Java'/>
</MEDIA>
</SEARCH>
We are looking for a book or a novel speaking about SQL or Java.
The AND logical operator is applied between the groups.
Long notation :
Be aware that all these notations are short notations for the classical syntax, closer to the returned XML, which looks like this :
<SEARCH>
<MEDIA>
<CATEGORIES>
<CATEGORY name='Music'/>
</CATEGORIES>
</MEDIA>
</SEARCH>