Using the remote index search

You can perform a search on remote RSE filters or folders using a preexisting index.

Before you begin

Tip: You must be using the RSE server version shipped with the product to take advantage of the remote index search feature.

Before you perform a remote index search, you must first specify the remote location in which to generate indexes when you perform a remote index search on filters or folders, and then generate the index. Although the initial generation of these indexes might be time-consuming, the indexes will provide substantially faster search results compared to traditional search methods.

Specifying the remote location for indexes

Procedure

To specify the remote location in which to generate indexes, complete the following steps:

  1. Switch to the Remote System Explorer (RSE) perspective.
  2. In the Remote Systems view, right-click the MVS Files subsystem or the z/OS® UNIX Files subsystem that contains the filter or folder on which you want to perform a search.
  3. From the pop-up menu, select Properties to open the Properties dialog box.
  4. In the left navigation pane, click Remote Index Search to open the Remote Index Search properties page.
  5. In the Location field, specify an existing location on the selected remote system to generate indexes into when using the remote index search, or click Browse to browse for the location.
  6. Click OK.
    Indices are generated into this location when you perform a remote index search on filters or folders that reside on this remote system.

Generating indexes

About this task

You can generate indexes from the Remote Systems view or the command line on the remote system:

Procedure

To generate an index, complete one of the following steps:

  • To generate an index from the Remote Systems view:
    1. Switch to the RSE perspective.
    2. In the Remote Systems view, right-click the filter or folder that you want to create an index for.
    3. From the pop-up menu, select Remote Index Search > Create Index.
      A background job creates an index for the selected resource in the location specified in the Remote Index Search properties page.
  • To generate indexes from the command line on the remote system, run the following command from the directory in which the RSE host modules are installed:
    remoteIndexScript folder_to_index index_location [file_patterns]
    Where:
    folder_to_index
    Is the folder that you want to index. Subdirectories are also indexed.
    index_location
    Is the location in which the index will be stored. This should be the location specified in the Remote Index Search properties page.
    file_patterns
    Is the comma separated list of file patterns. For example, *.txt,*.c. The index will be restricted to these file types.

Results

The status of the Create Index action is displayed in the Progress view.

What to do next

Tip: If you make changes to the source files contained in a folder after generating an index for that folder, the index will not contain your changes. You must regenerate the index, to pick up these changes.
Warning: The size of the index is usually substantially larger than the resources being indexed, unless compact indexes are used. You must ensure that there is sufficient storage in the location where the index will be generated.

A guide to using remote index search

The remote index search provides the user with an alternate means of searching z/OS UNIX files and MVS data set members.

To use the remote index search, an index is first created for the container, and then this index is used to rapidly search for requested strings.

When deciding to use remote index search, you must consider where the index generation would best occur, how much disk space is available, how often the index needs to be generated, how many files will be indexed, and where the index files will reside.

Benefits of using remote index search

Remote index search is considerably faster than a traditional search, in particular as you increase the number of files being searched, because it does not require reading all the searched files. Rather, it uses the produced index to quickly determine matching files, line numbers and positions of search terms within the file.

Concessions of using remote index search

Unlike a traditional search, remote index search requires a certain amount of disk space to store the index files. The amount of disk space can vary greatly and is largely dependent on the number and types of files being indexed. For example, indexing a 1MB binary file will generate a much larger index than indexing a 1MB text file. Files that contain many repeated terms will generate smaller index files than those that contain largely unique terms. Also, using a compact index, instead of a full index will result in requiring less disk space. A standard index provides previews of the search results in the Remote Index Search view, while a compact index does not.

The following table provides a sample of some index sizes:

Table 1. Sample index space requirements
Items Indexed Size Size of Compact Index Size of Standard Index
/usr/include/ 12MB 18MB 48MB
/samples 1.8MB 1.5MB 3.9MB
CEE.SCEEH.H(*) 7.8MB 5.8MB 13.7MB
CEE.SCEEH.SYS.H(*) 1.7MB 1.5MB 3.1MB
SYS1.MACLIB(*) 166MB 179MB 251MB

Since you are searching an index, rather than a file directly, changes that are made to the indexed files are not reflected until the next time the index is generated. This means that sometimes searches can be inaccurate if the index files have not been updated after a file has changed. Files that are frequently updated are not good candidates for remote index search because they will require frequent regeneration of the index files, negating and performance gain achieved by using the remote index search.

How, when, and where to generate indexes

There are several ways to generate an index for use with remote index search:
  • Performing a remote index search. When a remote index search is requested for files that are not in the index, an index is automatically generated for the user.
  • Explicitly requesting an index from the client. Right-click on a filter, directory or MVS dataset and select Remote Index Search > Create Index.
  • Running the remote index search script on the host.
    Note: The remote index search script can only generate indexes for z/OS UNIX locations.

For files that are not updated often or next to never, say for example, the C/C++ system header files, you might consider using the menu to generate the index. For files that are updated more often, you should consider using the command script to generate the index in a nightly job (or perhaps a job that runs more often).

When requesting an index via the client, you should also take into consideration that this will require a certain amount of resources from your server process in order to generate the index. Indexing a large directory, or data set may result in higher CPU memory consumption by the server process during the indexing process, so you may want to consider using the command in this case, to avoid affecting other users. Indexing a filter or multiple selected items in the RSE tree view may send multiple requests to the host simultaneously.
Note: Each request to index a directory or PDS on the host writes to disk when its buffer reaches 16MB to ensure quicker index generation, and multiple simultaneous requests, from the same user, or different users, may quickly consume available memory in the java process on the host.

Index files are generated by default in the user's ~/.eclipse/RSE/INDEX directory. If you have many users who access the same files, you should consider changing the default location for the indexes to a common directory. When doing this you should also take into account security issues, so that only users who are authorized to the files being indexed are given permission to the index location. Using a personal index can be useful for a single user if the user deals with a large number of files that are unique to them, and they have sufficient resources to generate and store the index files.

Multiple index locations can be specified for searching. This allows users to have both a centralized, and personalized index, and also allows the possibility of different index locations for different projects, etc.

Location and type of search index

You can specify the location where the index is placed and the type of index created.

There are 2 forms of search index:
  1. The standard index provides records of the number of results for each file and of the line number and contents for each line with a search result.
  2. The compact index needs about one-third of the storage of the standard index but it only provides the number of results for each file but not individual line results. These individual line results display when the editor opens the file.