Changing properties in the search configuration file (wc-search.xml) (WC EAR)
To change the value of an existing property in the WebSphere Commerce Search configuration file (wc-search.xml), you must create a customized version of the file in a new folder. The customized version of the file must contain only the changed properties.
Before you begin
About this task
wc-search.xml
file, change the
<_config:profile>
and <_config:queryMapping>
node types
only.Tip: To add new elements to any of the existing profiles in wc-search.xml file, you can add a profile in your custom wc-search.xml file that extends the existing profile.
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
-
Create a custom WebSphere Commerce Search configuration file
(wc-search.xml), if one does not exist:
-
Add the basic XML elements that are required for your custom wc-search.xml
file:
-
Add the XML for any properties that you want to change to your custom
wc-search.xml file:
- Save and close your custom wc-search.xml file.
- Test your configuration changes.
- Deploy the customized file to the production environment.
Example
The following example shows the contents of a custom wc-search.xml file that
changes three properties that are defined within the IBM_Global
profile:
<?xml version="1.0" encoding="UTF-8"?>
<_config:search-config
xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../xsd/wc-search.xsd ">
A
<_config:profile indexName="CatalogEntry" name="IBM_Global">
<_config:query>
<_config:param name="price" value="0" />
<_config:param name="statistics" value="true"/>
</_config:query>
<_config:spellcheck>
<_config:param name="limit" value="3"/>
</_config:spellcheck>
</_config:profile>
B
<_config:profile extends="IBM_Global" name="IBM_findCatalogEntryByName"/>
<_config:profile extends="IBM_findCatalogEntryByName" name="IBM_findCatalogEntryByNameAndShortDescription"/>
<_config:profile extends="IBM_findCatalogEntryByNameAndShortDescription" name="IBM_findCatalogEntryByNameAndShortDescriptionInDetail"/>
<_config:profile extends="IBM_Global" name="IBM_findCatalogEntryByUnstructureField"/>
C
</_config:search-config>
price
: The property value is changed from1
to0
.statistics
: The property value is changed fromfalse
totrue
.limit
: The property value is changed from5
to3
.
<_config:param>
element are retained in the custom wc-search.xml file.The code snippet that starts with B and ends with
C is the list of profiles that extend directly and indirectly from the
IBM_Global
profile. This snippet is included to ensure that the changed property
values are picked up by these profiles.