Facet Configuration
Facet configuration requires three steps:
Create a new search result field in the ResultFields section of INS_HOME\SW\SW\System\Assets\Types\globalDefinitions.xml file.
For more information, see Adding a New Search Result Field in the PTC Arbortext Content Delivery Publishing and Loading Guide.
Configure the system to extract search information for the new field by modifying the INS_HOME\SW\SW\Applications\Windchill.ear\codebase.war\com\ptc\sc\xconf\sc.wt.properties.xconf file.
For example, if you wanted to add the new search result COLLECTION, modify the following three properties as follows:
<Property name="com.ptc.sc.servicecommon.SearchService.searchFacetsParts"
default="IU,KITTYPE,PARTTYPE,ISKIT,COLLECTION"
overridable="true"/>
<Property name="com.ptc.sc.servicecommon.SearchService.searchFacetsIEs"
default="IU,KITTYPE,PT,COLLECTION"
overridable="true"/>
<Property name="com.ptc.sc.servicecommon.SearchService.searchFacetsAll"
default="IU,KITTYPE,PT,PARTTYPE,ISKIT,COLLECTION"
overridable="true"/>
Note that the field names are separated by a comma with no spaces.
Configure the system to display the new field by modifying the INS_HOME\SW\SW\Applications\Windchill.ear\codebase.war\com\ptc\sc\configs\facets.xml file.
The facet information for the search can be configured using facets.xml. The facet.xml also contains filtering information such as infoType, publicationType and so forth. A facet needs to be configured in facets.xml to render the facet information. Each facet group has the “type” attribute which corresponds to the internal identifier of the facet and “externalref” corresponds to the E3C identifier of the facet. Each group has a facet with “key” corresponds to facet item identifier and “labelKey” corresponds to label identifier information, “icon” information for the icon to be displayed and “label” corresponds to the default label to be displayed in case the translation is not available for the provided “labelKey”.
<?xml version="1.0" encoding="UTF-8"?>
<facets bundle="com.ptc.sc.resource.SCSearchResourceRB">

<facet type="infoType" labelKey="INFORMATION_TYPES" label="Information Types" class="title"
selectable="false" externalref="IU" sorted="true" dynamic="true">
<facet key="Information" labelKey="INFORMATIONTYPE_INFORMATION"
label="Service Information" icon="InformationIcon" />
<facet key="partsList" labelKey="INFORMATIONTYPE_PARTSLIST"
label="Parts List" icon="partsListIcon" />
<facet key="kit" labelKey="INFORMATIONTYPE_KIT"
label="Kit" icon="kitIcon" />
<facet key="PART" labelKey="INFORMATIONTYPE_PART"
label="Part" icon="kitIcon" display="false"/>
<facet key="partOrphan" labelKey="INFORMATIONTYPE_PARTORPHAN"
label="Unreferenced Part" icon="kitIcon" />
<facet key="PI" labelKey="PRODUCT_INSTANCE"
label="Product Instance" icon="productInstanceIcon" display="false"/>
<facet key="IS_Chapter" labelKey="IS_NODE"
label="IS Node" icon="topicIcon" display="false"/>
<facet key="PH_Chapter" labelKey="PRODUCT"
label="Product Hierarchy" icon="productIcon" display="false"/>
<facet key="PS_Chapter" labelKey="PUBLICATIONTYPE_CHAPTER"
label="Publication Chapter" icon="publicationsIcon" display="false"/>
<facet key="IS" labelKey="IS"
label="IS" icon="topicIcon" display="false"/>
<facet key="PS" labelKey="PS"
label="PS" icon="publicationsIcon" display="false"/>
<facet key="Media" labelKey="MEDIA"
label="Media" icon="MediaIcon"/>
</facet>
</facet>
Configure the System to Search on the New Field
If custom facets have been defined, documents and parts list preview in search results list will not work anymore. To prevent this issue, the perform the steps:
1. Edit the <ACDroot>\InS_SW\SW\Applications\Windchill.ear\codebase.war\delivery\app\views\search\searchController.js file to add the custom types in typeToResource variable definition. For example, in line 188 and 192, remove toLowerCase();
item.attributes.infoTypeNormalized = item.attributes.infoType.toLowerCase();
item.attributes.isReferenced = item.attributes.isReferenced.toLowerCase();
2. Edit the <ACDroot>\InS_SW\SW\Applications\Windchill.ear\codebase.war\delivery\templates\searchLayouts\default.tmpl.html file and do the following:
a. Locate the <div class="searchResultPreview" data-ng-switch="::item.attributes.infoTypeNormalized"> element.
b. Find <div data-ng-switch-when="information"> and add the following <div> entry for each custom type:
<div data-ng-switch-when="cleaning">
<div class="expandedRowForm" data-ptcinclude="'templates/search/preview/information.tmpl.html’”/>
</div>
3. Launch Windchill shell and run the ant – f minimize.xml command as follows:
a. Launch Windchill shell: <ACDroot>\InS_SW\SW\Applications\Windchill.ear\bin\windchill.bat shell
b. From the Windchill shell window, navigate to the <ACDroot>\InS_SW\SW\Applications\Windchill.ear\codebase.war\delivery folder and run the following command: ant – f minimize.xml
* 
For more information, see Adding new Information Types for Search and Navigation in the customization sample files available on the PTC download page.
Was this helpful?