The searchadmin
command provides a command-line interface to the Administration API. You can open an interactive session, or you can issue individual commands to the operating system.
You must supply the administrator password each time you issue the searchadmin
command. You can include the password in the command or wait for the prompt to enter it.
To open an interactive session, enter the searchadmin
command at the operating system prompt. After providing the administrator password, you get the SES prompt. You can start entering commands to the Oracle SES Administration API. This type of connection is called session mode.
Example 1-1 shows a brief interactive session, which ends with a quit
command.
Example 1-1 Issuing Commands at the SES Prompt
$ searchadmin Search Admin Command Line - Release 11.1.2.0.0 Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. Password: SES>getAPIVersion 11.1.2.0.0 SES>export index <?xml version="1.0" encoding="UTF-8"?> <search:config productVersion="11.1.2.0.0" xmlns:search="http://xmlns.oracle.com/search"> <search:index> <search:indexingBatchSize>250</search:indexingBatchSize> <search:indexingMemorySize>275</search:indexingMemorySize> </search:index> </search:config> SES>quit $
You can issue commands individually at the operating system prompt. You can also use this command format to create scripts and batch files, thus simplifying routine tasks. This type of connection is called single job mode.
Example 1-2 shows two commands entered at the operating system prompt. One includes the password in the command, and the other responds to the Password prompt. In a script or batch file, include the password in each command.
Example 1-2 Issuing Commands at the Operating System Prompt
$ searchadmin getAPIVersion Search Admin Command Line - Release 11.1.2.0.0 Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. Password: 11.1.2.0.0 $ searchadmin --PASSWORD password export index Search Admin Command Line - Release 11.1.2.0.0 Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. <?xml version="1.0" encoding="UTF-8"?> <search:config productVersion="11.1.2.0.0" xmlns:search="http://xmlns.oracle.com/search"> <search:index> <search:indexingBatchSize>250</search:indexingBatchSize> <search:indexingMemorySize>275</search:indexingMemorySize> </search:index> </search:config> $
The searchadmin
command connects to the local search instance defined by Oracle home. However, you can issue commands to one or more remote Oracle SES instances by supplying the connection information in the searchadmin
command.
To connect to a single remote instance, use the --CONNECTION
option with an HTTP connection string, like the one shown here. You can obtain the port number from the Oracle SES properties file at ORACLE_HOME/search/webapp/config/search.properties.
$ searchadmin --CONNECTION=http://myhost:7777/search/api/admin/AdminService
To connect to multiple instances, create a file with the connection information, then reference the file using the --CONNECTION_LIST
option. Each command is executed across all instances.
This is the file format:
--USERNAME=eqsys --CONNECTION=http://myhost:7777/search/api/admin/AdminService
This command opens connections using a file named remotehosts.lst:
$ searchadmin --CONNECTION_LIST=remotehosts.lst
The Help command provides the basic command syntax and descriptions of administrative objects. You can enter the help command in an interactive session or as an individual command, as shown here:
$ searchadmin help
Search Admin Command Line - Release 11.1.2.0.0
Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
Usage: searchadmin [<connectionArgs>] [<operation>] [<operationArgs>]
.
.
.
Table 1-1 describes the searchadmin
help commands.
Command | Description |
---|---|
|
Provides the |
|
Describes |
|
Provides the command syntax for |
|
Describes the status codes that are displayed after an operation is performed on multiple objects by |
|
Describes the settings of the |
|
Describes the settings of the |
|
Describes the settings of the |
The following is a summary of the searchadmin
command syntax.
searchadmin [--USERNAME=admin] [--PASSWORD=password] [{--CONNECTION=connection] | --CONNECTION_LIST=filename}] [operation]
or
searchadmin [-u admin] [-p password] [{-c connection | -m filename}] [operation]
Password for the administrator. You are prompted for the password if you omit it from the command. If you are connecting to multiple instances, the password is used for authentication on all of them; omit this argument if they do not use the same password.
Connection to a remote Oracle SES instance. The connection is to the local instance identified by Oracle home. You can connect using HTTP, using the following syntax:
http://host:port/search/api/admin/AdminService
For HTTP, the port number is the same as connecting to the Administration GUI.
The name of the connection file. The path can be absolute or relative to the current directory.
An administrative operation, as described in Chapter 3, "searchadmin Commands." Omit this argument to open an interactive session. Like the searchadmin
command, the operations have a short form and a long form for many arguments.