Changing properties in the WebSphere Commerce search configuration file (wc-search.xml) (Search 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
<_config:profile>
-
<_config:queryMapping>
The following procedure can be used to change (rather than add or remove) a value of an existing property within a search profile, which is defined in the wc-search.xml file.
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 in 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: Custom wc-search.xml file
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 ">
<_config:server name="BasicConfiguration">
<_config:embedded />
</_config:server>
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 ending 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.