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.


11.1 Configuring Default Result Fields

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.

11.1.1 Catalog Manager Administration Console

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.


TABLE 11-1 Field Names for the Catalog Manager

Field Name

Description

category

Category name

categoryid

Category ID

cmprice

Catalog Manager price

cmprice_enddate

Last day that content can be downloaded

cmprice_freqocc

Frequency with which content can be downloaded

cmprice_model

Pricing model name

cmprice_noofdays

Number of days that content can be downloaded

cmprice_nooftimes

Number of times that content can be downloaded

cmprice_startdate

First day that content can be downloaded

cmprice_value

Monetary value of the Catalog Manager price

ctype

Content type

devcontentid

Developer content ID

devid

ID assigned by Content Delivery Server to a Developer Account

devname

Developer name

dpprice

Developer price

dpprice_enddate

Last day that content can be downloaded

dpprice_freqocc

Frequency with which content can be downloaded

dpprice_model

Pricing model name

dpprice_noofdays

Number of days that content can be downloaded

dpprice_nooftimes

Number of times that content can be downloaded

dpprice_startdate

First day that content can be downloaded

dpprice_value

Monetary value of the developer’s price

edname

Edition name

edstatus

Edition status

lastmoddate

Date that the edition was last modified

loctype

Code that identifies the type and location of content

longdesc

Long description

matcheddevice

List of devices that are capable of running the content

matcheddeviceid

List of IDs of devices that are capable of running the content

maxsize

Size of edition binaries

planid

ID assigned by Content Delivery Server to a Developer Plan or Vending Plan

preview

Availability of preview

rcid

Resource Class ID

riid

Edition resource ID

shortdesc

Short description

status

Status

statusmsg

Status message

subdate

Submission date

title

Title

version

Edition version

weight

Edition weight


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.


keyword.search.results=
   title,status,devname,category,cmprice,dpprice,shortdesc,ctype
field_query.search.results=
   title,status,devname,category,cmprice,dpprice,shortdesc,ctype
user_defined.search.results=
 
remote_vending.keyword.search.results=
   title,status,devname,category,cmprice,shortdesc,ctype
remote_vending.field_query.search.results=
   title,status,devname,category,cmprice,shortdesc,ctype
remote_vending.user_defined.search.results=

11.1.2 Developer Portal

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=

11.1.3 Vending Manager Administration Console

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.


TABLE 11-2 Field Names for the Vending Manager

Field Name

Description

category

Category Name

categoryid

Category ID

citemid

Category item ID

cmprice

Catalog Manager price

cmprice_enddate

Last day that content can be downloaded

cmprice_freqocc

Frequency with which content can be downloaded

cmprice_model

Pricing model name

cmprice_noofdays

Number of days that content can be downloaded

cmprice_nooftimes

Number of times that content can be downloaded

cmprice_startdate

First day that content can be downloaded

cmprice_value

Monetary value of the Catalog Manager price

ctype

Content type

ctype_concept

ID assigned by Content Delivery Server to identify the type of content

devname

Developer name

emf.popularity

Popularity

Note - See Section 1.9, Defining Popularity for information.

extcontgrpid

External content group ID

Note - Available only if external content and group IDs are enabled. See Section 2.3, Configuring External Content and Group IDs for information.

extcontid

External content ID

Note - Available only if external content and group IDs are enabled. See Section 2.3, Configuring External Content and Group IDs for information.

keyword

Keyword used to identify content

lastmoddate

Date that the edition was last modified

loctype

Code that identifies the type and location of content

longdesc

Long description

matcheddevice

List of devices that are capable of running the content

matcheddeviceid

List of IDs of devices that are capable of running the content

maxsize

Size of edition binaries

planid

ID assigned by Content Delivery Server to a Subscriber Plan

preview

Availability of preview

rcid

Resource Class ID

riid

Edition resource ID

shortdesc

Short description

status

Status

stockdate

Date content was stocked

title

Title

version

Edition version

vmprice

Vending Manager price

vmprice_enddate

Last day that content can be downloaded

vmprice_freqocc

Frequency with which content can be downloaded

vmprice_model

Pricing model name

vmprice_noofdays

Number of days that content can be downloaded

vmprice_nooftimes

Number of times that content can be downloaded

vmprice_startdate

First day that content can be downloaded

vmprice_value

Monetary value of the Vending Manager price


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=

11.1.4 Subscriber Portal

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.


11.2 Configuring the Search Engine

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.

11.2.1 Configuring the Default Search Fields

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.

5. Save your changes.

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.

11.2.2 Adding Custom Fields to the Search Index

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.

2. Find the fields element.

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.


Attribute

Description

name

Name of the custom field in the format emf.custom-key. See Section 1.8, Setting Up Custom Fields for information.

type

Data type for the field. The following list shows the value to enter depending on the data type specified for the custom field.

  • For custom field type number, use sfloat
  • For custom field type text, use text.
  • For custom field type timestamp, use date.
  • For custom field type boolean, use boolean.

indexed

Flag that indicates if the field is to be searched. Set to true to include the custom field in searches.

stored

Flag that indicates if the field is retrievable. Set to true to retrieve the custom field.

multiValued

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:


<field name="emf.artist" type="text" indexed="true" stored="true"/>

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:


<field name="emf.artist_exact" type="nonTokenizedSort" indexed="true" stored="false"/>

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.

6. Save your changes.

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.



Note - Content that uses the new fields might be submitted between the time that you define the fields and the time that you add the fields to the schema file. If so, after updating the search schema, manually rebuild the search indexes to ensure that they contain the correct data. See Section 1.4 in the Sun Java System Content Delivery Server System Management Guide for information on rebuilding the search indexes.