Documentation
Search in INFO
Searching the Medias where Mediatype is "Menu" :
<SEARCH>
<MEDIA>
<INFO>
<MEDIATYPE operator="=">Menu</MEDIATYPE>
</INFO>
</MEDIA>
</SEARCH>
Nb: the operator "=" indicates we want an exact match. There is also an operator "LIKE" that looks for an occurence of the string inside the whole field (it's the default operator for text fields when you don't write an operator).
Here is a shorter way of writing this query :
<SEARCH>
<MEDIA mediatype="Menu"/>
</SEARCH>
Nb: this shortcut only works for the fields in INFO.
Searching the Medias where Mediatype is "Menu" and Pagetocall is "NewsHome" :
<SEARCH>
<MEDIA>
<INFO>
<MEDIATYPE operator="=">Menu</MEDIATYPE>
<PAGETOCALL operator="=">NewsHome</PAGETOCALL>
</INFO>
</MEDIA>
</SEARCH>
Nb: if two different nodes are present, elements will match only if both conditions are fulfilled (AND logical operator).
In the opposite if you want the Media of mediatype "Menu" OR the Medias with pagetocall "NewsHome", you have to write two INFO nodes. Identical nodes implies an OR logical operator between the two conditions, as two different nodes implies an AND.
<SEARCH>
<MEDIA>
<INFO>
<MEDIATYPE operator="=">Menu</MEDIATYPE>
</INFO>
<INFO>
<PAGETOCALL operator="=">NewsHome</PAGETOCALL>
</INFO>
</MEDIA>
</SEARCH>
Searching the Medias where Mediatype is "Menu" or "Chapter" :
<SEARCH>
<MEDIA>
<INFO>
<MEDIATYPE operator="=">Menu</MEDIATYPE>
<MEDIATYPE operator="=">Chapter</MEDIATYPE>
</INFO>
</MEDIA>
</SEARCH>
When two conditions on the same field with the same operator are indicated, elements will match if one the two conditions is fulfilled (OR logical operator).
- two identical nodes means condition1 OR condition2
- two different nodes means condition1 AND condition2
But if the operators are different, both conditions must be fulfilled : the nodes are considered different.
<SEARCH>
<MEDIA>
<INFO>
<TIMEIN operator="GT">2004-02-06</TIMEIN>
<TIMEIN operator="LT">2004-02-30</TIMEIN>
</INFO>
</MEDIA>
</SEARCH>
This command will match the elements which timein is between 2004-02-06 and 2004-02-30.
Searching the Contacts where any of the fields contains "Boris" :
<SEARCH>
<CONTACT>
<INFO>
<FULLTEXT>Boris</FULLTEXT>
</INFO>
</CONTACT>
</SEARCH>
Nb: This query can also be written this way :
<SEARCH>
<CONTACT>
<INFO>Boris</INFO>
</CONTACT>
</SEARCH>