Example - modifying a search attribute

Users may want to allow only the is and starts with query types for the Item ID field in the Advanced Item Search screen in order to improve the performance of the search task. In such a scenario, you can modify the existing query types for the search attribute.

About this task

To modify the QueryType XML attribute:

Procedure

  1. Create the Item.xml file if it does not exist in the <install_dir>/extensions/sbc/webpages/sbc/metadata/advancedsearch folder.
  2. Create an element, Attribute, as a child element of the Attributes root element.
  3. Set the value of the Name attribute to ItemID.
    Following is the XML attribute that has to be modified:
    <Attribute Name="ItemID" DisplayName="b_ItemSearch_Item_ID" XPath="Item"> 
       <Configuration> 
         <UIControlConfiguration xtype="xadvancedtextcontrol"/> 
        </Configuration> 
    </Attribute>
  4. Set the value of the Action attribute to ADD.
  5. Add the QueryType elements with the value of the QueryType XML attribute as EQ and FLIKE.
  6. To customize the query type description, set the value of the QueryTypeDesc XML attribute to the correct bundle key.

    The XML attribute is modified.

    Following is the attribute element that is modified:
    <Attribute Name="ItemID" DisplayName="b_ItemSearch_Item_ID" XPath="Item" Action="ADD"> 
       <Configuration> 
          <UIControlConfiguration xtype="xadvancedtextcontrol"/> 
       </Configuration> 
       <StringQueryTypes> 
          <QueryType QueryType="EQ" QueryTypeDesc="is"/> 
          <QueryType QueryType="FLIKE" QueryTypeDesc="starts_with"/> 
        </StringQueryTypes> 
    </Attribute>