Administer > Introduction > UCMDB Browser > How to Configure Custom CI Types or CI Attributes for Enhanced Search

How to Configure Custom CI Types or CI Attributes for Enhanced Search

After adding a custom CI Type or a CI attribute, in order to successfully search for the custom CI Type or attribute with the Enhanced Search feature, you need to perform some necessary steps to make (Undefined variable: UCMDB.CMS_UI_product_name) and the Solr search engine aware of the new CI Type or CI attribute.

To achieve this, edit configuration files by using the following JMX methods:

  • editIndexerConfiguration – This determines what gets indexed by the Solr search engine, if you do not have the new CIT or attribute defined, then it will never be indexed in the first place.
  • editParserConfiguration - This controls what synonyms you want to declare, so you can translate custom words to TQL useful variables.
  • editRankingConfiguration – This controls what is the order (ranking) in the data displayed in the (Undefined variable: UCMDB.CMS_UI_product_name).

Let us use a custom CIT ts_ex as an example. ts_ex is not a child of any particular CIT, and has important attributes like ts_id, ts_name and ts_version.

  1. Add the custom CIT and its attributes to the indexer configuration by using the editIndexerConfiguration JMX method.

    1. On the UCMDB server, launch the Web browser and enter the following address: https://localhost:8443/jmx-console.

    2. Enter the JMX console authentication credentials (Login name = sysadmin).
    3. Locate the editIndexerConfiguration operation in the UCMDB:service=Topology Search Services category.
    4. Provide Customer ID (default: 1) and click Invoke.

      In the returned result page, the Resource XML window lists all CI types and the attributes that are indexed.

    5. Scroll down to the bottom and add the custom CIT and attributes by following the out-of-the-box (OOTB) structure below:

      <classAttributes>
          <className><CIT></className>
          <index>true</index>
          <attribute><CI Attribute 1></attribute>
          <attribute><CI Attribute 2></attribute>
      </classAttributes>

      In this case, add the following:

      <classAttributes>
          <className>ts_ex</className>
          <index>true</index>
          <attribute>ts_version</attribute>
          <attribute>ts_id</attribute>
          <attribute>ts_name</attribute>
      </classAttributes>
      

      Tip It is recommended to always add your customizations to the end of the XML file and to keep the XML formatting, so that you will always save a valid and usable resource.

    6. Save the change.
  2. Add the custom CIT to the parser configuration by using the editParserConfiguration JMX method.

    Note UCMDB is designed to parse a simple text string as a search request for the display_label attribute on managed_object and its child CITs. If you want to search for a custom attribute like ts_id, then we need to teach the parser that we are interested in this particular attribute. This can translate to:

    <attributeSynonym>
        <synonym>tsid</synonym>
        <attributes>
            <attributeName>ts_id</attributeName>
        </attributes>
    </attributeSynonym>
    

    To search such an attribute in (Undefined variable: UCMDB.CMS_UI_product_name), we need to enter in the search box the string tsid <my_ID_value>. This is interpreted by the parser that you are requesting a search only on the custom attribute ts_id with the search string <my_ID_value>.

    1. In UCMDB server JMX console, locate the editParserConfiguration operation in the UCMDB:service=Topology Search Services category.
    2. Provide Customer ID (default: 1) and click Invoke.

      In the returned result page, the Resource XML window lists all CITs that are parsed.

    3. Scroll down to the bottom and add the custom CIT by following the out-of-the-box (OOTB) structure below:

      <classSynonym>
          <synonym><synonym></synonym>
          <className><CIT></className>
      </classSynonym>
      

      In this example, add the following:

      <classSynonym>
          <synonym><Technical service></synonym>
          <className>ts_ex</className>
      </classSynonym>
      
    4. Save the change.

      This tells the parser that when you search the keywords Technical service, you are actually interested in CIs from the CIT ts_ex.

    Note It is also recommended to familiarize yourself with the entire OOTB list in order to be able to perform better and more useful (Undefined variable: UCMDB.CMS_UI_product_name) searches.

  3. Add rankings of the custom CIT and its attributes by using the editRankingConfiguration JMX method

    1. In UCMDB server JMX console, locate the editRankingConfiguration operation in the UCMDB:service=Topology Search Services category.
    2. Provide Customer ID (default: 1) and click Invoke.

      In the returned result page, the Resource XML window lists ranking of all CITs and their attributes.

      The XML file is split into several categories, but the first 2 categories are the most relevant and important ones: classesByPriority and attributesByPriority.

    3. In the classesByPriority section, add the name of your custom CIT (as illustrated below), either for priority 2 or 3 depending on your business needs, but not both of them.

      <classesByPriority>
              <priorityList>
                  <priority>2</priority>
                  <name>running_software</name>
                  <name>ci_collection</name>
              </priorityList>
              <priorityList>
                  <priority>3</priority>
                  <name>node</name>
                  <name>location</name>
                  <name>party</name>
                  <name>business_element</name>
                  <name>configuration_document</name>
                  <name>ts_ex</name>
               </priorityList>
          </classesByPriority>
    4. In the attributesByPriority section, add the names of your custom CI attributes to the target priority level section.

      You might have already noticed the priorities for attributes are 0,1,3 and 4. Based on your preferred usage for the custom CIT, make sure you add each of three example attributes into one of the priority categories.

      Note Each attribute should be added only once. The higher the priority number is, the better chance to have that search result listed on the first result page.

      For example,

          <attributesByPriority>
              <priorityList>
                  <priority>0</priority>
                  <name>creation_time</name>
                  ...
              </priorityList>
              ...
              <priorityList>
                  <priority>3</priority>
                  <name>cluster_network_address</name>
                  <name>ts_version</name>
                  <name>ts_id</name>
                  <name>ts_name</name>
              </priorityList>
              ...
    5. Save the change.
  4. Index the custom CIT and attributes by invoking the reindexCiType JMX method.

    1. In UCMDB server JMX console, locate the editRankingConfiguration operation in the UCMDB:service=Topology Search Services category.
    2. Provide Customer ID (default: 1) and the CIT name in the value field for ciType.

    3. Click Invoke.

Related Topics