You can quickly set up your first text indexing preprocessor by completing this procedure. The text indexing preprocessor processes document content before it is indexed by Elasticsearch or Content Search Services.
About this task
By completing the steps described in this procedure, you create the items identified in the following table.
| Item |
Name |
Description |
| Document subclass |
TP Test Document |
The class where you assign the text indexing preprocessor definition. The text indexing preprocessor action is run on all documents with CBR enabled that are created with this class definition before they are indexed. |
| Text preprocessor definition |
TP Test Definition |
Associates a text indexing preprocessor action with the TP Test Document class. |
| Text preprocessor action |
TP Test Action |
References the Java™ code module that performs the text preprocessing action. |
| Code module |
TP Test Module |
Contains the custom Java class that implements the text preprocessing logic. |
| Object store folder |
TP Test Folder |
The folder where you can add documents when you test the text indexing preprocessor. |
Procedure
To set up a text indexing preprocessor:
-
Create a custom Java text indexing preprocessor class.
Create a Java class that implements your text preprocessing logic. The class processes document content before it enters the indexing queue for Elasticsearch or Content Search Services.
Compile your class and package it as a JAR file. This JAR file will be uploaded as a code module in a later step.
-
Create a subclass of Document.
-
In the administration console, navigate to .
-
Right-click Document Class and click New Class.
-
Complete the Create a Class wizard by using the following values:
- Name: TP Test Document
- Symbolic Name: TPTestDocument
- Description: Document subclass for testing text indexing preprocessors.
You can use the default values for the remaining items.
-
Create a code module for your text indexing preprocessor.
-
Navigate to .
-
Right-click Code Modules and click New Code Module.
-
Complete the Create a Code Module wizard:
- Name: TP Test Module
- Description: Code module for text preprocessing test.
- Upload your JAR file containing the custom text indexing preprocessor class.
-
Create a text indexing preprocessor action.
-
Navigate to .
-
Right-click Text Preprocessor Actions and click New Text Preprocessor Action.
-
Complete the Create a Text Preprocessor Action wizard by using the following values:
- Name: TP Test Action
- Description: This action preprocesses document content before indexing.
- Class: Select Class and enter the fully qualified name of your custom text indexing preprocessor class (including package name).
- Code Module: Select Configure Code Module and browse to select the TP Test Module you created.
-
Create a text indexing preprocessor definition.
-
Double-click the TP Test Document class that you created and click the Text Preprocessor Definitions tab.
-
Select Show Inherited to show inherited text indexing preprocessor definitions.
-
Click New and enter the following values:
- Display Name: TP Test Definition
- Status: Select to enable the text indexing preprocessor definition.
- Action: Select TP Test Action from the list.
-
Click OK to save the definition.
-
Prepare to test the text indexing preprocessor.
-
Navigate to .
-
Right-click Root Folder and click New Sub Folder.
-
Enter TP Test Folder and click Create.
-
Test your text indexing preprocessor.
-
Right-click TP Test Folder and click New Document.
-
Complete the New Document wizard by using the following values. If a field or selection is not specified, use the default value.
- Document Title: TP Test 1
- Add content to the document (required for text indexing).
- Class: Choose TP Test Document from the list.
- Ensure content-based retrieval (CBR) is enabled for the document.
-
After you have specified the document class, click Create.
-
Verify that the text indexing preprocessor executed by checking the document properties or the indexing queue to confirm the preprocessing occurred before indexing.
- Optional:
Do one or more of the following tasks: