A custom search function is a user-defined
function that can be included in a search expression. A function is
evaluated one time for each search result row.
For
an example of a search function in a search expression, see Relational query syntax introduction.
About this task
You create a search function with a search function definition, which references the implemented
search function handler. The search function handler defines the name of the search function in the
following format: name-space::short-name. This name must be
used in the search expression to reference the search function. The name of a search function and
the name of the search function definition for that function can be different.
You cannot use custom search functions in a stored search.
You can use these functions in ad hoc or background searches in a
SELECT list only.
Tip: To use predefined search functions,
install the Reporting Enablement Extensions add-on. For information
about these predefined functions, see
Search Function Definitions.
Procedure
To create a search function definition:
- Start the New Search Function Definition wizard in the
administration console:
- In the domain navigation pane, select the object store.
- In the object store navigation pane, select the folder.
- On the Search Function Definitions tab, click New.
- Specify a name for the search function definition that you want to create.
- Select a class that is associated with the search function definition.
You can
select either the parent class or a subclass that you created for the search function
definition.
- Specify whether the search function handler is implemented as a Java component.
- If you selected JavaScript, click Next
to enter the search function script. You can open and modify a script or add code to the default
code stubs. A search function handler that is implemented as JavaScript can fail in some WebLogic configurations. To resolve the problem, see JavaScript action handler fails (WebLogic application
server).
- If you selected Class, enter the name of the primary Java class for the search function handler. If the Java class is contained in a package, qualify the Java class name with the package it is contained in.
To configure the code module that contains the search function handler, select
Configure Code Module before you click Next. If you do
not select this option, the required Java class or JAR file
must be on the local Content Platform Engine application server
and must be in the application server class path.
- Complete the wizard.