10 Configuring Search in WebCenter Portal
Configure search to index and search objects in WebCenter Portal.
Note:
Beginning with Release 12c (12.2.1.4.0), Oracle WebCenter Portal has deprecated the support for Oracle SES. If you have upgraded from a prior release, your upgraded instance might be configured to use Oracle SES. In this case, you must configure WebCenter Portal to use Elasticsearch or OCI Search Service with OpenSearch to index and search objects.Permissions:
To perform the tasks in this chapter, you must be granted the WebLogic Server Admin
role through the Oracle WebLogic Server Administration Console and the Administrator
role granted through WebCenter Portal Administration.
For more information about roles and permissions, see Understanding Administrative Operations, Roles, and Tools.
10.1 Creating a Crawl Admin User in WebCenter Portal
You can designate an existing user as crawl admin or create a crawl admin user (for example, mycrawladmin
) in WebCenter Portal and in your back-end identity management server to search using Elasticsearch or OCI Search Service with OpenSearch. You must create a crawl admin user only once.
Note:
See your identity management system documentation for information on creating users.
The following example uses Oracle Directory Services Manager to create the mycrawladmin
user:
10.2 Integrating with Elasticsearch
Configure Elasticsearch to index and search objects in WebCenter Portal.
10.2.1 Understanding Search with Elasticsearch
Elasticsearch is a highly scalable search engine. It allows you to store, search, and analyze big volumes of data quickly and provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.
Advantages of Elasticsearch
-
Elasticsearch provides full-text search capabilities as it is built on Lucene.
-
Elasticsearch is document-oriented. It stores data as structured JSON documents and indexes all fields by default, with a higher performance result.
-
Elasticsearch is API driven; actions can be performed using a simple Restful API.
-
Elasticsearch retrieves search results fast because it searches an index instead of searching the text directly.
You can configure Elasticsearch to search the following resources in WebCenter Portal:
-
Documents, including wikis and blogs
-
Portals, page metadata, page content (contents of HTML, Text, and Styled Text components), lists, and people resources
-
Announcements and Discussions (available only for portals upgraded from prior releases)
10.2.2 Prerequisites for Configuring Elasticsearch
Ensure the following requirements:
-
Oracle WebCenter Portal is installed.
-
Optional. If you choose to use WebCenter Content for search, ensure that WebCenter Content is configured and all required components are enabled. See Managing Connections to Oracle WebCenter Content Server.
10.2.3 Configuration Roadmap for Elasticsearch in WebCenter Portal
Table 10-1 Roadmap - Setting Up Elasticsearch in WebCenter Portal
Actor | Task |
---|---|
Administrator |
|
Administrator |
|
Administrator |
|
Administrator |
Configuring WebCenter Portal for Search |
Administrator | Configuring Search Crawlers |
Administrator |
(Optional) Customizing Search Settings in WebCenter Portal Administration |
Administrator |
(Optional) Modifying Search Global Attributes |
Administrator |
(Optional) Configuring Search Custom Attributes |
Administrator |
(Optional) Creating Custom Facets |
10.2.4 Installing Elasticsearch and Plugins
The following topics describe how to set up a single server, a cluster, and use Oracle HTTP Server to do the load balancing:
10.2.4.1 Setting Up Single Server
10.2.4.2 Setting Up Cluster and Load Balancing Using OHS
Modify System Settings
By default, the Elasticsearch server binds to loopback addresses for
HTTP and transport (internal) communication. To join a cluster, an Elasticsearch
server must be reachable via transport communication and bind transport to a
non-loopback address. When bound to a non-loopback address, the Elasticsearch server
enforces the bootstrap checks. Hence to succeed, the following system settings must
be modified as a root
user:
- The maximum number of open file handles for the
<install-user>
should be at least 65,536. The current value for the logged-in user is obtained using the following command:ulimit -n
. To increase it to the desired value, add the following line to the/etc/security/limits.conf
file:
Close and save the file. For the updated settings to take effect, the<install-user> - nofile 65536
<install-user>
should log out and log in again. - The maximum number of threads for the
<install-user>
should be at least 4096. The current value for the logged-in user can be obtained using the command:ulimit -u
.To increase it to the desired value, add the following line to the
/etc/security/limits.conf
file:<install-user> - nproc 4096
Close and save the file. For the updated settings to take effect, the
<install-user>
should log out and log in again. - The maximum virtual memory areas for the
<install-user>
should be at least 262144. The current value can be obtained using the command:/sbin/sysctl vm.max_map_count
.To increase it to the desired value, add (or update) the following in the
/etc/sysctl.conf
file:
Close and save the file. For the updated settings to take effect, run the following command:vm.max_map_count=262144
/sbin/sysctl -p
as aroot
user.
Install Elasticsearch on Primary Host
Once the system settings are modified, Elasticsearch server should be installed with cluster specific configurations. Before proceeding with the installation, you need to identify the primary host of the cluster. The primary host is nothing but one of the hosts of the cluster where Elasticsearch server should be installed first. The procedure to install Elasticsearch server on the primary host is as follows:
Once the system settings have been modified, the Elasticsearch server should be installed with some specific configurations as mentioned below:
- Edit the
ORACLE_HOME/wcportal/es/installES.properties
file and specify the required values. For cluster setup, the following property values should be specified and values should be same for each node of the cluster:Table 10-2 Property Values
Property Value ELASTIC_SEARCH_CLUSTER_NAME
<a unique value to identify the cluster> ELASTIC_SEARCH_CLUSTER_HOST_LIST
["host1.example.com", "host2.example.com", "host3.example.com"] ELASTIC_SEARCH_CLUSTER_NODE_LIST
["node-1", "node-2", "node-3"] ELASTIC_SEARCH_CERTIFICATE_NAME
<Name of the certificate> ELASTIC_SEARCH_PRIMARY_HOST
<Fully qualified name of the primary host> where,
host[n].example.com
is the fully-qualified hostname andnode[n]
is the value ofELASTIC_SEARCH_NODE_NAME
corresponding tohost[n].example.com
. - Enter the following command to install Elasticsearch and
plugins:
The following is the sample output for the successful installation on Linux:ORACLE_HOME/oracle_common/common/bin/wlst.sh ORACLE_HOME/wcportal/es/installES.py ORACLE_HOME/wcportal/es/installES.properties
... -> Installing file:////tmp/webcenter-search-es-content-crawl-plugin.zip -> Downloading file:////tmp/webcenter-search-es-content-crawl-plugin.zip [=================================================] 100% -> Installed orcl-wcp-es-content-crawl-plugin -> Please restart Elasticsearch to activate any plugins installed Generating node certificate for secured communication... Node certificate generated and password added to elasticsearch keystore successfully. Creating the user crawladmin in Elasticsearch server... ... The user crawladmin is created successfully. Executing /home/Oracle/product/esHome/startElasticsearch.sh Elasticsearch server installation is complete. Elasticsearch server home is at: /home/Oracle/product/esHome
- If Elasticsearch is being installed on Windows, execute the
following command to secure the Elasticsearch
server:
ORACLE_HOME/wcportal/es/secureESNode.cmd ORACLE_HOME/wcportal/es/installES.properties
- After the successful installation, the Elasticsearch server will be up and running. Verify that the Elasticsearch server is configured properly.
Install Elasticsearch on Non-Primary Host
Once the installation is successful on the primary host of the cluster, the Elasticsearch server can be installed on other hosts of the cluster (that is non-primary hosts). The procedure to install Elasticsearch server on the non-primary host is as follows:
- Edit the
ORACLE_HOME/wcportal/es/installES.properties
file and specify the required values. For cluster setup, the following property values should be specified and values should be same for each node of the cluster:Table 10-3 Property Values
Property Value ELASTIC_SEARCH_CLUSTER_NAME
<a unique value to identify the cluster> ELASTIC_SEARCH_CLUSTER_HOST_LIST
["host1.example.com", "host2.example.com", "host3.example.com"] ELASTIC_SEARCH_CLUSTER_NODE_LIST
["node-1", "node-2", "node-3"] ELASTIC_SEARCH_CERTIFICATE_NAME
<Name of the certificate> ELASTIC_SEARCH_PRIMARY_HOST
<Fully qualified name of the primary host> - Enter the following command to install Elasticsearch and
plugins:
After the successful installation, the Elasticsearch server is not started. The following is the sample output for the successful installation:ORACLE_HOME/oracle_common/common/bin/wlst.sh ORACLE_HOME/wcportal/es/installES.py ORACLE_HOME/wcportal/es/installES.properties
... -> Installing file:////tmp/webcenter-search-es-content-crawl-plugin.zip -> Downloading file:////tmp/webcenter-search-es-content-crawl-plugin.zip [=================================================] 100% -> Installed orcl-wcp-es-content-crawl-plugin -> Please restart Elasticsearch to activate any plugins installed ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ NOTE: Elasticsearch server installation is not complete. Please copy the required files from the primary host as mentioned in the documentation and start the server to complete the installation. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- If Elasticsearch is being installed on Windows, execute the
following command to secure the Elasticsearch
server:
ORACLE_HOME/wcportal/es/secureESNode.cmd ORACLE_HOME/wcportal/es/installES.properties
- Copy the node certificate (that is the file specified for
ELASTIC_SEARCH_CERTIFICATE_NAME
property) and theelasticsearch.keystore
file from theES_HOME/esNode/config
folder of the primary host toES_HOME/esNode/config
folder of the non-primary host. - Start the Elasticsearch server by executing the following
command:
# applicable if installing on Linux ES_HOME/startElasticsearch.sh # applicable if installing on Windows ES_HOME/startElasticsearch.cmd
- Once the Elasticsearch server is up and running, verify that the Elasticsearch server is configured properly.
10.2.4.2.1 Validating Cluster Set Up
http://host1.example.com:9200
using the Mozilla Firefox
browser.
http://host1.example.com:9200/_cluster/health
. Check the response
received and the number of nodes should be as shown
below:"number_of_nodes": 3
Note:
The above steps can be validated using any hostname which is part of the cluster.10.2.4.2.2 Setting Up Load Balancing Using OHS
- Create a file
wcp-search.conf
in themoduleconf
directory (this should be in the directory that has the filehttpd.conf
). The sample configuration for port based virtual host is as follows:<Location /> WLSRequest ON SetHandler weblogic-handler WebLogicCluster host1.example.com:9200,host2.example.com:9200,host3.example.com:9200 WLIOTimeoutSecs 30000 WLSocketTimeoutSecs 600 </Location>
When we access OHS server using the configured port, the request will be redirected to one of the hosts mentioned in the WebLogicCluster configuration.
- Restart the OHS.
10.2.4.2.3 Validating Load Balancing Set Up
http://OHS-HOST:OHS-PORT/_cluster/health
. Check the response
received and the number of nodes should be as shown
below:"number_of_nodes": 3
This indicates that load balancing using OHS is set up successfully for three nodes.
10.2.4.3 Securing Elasticsearch Using HTTPS
10.2.4.3.1 Adding Certificate to WebCenter Portal Keystore
Download Certificate from Elasticsearch Server
- Open the Firefox browser and connect to the Elasticsearch server with the
following command:
https://host_name:9200
where
host_name
is the name of the Elasticsearch server. - Accept the security exception and continue. Provide the login credentials when prompted.
- Click the Lock icon in the URL field and navigate to Connection not secure and then More Information.
- In the popup window, click the View Certificate button.
- Click on the link PEM (cert) to download the certificate in the .PEM format.
Add the Certificate to WebCenter Portal Keystore
Once the certificate is downloaded, it should be imported to WebCenter Portal Keystore.
To import:
- Execute the following command in WebCenter Portal server and enter the Keystore
password when
prompted:
keytool -importcert -alias es_cert -file /filepath/sslcertificate/es_certificate.pem -keystore <JDK_path>/jre/lib/security/cacerts
- Restart the Managed server.
10.2.4.3.2 Search Connection to Elasticsearch Server Running on HTTPS
createSearchConnection(appName='webcenter', name='<conn_name>', url='https://<ES_host>:<ES_port>', indexAliasName='<index_alias>', appUser='<app_user>', appPassword='<app_user_password>')
If the search connection already exists, it should be updated to use HTTPS and can be done using the following command:
setSearchConnection(appName='webcenter', name='<existing_conn_name>', indexAliasName='<existing_index_alias>', appUser='<app_user>', appPassword='<app_user_password>', useSSL=1)
10.3 Integrating with OCI Search Service with OpenSearch
Configure OpenSearch to index and search objects in WebCenter Portal.
10.3.1 Understanding OCI Search Service with OpenSearch
Oracle Cloud Infrastructure (OCI) Search Service with OpenSearch is an insight engine offered as an Oracle-managed service. Without any downtime, Oracle automates patching, updating, upgrading, backing up, and resizing the service. You can store, search, and analyze large volumes of data quickly and see results in near real-time.
OCI Search Service combines proven OpenSearch technology with the flexibility of OCI.
You can configure OCI Search Service with OpenSearch to search the following resources in WebCenter Portal:
-
Documents, including wikis and blogs.
-
Portals, page metadata, page content (contents of HTML, Text, and Styled Text components), lists, and people resources.
-
Announcements and discussions (available only for portals upgraded from prior releases).
Note:
Oracle WebCenter Portal can be hosted and run on-premise, but it is always recommended to host WebCenter Portal on OCI for leveraging the integration with OCI OpenSearch in the most optimum way while running WebCenter Portal on Cloud.
10.3.2 Prerequisites for Configuring OCI Search Service with OpenSearch
Ensure the following requirements:
- Get OCI tenancy details.
- Create the required service policies in the Oracle Cloud Console,
tailoring them to your needs. For example, change any user to the desired group, and
provide the path to the compartment if required.
Working policies:
Allow group <your_group> to manage opensearch-family in compartment opensearch Allow service opensearch to manage vcns in compartment opensearch Allow service opensearch to manage vnics in compartment opensearch Allow service opensearch to use subnets in compartment opensearch Allow service opensearch to use network-security-groups in compartment opensearch
- Create a VCN with a public subnet and a private subnet.
- Simplified process:
- Open the Oracle Cloud Console navigation menu.
- Click Networking. and then click Virtual Cloud Networks.
- Click Start VCN Wizard, and then click Create VCN with Internet Connectivity.
- Custom process:
- Open the Oracle Cloud Console navigation menu.
- Click Networking. and then click Virtual Cloud Networks.
- Click Create VCN and provide your own desired details.
- Simplified process:
10.3.3 Configuration Roadmap for OCI Search Service with OpenSearch in WebCenter Portal
Table 10-4 Roadmap - Setting Up OCI Search Service with OpenSearch in WebCenter Portal
Actor | Task |
---|---|
Administrator |
|
Administrator |
|
Administrator |
|
Administrator |
|
Administrator |
Configuring WebCenter Portal for Search |
Administrator | Configuring Search Crawlers |
Administrator |
(Optional) Customizing Search Settings in WebCenter Portal Administration |
Administrator |
(Optional) Modifying Search Global Attributes |
Administrator |
(Optional) Configuring Search Custom Attributes |
Administrator |
(Optional) Creating Custom Facets |
10.3.4 Create an OpenSearch Instance in OCI
Task 1: Create an OCI Search Service cluster
- Open the Oracle Cloud Console navigation menu. Click Databases, OCI
Search Service, and then click Clusters. Then, click Create
cluster. Choose the cluster name and compartment where you want to
create the cluster.
Figure 10-4 Create Cluster
- Click Next.
- Configure security. The user name should be the same as the Crawl Admin User created above.
Figure 10-5 Configure Security
- Choose the cluster sizing, and then click Next.
Figure 10-6 Configure Nodes
- Select the VCN you created and then select the private subnet.
Figure 10-7 Configure Networking
- Click Next. After the cluster creation, in the OCI Search Service cluster
details page, note the API endpoints and the IP addresses which you can
alternatively use.
Figure 10-8 Cluster Information
Task 2: Create security rules for accessing the OpenSearch instance
- Create a security list for the Open Search instance:
- Open the Oracle Cloud console navigation menu.
- Click Networking and then click Virtual Cloud Networks.
- Open the VCN where the WebCenter Portal instance was created.
- Select Security Lists from the list of resources.
- Click Create Security List.
- Provide a name and compartment for the security list. For example: Provide a name such as OpenSearch_Security_List and select the compartment where the WebCenter Portal instance is created.
- Add the following Ingress Rule:
- Stateless: Leave this deselected (as all rules must be statetful).
- Source Type: CIDR
- Source CIDR: 0.0.0.0/0
- IP Protocol: TCP
- Source Port Range: All
- Destination Port Range: 9200
- Add the new security list to the subnet used by the OpenSearch instance.
- Open the Oracle Cloud console navigation menu.
- Click Networking and then click Virtual Cloud Networks.
- Open the VCN where the WebCenter Portal instance was created.
- Select Subnets from the list of resources.
- Select the private subnet that was created by default with the VCN (the subnet name should be like "Private Subnet-<VNC name>").
- Add the new OpenSearch_Security_List security list to the subnet.
Figure 10-9 TCP traffic for ports: 9200
![Stateless Stateless](img/stateless.png)
Task 3: Note down the Private IP of the OpenSearch cluster
Figure 10-10 Cluster Information
![Cluster Information Cluster Information](img/cluster-info.png)
Task 4: Test the connection to OCI Search Service – OpenSearch endpoint
You can access https://<opensearch_private_ip>:9200
and enter the credentials specified above.
You should see a response as follows:
{
"name" : "opensearch-master-0",
"cluster_name" : "amaaaaaawyxhaxqayue3os5ai2uiezzbuf6urm3dllo43accuxse57ztsaeq",
"cluster_uuid" : "FncN4SpaT_em28b8gjb4hg",
"version" : {
"distribution" : "opensearch",
"number" : "2.11.0",
"build_type" : "tar",
"build_hash" : "unknown",
"build_date" : "2024-01-09T20:29:23.162321021Z",
"build_snapshot" : false,
"lucene_version" : "9.7.0",
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
10.3.5 Add Certificate to WebCenter Portal Keystore
The OpenSearch server certificate must be added to WebCenter Portal Keystore to establish the trust between the client and server.
Download the Certificate from the OCI OpenSearch Server
To obtain the certificate from the OCI OpenSearch server, complete the following steps:
- Open the Firefox browser and connect to the OCI OpenSearch server with the following command:
https://host_name:9200
where
host_name
is the name of the OCI OpenSearch server. - Accept the security exception and continue.
- Provide the log-in credentials when prompted.
- Click the Lock icon in the URL field and navigate to Connection not secure and then More Information. In the pop-up window, click the View Certificate button.
- Click the link PEM (cert) to download the certificate in the .PEM format.
Add the Certificate to the WebCenter Portal Keystore
Once the certificate is downloaded, it should be imported into WebCenter Portal Keystore. To import:
- Execute the following command in WebCenter Portal server and enter the Keystore password when prompted:
keytool -importcert -alias opensearch_cert -file <path-to-PEM-certificate> -keystore <JDK_path>/jre/lib/security/cacerts
- Restart the Portal Managed server.
Disable Hostname Verification
To disable hostname verification:
- Log in to the WebLogic console.
- Click the Lock & Edit button.
- Select Servers from the left navigation, select Server Name, then Configuration, then SSL, and Advanced. Select None from the Hostname Verification drop-down menu. Click Save and activate the changes.
10.4 Configuring WebCenter Content for Search
This topic describes how to configure WebCenter Content for search.
Note:
The following topics are applicable only if WebCenter Content is configured.
10.4.1 Creating a Crawl User in WebCenter Content
This procedure describes how to create a new crawl user in WebCenter Content.
If you want users with the admin role to crawl, then use an admin user account as the crawl user. If you want non-admin users to crawl, then create a new crawl user.
- Log on to WebCenter Content as an Administrator.
- To create a role
sescrawlerrole
, do the following: - To create a user
sescrawler
, and assign thesescrawlerrole
role to the user, do the following: - On the WebCenter Content home page, expand Administration, then Admin Server. Select General Configuration and append the
sceCrawlerRole=sescrawlerrole
entry in the Additional Configuration Variables section. - Restart WebCenter Content.
10.4.2 Configuring the SESCrawlerExport
Component
Before you begin, verify that the SESCrawlerExport
component is enabled. If not, enable the component (see Enabling the WebCenterConfigure Component) and restart the WebCenter Content server.
SESCrawlerExport
component for admin and non-admin users:
10.5 Configuring WebCenter Portal for Search
To configure WebCenter Portal for search, you need to configure the connection between WebCenter Portal and Elasticsearch or OCI Search Service with OpenSearch.
10.6 Synchronizing Users in WebCenter Portal
Before performing a portal full crawl, we recommend you to run the LDAP synchronization WLST command to ensure that all users are available in portal.
10.7 Configuring Search Crawlers
You can configure the following types of crawlers to index WebCenter Portal resources:
-
Portal Crawler: This uses the Portal crawl source to crawl certain objects, such as lists, page metadata, page content (contents of HTML, Text, and Styled Text components), portals, and profiles.
-
Documents Crawler: This uses the Documents crawl source to crawl documents, including wikis and blogs.
-
Discussions Crawler: This uses the Discussions crawl source to crawl discussion forums and announcements. This option is available only for portals upgraded from prior releases that include Discussions.
The following topics describe how to create different crawl sources using Scheduler UI in WebCenter Portal Administration:
10.7.1 Creating a Portal Crawl Source
10.7.2 Creating a Documents Crawl Source
10.7.3 Taking a Snapshot of the Content
The snapshot generates a configFile.xml
file at the location specified by the SESCrawlerExport component FeedLoc parameter. XML feeds are created in the subdirectory with the source name; for example, wikis. Performing a snapshot can take some time depending on the number of items you have stored on the Content Server instance and how many sources you are generating.
Note:
It is important to take a snapshot before the first crawl or any subsequent full crawl of the source.
10.8 Enabling AutoSuggest in WebCenter Portal
In WebCenter Portal, you can enable autosuggest, so that a list of suggested keywords appear as you type a keyword in the search field. The suggested keywords are based on the portal that you recently accessed.
The attribute, wcEnableAutoSuggest
, is used to configure autosuggest. By default, the attribute is set to false
. You can modify the value of the attribute in the WebCenter Portal Administration - Attributes page. After you modify the value, you must restart the WebCenter Portal server for the changes to take effect.
10.9 Configuring Search Custom Attributes
When you search using WebCenter Portal, only
certain predefined attributes show up in the search results. WebCenter Portal allows you to see additional
attributes in your search results. This can be achieved from the Search Setting page
in portal administration, where the Custom Attributes section lets you select which
custom search attributes should appear in search results and the order in which they
appear. This list in the Search Setting page is driven by
search-service-attributes.xml
. It contains list of all
attributes that we crawl for each service. Types in search index is defined by this
metadata. You can add a new custom attribute or modify the existing one in the
search-service-attributes.xml
file.
The following procedure describes how to add a new search custom attribute using Document service as an example:
10.10 Creating Custom Facets
Oracle WebCenter Portal supports faceted search to refine the search results without running a new search. With faceted search, search results are grouped under a predefined category and thus help users to narrow down the search results based on a relevant category. for example, Author
, Portal
, Last Modified date
.
In Oracle WebCenter Portal, by default, certain
predefined facets are provided in the Search Setting page. The list of facets is driven
by the search-service-custom-facets.xml
metadata file and each facet in
the file is mapped with search-service-attributes.xml
metadata file.
The following is the sample of the search-service-custom-facets.xml
metadata file:
<custom-facet dataType="keyword" displayName="Author" displayNameKey="ES_FACET_AUTHOR" mappedSearchAttribute="author" name="Author" itemsToDisplay="20"/> <custom-facet dataType="keyword" displayName="Service ID" displayNameKey="ES_FACET_SERVICEID" mappedSearchAttribute="wc_serviceId" name="Service ID"/> <custom-facet dataType="keyword" displayName="Portal" displayNameKey="ES_FACET_SCOPE" mappedSearchAttribute="wc_scopeGuid" name="Scope GUID" itemsToDisplay="20"/> <custom-facet dataType="keyword" displayName="Tags" displayNameKey="ES_FACET_TAGS" mappedSearchAttribute="wc_tagWords" name="Tags"itemsToDisplay="20"/> <custom-facet dataType="keyword" displayName="Mimetype" displayNameKey="ES_FACET_MIMETYPE" mappedSearchAttribute="mimetype" name="Mimetype" itemsToDisplay="20"/> <custom-facet dataType="date" displayName="Last Modified Date" displayNameKey="ES_FACET_LASTMODIFIED" mappedSearchAttribute="lastmodified" name="Last Modified Date" />
where,
-
name
is the name of the facet. -
displayNameKey
is the value of the custom facet metadata field. -
displayName
is the display name of the facet.Note:
If your business is supported in multiple languages, you can translate the newly added custom facets to the desired languages. See Translating Strings for Search Facets. -
mappedSearchAttribute
is used to map the custom facet with the search attribute. This value should be same asname
attribute value in thesearch-service-attributes.xml
metadata file. -
dataType
is the type of data. The available data types arekeyword
,keyword_text
, anddate
. This value should be same as the type value in thesearch-service-attributes.xml
metadata file. The data typekeyword
should be used when the user wants to do a case-sensitive search for the value of the custom facet. The data typekeyword_text
should be used when the user wants to do the case-insensitive search for the value of the custom facet. itemsToDisplay
is an optional attribute that defines the maximum number of items to be displayed under a facet. If the value is not specified, the default value is configured using option Administration > Tools and Services > Search in WebCenter Portal.Note:
This attribute is supported only if dataTypekeyword
is used.
Based on your business needs, you can add or modify the list of the facets in the
search-service-custom-facets.xml
metadata file for any of the
services available in Oracle WebCenter Portal, for
example, you can add custom facets for documents, people and other services listed in
the search-service-custom-facets.xml
metadata file.
This section shows how to add a custom facet for the document service. To add custom facet for the document service, you need to first add a custom metadata field in Oracle WebCenter Content, and then rebuild the content index.
The following steps shows you how to add the custom facet for the document service:
- Adding a Custom Metadata Field in Oracle WebCenter Content
- Rebuilding the WebCenter Content Index
- Configuring the SESCrawlerExport Component
- Configuring the Search Setting Metadata
- Configuring the Search Custom Facet Metadata
- Update the Metadata for the Document in Your Portal
- Configuring the File Exclusion in Search Results
10.10.1 Adding a Custom Metadata Field in Oracle WebCenter Content
10.10.2 Rebuilding the WebCenter Content Index
In Oracle WebCenter Content, after you've created the new metadata field, you need to rebuild the collection and update the search index using the Repository Manager utility.
10.10.3 Configuring the SESCrawlerExport Component
You need to update the Oracle WebCenter Content SESCrawlerExport
component with the newly created metadata field.
SESCrawlerExport
component:
10.10.4 Configuring the Search Setting Metadata
You need to add the defined custom attribute in Oracle WebCenter Portal. For the new custom attribute to appear in the search settings page, you need to add or update the search-service-attributes.xml
.
10.10.5 Configuring the Search Custom Facet Metadata
In WebCenter Portal Search Setting page, you can select which facets to display with search results. This list in the Search Setting page is driven by the search-service-custom-facets.xml
metadata file. It contains a list of facets used in WebCenter Portal. Each facet in the search-service-custom-facets.xml
metadata file is mapped with a custom attribute using the mappedSearchAttribute attribute.
10.10.6 Update the Metadata for the Document in Your Portal
CustomMetadataField
.
10.10.7 Configuring the File Exclusion in Search Results
You can configure to exclude certain file types from the search results. In
order to exclude the file types, the file types have to be specified in the metadata file
search-service-exclude-file-types.xml
.
- Export Metadata Service Document
- Update the File Types to Filter
- Import Metadata Service Document
- Verifying File Exclusion in Search Results
Export Metadata Service Document
The location of the file in MDS is
/oracle/webcenter/search/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/search-service-exclude-file-types.xml
.
search-service-exclude-file-types.xml
, enter the following
command:exportMetadata(application='webcenter', server='WC_Portal', toLocation='/tmp/search', docs='/oracle/webcenter/search/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/search-service-exclude-file-types.xml')
In the metadata service document
search-service-exclude-file-types.xml
, you can customize the
file types to be excluded.
Update the File Types to Filter
The metadata describes how we can specify the files types which have to be excluded during the search.
<?xml version='1.0' encoding='UTF-8'?>
<search-service-exclude-file-types xmlns="http://xmlns.oracle.com/webcenter/search/excludefiletypes">
<exclude-file-in-search>
<fileType extension=".xml" customType="site-studio-file" description="Exclude Site Studio data files that have extension .xml"/>
<fileType extension=".wav" description="Exclude all the file types with extension .wav"/>
<fileType extension=".jpeg" description="Exclude all the file types with extension .jpeg"/>
</exclude-file-in-search>
</search-service-exclude-file-types>
- The extension of the file which we want to filter from the search has to be entered in this metadata file.
- The
customType
attribute is optional. If we want to exclude the Site Studio data files in the search results, specify thecustomType
assite-studio-file
for extension ".xml". - The
description
attribute is optional. It explains the details of the files being excluded.
Import Metadata Service Document
To import the metadata service document
search-service-exclude-file-types.xml
, enter the following
command:
importMetadata(application='webcenter', server='WC_Portal', fromLocation='/tmp/search', docs='/oracle/webcenter/search/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/search-service-exclude-file-types.xml')
Verifying File Exclusion in Search Results
To verify the file types exclusion, click the Search icon and specify the file type, for example, *.wav or *.jpeg, and notice that these file types are excluded in the search result. Similarly, search on the .xml file, and notice that the .xml files created in the Site Studio are excluded.
10.11 Customizing Search Query Pattern
Oracle WebCenter Portal allows customizing the Search Query Pattern. This can be done by changing the pattern in the Query String Query used for search.
- Export Metadata Service Document
- Modify Query String Query Pattern
- Import Metadata Service Document
Export Metadata Service Document
To export the metadata service document
search-service-custom-config.xml
, enter the following
command:
exportMetadata(application='webcenter', server='WC_Portal', toLocation='/tmp/search', docs='/oracle/webcenter/search/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/search-service-custom-config.xml')
In the metadata service document
search-service-custom-config.xml
, you can customize the query
pattern and enable or disable of appending wildcard to the search term.
Modify Query String Query Pattern
The Query String Query pattern is included as a value of the property
called query_string
. The snippet shown below is the default value
for the query_string
property. The %s
indicates
the token that will be replaced by the search term input through the search field in
WebCenter Portal. The %s
can appear any number of times in the
query_string
value and each occurrence of this token will be
replaced with the search term. For more details, see https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-query-string-query.html.
<!-- The query_string query to be executed in Elasticsearch. The value should be in JSON format. -->
<property name="query_string"><![CDATA[
"query_string": {
"query": "(%s)"
}]]>
</property>
Handling Wildcards
*
) to the search term
is determined by the property append_wildcard
. If true,
*
will be appended to the search term.
Note:
Settingappend_wildcard
to true will cause all the results to have
the same relevancy score. To have proper relevancy score, you should use the
following in the query_string
pattern: rewrite:
scoring_boolean
<property name="append_wildcard">false</property>
Example:
<property name="query_string"><![CDATA[
"query_string": {
"query": "(%s)",
"rewrite": "scoring_boolean"
}]]>
</property>
Sample Query String Query Patterns
The following are some of the examples for the Query String Query patterns:
- Search across all fields and boost the matches in the
title
field by 2.<property name="query_string"><![CDATA[ "query_string": { "query": "(title:%s^2 OR %s)" }]]> </property>
- Search only in
title
andcontent
fields.<property name="query_string"><![CDATA[ "query_string": { "fields": ["title", "content"], "query": "(%s)" }]]> </property>
- Search for the exact phrase across all
fields.
<property name="query_string"><![CDATA[ "query_string": { "query": "(\"%s\")" }]]> </property>
Examples of Query String Query
The examples given below are with respect to the sample Query String Query patterns mentioned above:
- If the search term is
school
and theappend_wildcard
value is false, then%s
will be replaced withschool
and thequery_string
value will be:"query_string": { "query": "(title:school^2 OR school)" } "query_string": { "fields": ["title", "content"], "query": "(school)" } "query_string": { "query": "(\"school\")" }
Note:
If theappend_wildcard
property value istrue
,%s
will be replaced withschool*
in the above examples. - If the search term is
school children
and theappend_wildcard
value isfalse
, then%s
will be replaced withschool children
and thequery_string
value will be:"query_string": { "query": "(title:school children^2 OR school children)" } "query_string": { "fields": ["title", "content"], "query": "(school children)" } "query_string": { "query": "(\"school children\")" }
Note:
If theappend_wildcard
property value istrue
,%s
will be replaced withschool children*
in the above examples.
Import Metadata Service Document
To import the metadata service document
search-service-custom-config.xml
, enter the following
command:
importMetadata(application='webcenter', server='WC_Portal', fromLocation='/tmp/search', docs='/oracle/webcenter/search/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/search-service-custom-config.xml')
10.12 Scheduling a Crawl
You can schedule an incremental search crawl or manually start a full crawl or manually start a fast crawl or manually start a reindex crawl. The topics in this section describe how to schedule a crawl and how to start, enable, or disable a crawl.
10.12.1 Scheduling an Incremental Crawl
10.12.2 Enabling and Disabling a Scheduled Crawl
10.12.3 Manually Starting a Full Crawl
You can manually start a full crawl to crawl all items in WebCenter Portal. Start a full crawl only during non-peak times as it is time-consuming. A full crawl must be manually started and cannot be scheduled to run automatically.
To start a full crawl:
10.12.4 Manually Starting a Fast Crawl
You can manually start a fast crawl to crawl only the items that have changed. It crawls only the metadata fields of all the items that have changed. This operation does not crawl the content of the changed documents. This crawl is applicable only to the Documents crawl source. A fast crawl must be manually started and cannot be scheduled to run automatically.
To start a fast crawl:10.12.5 Manually Starting a Reindex Crawl
You can manually start a reindex crawl when the type of one
or more custom search attributes are changed in
search-service-attributes.xml
file. The
reindex crawl only copies the crawled items from one index to
another. A reindex crawl must be manually started and cannot be
scheduled to run automatically. For example, suppose for an
attribute wc_description
the type is
defined as text
. Now, the type is changed to
keyword
. In this scenario, you can start
reindex crawl instead of full crawl (as was the case earlier).
10.13 Customizing Search Settings in WebCenter Portal Administration
You can customize Result Types and Filtering, Search Scope, Facets, and Custom Attributes on the Search Settings page in WebCenter Portal Administration. Portal managers can reset only the search scope for the portals that they manage.
To customize search settings for Elasticsearch:
10.14 Modifying the Default Connection Settings for Document Content Crawl Plugin in Elasticsearch Server
After installing Elasticsearch, you can modify the default connection settings for document content crawl plugin using the configuration file.
You can specify the following attributes in the configuration file:
-
es.wcc.connection.timeout is the connection time-out interval, in seconds. This is the amount of time Elasticsearch server will wait to establish the connection to the WebCenter Content server. The default value is 30 seconds.
-
es.wcc.read.timeout is the read time-out interval, in seconds. Once Elasticsearch server is connected to the WebCenter Content server, this attribute specifies the amount of time allowed for the WebCenter Content server to respond in a given request. The default value is 30 seconds.
-
es.wcc.max.connection.attempts is the maximum number of connection attempts to access the WebCenter Content server. The default value is 3.
10.15 Modifying Search Global Attributes
Note:
The attributes discussed below are of Elastisearch. But these are also applicable if OCI Search Service with OpenSearch is configured.The attributes wcESConnectionTimeoutPeriod
and
wcESReadTimeoutPeriod
are used to configure the interaction
between WebCenter Portal and Elasticsearch. The
wcESDocumentsCrawlerThreads
attribute is used to configure the
number of threads required to process the crawling of documents.
The following are the attributes:
-
wcESConnectionTimeoutPeriod is the connection timeout interval, in seconds. This is the amount of time WebCenter Portal will wait to establish the connection to the Elasticsearch server. The default value is 30 seconds.
-
wcESReadTimeoutPeriod is the read timeout interval, in seconds. Once WebCenter Portal is connected to the Elasticsearch server, this specifies the amount of time allowed for the Elasticsearch server to respond in a given request. The default value is 30 seconds.
-
wcESDocumentsCrawlerThreads: The tasks for crawling the documents for search are handled in threads. This is done by creating a thread pool with a fixed number of threads, where each thread handles the crawl for the documents. The attribute
wcESDocumentsCrawlerThreads
can be used to specify the number of threads used to create a thread pool. The default value is 10. If a thread is not available for a crawl task, the task is in queue, waiting for other task to complete.
You can modify the default value of the attributes in Attributes page in WebCenter Portal administration. After you modify the value, you must restart the WebCenter Portal server for the changes to take effect.