Sample custom analyzer for document ranking filters

The personname sample analyzer shows how you can create custom analyzers for use with document ranking filters.

When documents are parsed, this custom analyzer detects the occurrence of person names that have nicknames. Then the analyzer inserts the nicknames in place of the original names when the text is extracted to the specified field so that users can search for documents by entering the nickname. For example, if the value of a field is "William Smith", the document will be returned if a user enters the search terms "Will Smith" or "Bill Smith". If you created a document ranking filter for this analyzer and added it to the Top document ranking filter group, documents that contain the nicknames in the specified field will be ranked higher in the results.

The sample is provided in the ES_INSTALL_ROOT/samples/customAnalyzer directory.

Important: Before you can upload custom analyzers or associate analyzers with fields in the administration console, you must enable the custom analyzer support.

To use the sample analyzer:

  1. Upload the package that contains the sample analyzer. In the administration console, open the System view, click the Parse tab, and click Configure custom analyzer packages. Click Add Package and browse to the ES_INSTALL_ROOT/samples/customAnalyzer/SamplePackage.zip file.
  2. Define a document ranking filter to associate an index field that is enabled for fielded search with the sample analyzer. In the Parse and Index pane for an enterprise search collection, click Configure > Custom analyzers for document ranking filters and click Associate Analyzer with Field. For example, associate the author field with the personname sample analyzer.
  3. Configure the document ranking filter.
    1. In the Search pane for the enterprise search collection, click Configure > Rules to tune queries and results.
    2. In the Document Ranking Filters area, select the Enable document ranking filters check box.
    3. Click Edit Document Ranking Filters and add the document filter that you created in step 2 to a document ranking filter group. For example, click the tab for the Top document ranking filter group, click Add filters, and select the filter.
  4. Restart the search servers to apply the changes.
  5. In a web browser, open the enterprise search application and search for a nickname. If any documents in the collection contain the name of a person that corresponds to the specified nickname in the specified field, the documents will be ranked higher in the results.