IR Queries


This topic describes how to search a database by using an information retrieval query (IR Query).

You can use an IR Query to query databases when the query does not contain a formal syntax and is defined by an interpretation of the most suitable results of the query.

The HP Service Manager application governs the rules for writing the IR Query. For example, to search for all retrieve-incident items, where the category is telecoms, severity is 4, subcategory is fixed infrastructure, product-type is fixed infrastructure, and problem-type is none, use the following <items> XML:

Sample <items> XML


<items>
 <item>
   <operation-name>retrieve-incident</operation-name>
   <model>
     <keys></keys>
     <instance>
       <category>
         <value>telecoms</value>
         <type>String</type>
       </category>
       <severity>
         <value>4</value>
         <type>String</type>
       </severity>
       <subcategory>
         <value>fixed infrastructure</value>
         <type>String</type>
       </subcategory>
       <product-type>
         <value>fixed infrastructure</value>
         <type>String</type>
       </product-type>
       <problem-type>
         <value>none</value>
         <type>String</type>
       </problem-type>
     </instance>
   </model>
 </item>
</items>

Replace the elements with an IR Query to get the following <items> XML:

Sample <items> XML for an IR Query


<items>
 <item>
    <operation-name>retrieve-incident</operation-name>
    <model>
       <keys></keys>
       <category />
       <instance>
         <query><![CDATA[category="telecoms" and severity="4" and subcategory="fixed infrastructure" and product.type="fixed infrastructure" and problem.type="none"]]></query>
       </instance>
   </model>
 </item>
</items>

The IR Query XML must contain all the mandatory structures or sections of the exhaustive XML itself. These structures must be left blank, and the IR Query must be specified only in the <instance> element.

Warning

Note

If there are special characters in the query, then the actual query in the <query> element must be placed in the CDATA tags.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

TrueSight Orchestration Content 20.19.01