Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Introduction

This blog is part of the complete step-by-step setup guide for SAP Mobile Documents. It describes how to connect TREX to SAP NetWeaver Java AS and how to setup an index for SAP NetWeaver Portal KM repositories. The article also explains how to use TREX for querying documents and folders inside KM repositories with the CMIS standard, which is possible since SAP Mobile Documents SP3 Patch 1.

Prerequisites

This article assumes that you already setup a running TREX instance that you want to connect to a SAP NetWeaver AS Java.

Step 1: Connect TREX to SAP NetWeaver AS Java

  • Open SAP NetWeaver AS Java administrator: http(s)://<hostname>:<port>/nwa
  • Navigate to: Configuration - Infrastructure - Java System Properties
  • Select Services and search for TREX Service
  • Add the hostname and port (tcpip://<hostname>:<port>) of your TREX instance to the following property: nameserver.address (The default port of TREX is 30001).On some systems TREX complains about a missing backupserver. In this case add your TREX server also to the following property: nameserver.backupserverlist
  • Press the “Save” Button to persist your changes

Step 2: Restart TREX Service on each cluster node:

  • Open SAP NetWeaver AS Java administrator: http(s)://<hostname>:<port>/nwa
  • Navigate to: Operations - Systems - Start & Stop
  • Select "Java Services" and search for “TREX Service”
  • Restart the TREX Service on each cluster node

Step 3: Verify the connection

  • Open SAP NetWeaver Portal: http(s)://<hostname>:<port>/irj
  • Navigate to: System Administration - Monitoring - TREX Monitor – Server Status
  • Verify if the TREX instance is successfully connected to your SAP NetWeaver AS Java (The status indicators should be green)
  • If the status indicators are not green try to restart the SAP NetWeaver AS Java and verify again

Step 4: Create an Index

  • Open SAP NetWeaver Portal: http(s)://<hostname>:<port>/irj
  • Navigate to: System Administration - Knowledge Management - Index Administration
  • Click “Create” to add a new index
  • Define an index ID, optionally a name and set "Service" to “Trex Search”

  • Press the “Define Schedule” button to define a schedule for the crawler. The crawler is responsible for determining and sending the information about the existing objects of a repository to the index queue.
  • Select “Daily” in the dropdown list to add a new cycle and configure a time when the crawler shall update the index
  • Confirm the schedule settings with the “OK” button

  • Create the index with a click on the “Save” Button.

Step 5: Add data sources (KM repositories) to the index

  • Navigate to: Data Sources and click “Add”

  • Select one or more km repositories that shall be indexed and press “OK”

Step 6: Adapt Queue Parameters

  • Open SAP NetWeaver Portal: http(s)://<hostname>:<port>/irj
  • Navigate to: System Administration – Knowledge Management – TREX Monitor – Edit Queue Parameters
  • Select the created Index ID in the drop down list
  • Change the Schedule Time to 5 minutes and press “Save”

Step 7: Verify the index

  • Open SAP NetWeaver Portal: http(s)://<hostname>:<port>/irj
  • Navigate to: System Administration – Knowledge Management – Indexing Monitor
  • Verify if the created index contains indexed items. If not, wait a few minutes and check again
  • If there are still no indexed items restart SAP NetWeaver AS Java and verify again

Use TREX for CMIS queries

Since SAP Mobile Documents SP3 Patch 1 the SAP NetWeaver Portal KM CMIS connector is able to perform CMIS queries with TREX. Executing CMIS queries with TREX is faster than the property search implementation and provides paging capabilities which is necessary to handle a huge amount of data.

The disadvantage of using TREX for performing CMIS queries is that it takes some time until property changes of documents and folders are reflected in the TREX index. Therefore it can happen that a TREX query returns data that is not up to date.

In order to use TREX as the query search engine append the string “USE TREX” to the end of the CMIS query statement. A simple statement might look like: SELECT * FROM cmis:document USE TREX

1 Comment