C H A P T E R 11 |
Search Setup |
This release of Sun Java System Content Delivery Server provides expanded search functionality for all Content Delivery Server portals. Included in this functionality is the ability to specify the fields that are shown by default in the results and the fields that are searched by default. Custom fields can be included in the defaults.
This chapter includes the following topics:
For an overview of search functionality, see the Sun Java System Content Delivery Server Reference Manual. For information on rebuilding search indexes, see the Sun Java System Content Delivery Server System Management Guide.
The following properties define the set of fields shown in the search results:
To specify more than one field for a property, separate the values with a comma (,). The fields are shown in the order in which the names are specified. Field names included in a query are added after the fields specified for the property. To be able to link to the content details from the search results, include either the title or short description in the results.
Note that specifying a large number of fields could slow performance. Also, if many fields are included in the results, horizontal scrolling might be needed when viewing the search results.
The following sections identify the files that contain these properties and the valid values.
Properties for the Catalog Manager administration console are set in the $CDS_HOME/deployment/deployment-name/conf/AdminConsole.properties file. In addition to the properties described in Section 11.1, Configuring Default Result Fields, the following properties for specifying the fields shown when Vending Managers search the catalog on the Catalog Manager are also set in this file:
Valid field names are shown in the following table. If you have defined custom fields, use emf.custom-key as the field name to include the field in the search results. See Section 1.8, Setting Up Custom Fields for information on custom fields.
Default values are shown in the following code example. Note that property names and values must be on the same line, but the example is constrained by the size of the page.
The properties described in Section 11.1, Configuring Default Result Fields, for the Developer Portal are set in the $CDS_HOME/deployment/deployment-name/conf/DeveloperPortal.properties file. Valid field names are shown in TABLE 11-1, with the exception of devname, which is not valid for the Developer Portal. If you have defined custom fields, use emf.custom-key as the field name to include the field in the search results. See Section 1.8, Setting Up Custom Fields for information on custom fields.
Default values are shown in the following code example.
keyword.search.results=title,ctype,category,dpprice,statusmsg,status field_query.search.results=title,ctype,category,dpprice,statusmsg,status user_defined.search.results= |
The properties described in Section 11.1, Configuring Default Result Fields, for the Vending Manager administration console are set in the $CDS_HOME/deployment/deployment-name/conf/VSAdminConsole.properties file. Valid field names are shown in the following table. If you have defined custom fields, use emf.custom-key as the field name to include the field in the search results. See Section 1.8, Setting Up Custom Fields for information on custom fields.
ID assigned by Content Delivery Server to identify the type of content |
|
Note - See Section 1.9, Defining Popularity for information. |
|
Note - Available only if external content and group IDs are enabled. See Section 2.3, Configuring External Content and Group IDs for information. |
|
Note - Available only if external content and group IDs are enabled. See Section 2.3, Configuring External Content and Group IDs for information. |
|
List of IDs of devices that are capable of running the content |
|
Default values are shown in the following code example.
keyword.search.results=rcid,title,status,vmprice,cmprice,category,ctype field_query.search.results=rcid,title,status,vmprice,cmprice,category,ctype user_defined.search.results= |
The properties described in Section 11.1, Configuring Default Result Fields do not apply to the Subscriber Portal. Search results are returned to the Subscriber Portal through the Subscriber API in an IContentSummary object. Only fields included in this object are available for display. See the output of the Javadoc tool in the $CDS_HOME/javadoc/subscriberapi directory for information on this interface.
Content Delivery Server uses the Solr search server to index content and handle search queries. Fields that are included in the index are defined in a file named schema.xml. The Catalog Search Service and the Vending Search Service each has its own copy of this file.
For the Catalog Search Service, the schema.xml file is in the $CDS_HOME/deployment/deployment-name/conf/css/solr/conf directory. This file is used for searches in both the Catalog Manager and the Developer Portal.
For the Vending Search Service, the schema.xml file is in the $CDS_HOME/deployment/deployment-name/conf/vss/solr/conf directory. This file is used for searches in both the Vending Manager and the Subscriber Portal.
Default search fields are the fields that are searched if the search query does not identify the fields to be searched. Because the schema file for the Catalog Search Service is shared between the Catalog Manager and the Developer Portal and the schema file for the Vending Search Service is shared between the Vending Manager and the Subscriber Portal, make sure that the default search fields that you specify are common to both portals.
Initially, the following fields are the default search fields for both the Catalog Search Service and the Vending Search Service:
To change the default search fields, follow these steps:
1. Open the schema.xml file for the search service that you are setting up.
For the Catalog Search Service, this file is in the $CDS_HOME/deployment/deployment-name/conf/css/solr/conf directory. For the Vending Search Service, this file is in the $CDS_HOME/deployment/deployment-name/conf/vss/solr/conf directory.
2. Find the defaultSearchField element.
This element defines text as the default field to be searched when no field is specified. Fields included in this default field are identified by the copyField elements where the attribute dest is set to text, for example:
<copyField source="ctype" dest="text"/>
3. Add copyField elements for the fields that you want included in the default search.
For each field, set source to the name of the field and set dest to text. Valid field names for the Catalog Search Service are identified in TABLE 11-1. Valid field names for the Vending Search Service are identified in TABLE 11-2. If you have defined custom fields, use emf.custom-key as the field name.
4. Remove copyField elements for fields that you do not want included in the default search.
6. If the search service is deployed on a separate server, copy the schema.xml file to the server on which the Catalog Manager or Vending Manager is deployed.
For the Catalog Manager, copy the schema.xml file from the Catalog Search Service. For the Vending Manager, copy the schema.xml file from the Vending Search Service.
7. Restart the search service to make the changes available.
Depending on the search service for which changes were made, restart the Catalog Search Service or the Vending Search Service.
If you defined custom fields for your system and you want users to be able to search these fields, you must add them to the search index. The search engine uses the information in the schema.xml file to create the index for each search service.
To add custom fields to the search index, follow these steps:
1. Open the schema.xml file for the search service that you are setting up.
For the Catalog Search Service, this file is in the $CDS_HOME/deployment/deployment-name/conf/css/solr/conf directory. For the Vending Search Service, this file is in the $CDS_HOME/deployment/deployment-name/conf/vss/solr/conf directory.
This element contains the field elements that identify the fields that are indexed by the search engine, for example:
<field name="ctype" type="text" indexed="true" stored="true"/>
3. Add a field element for each custom field that you want included in the search index.
The following table identifies the attributes for the field element.
Name of the custom field in the format emf.custom-key. See Section 1.8, Setting Up Custom Fields for information. |
|
Data type for the field. The following list shows the value to enter depending on the data type specified for the custom field. |
|
Flag that indicates if the field is to be searched. Set to true to include the custom field in searches. |
|
Flag that indicates if the field is retrievable. Set to true to retrieve the custom field. |
|
Flag that indicates if the field can have multiple values. Set to true if the scope of the custom field is edition. |
For example, the following statement adds the custom field for artist to the search schema:
If the custom field is not defined as either viewable or editable for the Catalog Manager or the Developer Portal, do not include the field in the schema.xml file for the Catalog Search Service. If the custom field is not defined as either viewable or editable for the Vending Manager or the Subscriber Portal, do not include the field in the schema.xml file for the Vending Search Service.
4. (Optional) Enable the field for sorting.
If the scope of the custom field is item and the data type is text, follow these steps to enable the search results to be sorted on this field:
a. Add another field element using the custom field name followed by the suffix _exact for the name attribute.
Set the type attribute to nonTokenizedSort, the indexed attribute to true, and the stored attribute to false. For example, the following statement adds a sortable field for the custom field for artist:
b. Add a copyField element after the field definitions to copy the custom field to the field just defined.
For example, the following statement copies the custom field for artist to the emf.artist_exact field created in the previous step:
<copyField source=”emf.artist” dest=”emf.artist_exact”/>
5. To include a custom field in the default search fields, see Section 11.2.1, Configuring the Default Search Fields.
7. If the search service is deployed on a separate server, copy the schema.xml file to the server on which the Catalog Manager or Vending Manager is deployed.
For the Catalog Manager, copy the schema.xml file from the Catalog Search Service. For the Vending Manager, copy the schema.xml file from the Vending Search Service.
8. Set the column title shown for the custom field in the search results.
The column title is set for each portal in the following property files, which are located in the $CDS_HOME/deployment/deployment-name/localization directory:
For each portal in which the field appears, set the search.column.title.emf.custom-key property to the column title shown for the custom field when search results are displayed. Typically, this is the same string that is used for the emf.content-type.custom-key.label property described in Section 1.8.2, Assigning Labels and Hints.
9. Restart the search service to make the changes available.
Depending on the search service for which changes were made, restart the Catalog Search Service or the Vending Search Service.
Copyright © 2008, Sun Microsystems, Inc. All Rights Reserved.