Novell exteNd
Director 5.2 API

com.sssw.search.api
Interface EbiQueryEngine


public interface EbiQueryEngine

Objects that implement this interface represent Query Engines. Each such object interfaces a specific query processing back-end system. The object provides three types of functionality for working with the actual query engine:


Field Summary
static String DEFAULT_HOST
          This is the default name for the Query Engine host
static int DEFAULT_INDEX_PORT
          This is the default index port for the Query Engine
static int DEFAULT_QUERY_PORT
          This is the default query port for the Query Engine
static int QE_INDEX_JOB_FINISHED
          The return status code for notifying the caller of a successful completion of an indexing job.
static int QE_INDEX_JOB_QUEUED
          The return status code for notifying the caller that an indexing job is queued by the Query Engine.
static int QE_OUT_OF_DISK_SPACE
          The return status code for notifying the caller that the Query Engine ran out of disk space while executing an operation.
static int QE_REPOSITORY_NOT_FOUND
          The return status code for notifying the caller that the specified Query Engine Repository was not found.
static int QE_SUCCESS
          The return status code for a successful completion of a Query Engine operation.
 
Method Summary
 void addRepository(EbiContext context, String repositoryName)
          Adds a new repository to the Query Engine.
 void clear()
          Clears any parameters set for this object via the setter methods as a convenience for object reuse.
 void clearRepository(EbiContext context, String repositoryName)
          Removes all documents from the specified Query Engine repository.
 String getApiVersion()
          Returns the version descriptor of the Query Engine product API.
 String getHost()
          Returns the host name or IP address of this Query Engine.
 int getIndexerStatus(int indexID)
          Returns the status of a specific indexer.
 int getIndexPort()
          Returns the index port used for this Query Engine.
 String getName()
          Returns the service name.
 String getProductName()
          Returns the name of the Query Engine product.
 String getProductVersion()
          Returns the version of the Query Engine product.
 int getQueryPort()
          Returns the query port used for this Query Engine.
 Collection getRepositories(EbiContext context)
          Returns the list of names of Query Engine repositories.
 String getStatusMessage(int status)
          Returns the message for a status or error code.
 long getTotalDocs()
          Returns the total number of documents indexed in the Query Engine.
 String getVendorName()
          Returns the name of the Query Engine vendor.
 int importFiles(EbiContext context, String filterDirectory, String tempDirectory, String importFileName, String repository, String[] fileNames, boolean storeContents, boolean setSummaries, int[] retVals)
          Imports the array of files whose names are specified.
 int indexBuffer(EbiContext context, String strBuffer, String killDupsMode)
          Indexes the String buffer containing document data into the Query Engine.
 int indexFile(EbiContext context, String killDupsMode, String repository, String importFileName)
          Indexes the specified import file into the query engine.
 boolean isAlive()
          Returns true if the Query Engine is running.
 void ping()
          Determines the state of the Query Engine and throws an exception if the engine is not running,
 void reinitialize(EbiContext context)
          Removes all documents from the Query Engine and reinitializes it.
 void removeDocuments(EbiContext context, String[] repositories, String[] docs, boolean byID)
          Removes the specified documents from the Query Engine.
 void removeRepository(EbiContext context, String repositoryName)
          Removes all documents from the specified Query Engine repository and removes the repository itself.
 void reset(EbiContext context)
          Reloads the configuration settings for the Query Engine and resets it.
 Collection runQuery(EbiContext context, EbiQuery query, String[] repositories, boolean returnElements)
          Executes the specified query.
 void setHost(String host)
          Sets the host for this Query Engine object.
 void setIndexPort(int indexPort)
          Sets the index port for this Query Engine object.
 void setQualifier(String qualifier)
          Sets the qualifier for this Query Engine object, normally invoked by internal methods only.
 void setQueryPort(int queryPort)
          Sets the query port for this Query Engine object.
 

Field Detail

DEFAULT_HOST

public static final String DEFAULT_HOST
This is the default name for the Query Engine host

DEFAULT_QUERY_PORT

public static final int DEFAULT_QUERY_PORT
This is the default query port for the Query Engine

DEFAULT_INDEX_PORT

public static final int DEFAULT_INDEX_PORT
This is the default index port for the Query Engine

QE_SUCCESS

public static final int QE_SUCCESS
The return status code for a successful completion of a Query Engine operation.

QE_INDEX_JOB_FINISHED

public static final int QE_INDEX_JOB_FINISHED
The return status code for notifying the caller of a successful completion of an indexing job.

QE_INDEX_JOB_QUEUED

public static final int QE_INDEX_JOB_QUEUED
The return status code for notifying the caller that an indexing job is queued by the Query Engine.

QE_OUT_OF_DISK_SPACE

public static final int QE_OUT_OF_DISK_SPACE
The return status code for notifying the caller that the Query Engine ran out of disk space while executing an operation.

QE_REPOSITORY_NOT_FOUND

public static final int QE_REPOSITORY_NOT_FOUND
The return status code for notifying the caller that the specified Query Engine Repository was not found.
Method Detail

setQualifier

public void setQualifier(String qualifier)
Sets the qualifier for this Query Engine object, normally invoked by internal methods only. This establishes the context (e.g., CM) for the Query Engine. This method is not considered part of the public API.
Parameters:
qualifier - the contextual qualifier

getName

public String getName()
Returns the service name.
Returns:
the service name

getVendorName

public String getVendorName()
Returns the name of the Query Engine vendor.
Returns:
vendor name

getProductName

public String getProductName()
                      throws EboUnrecoverableSystemException
Returns the name of the Query Engine product.
Returns:
the Query Engine product name

getProductVersion

public String getProductVersion()
                         throws EboUnrecoverableSystemException
Returns the version of the Query Engine product.
Returns:
the version descriptor for the Query Engine product

getApiVersion

public String getApiVersion()
                     throws EboUnrecoverableSystemException
Returns the version descriptor of the Query Engine product API.
Returns:
the version descriptor of the Query Engine product API

getTotalDocs

public long getTotalDocs()
                  throws EboUnrecoverableSystemException
Returns the total number of documents indexed in the Query Engine.
Returns:
the total number of documents indexed in the Query Engine

setHost

public void setHost(String host)
Sets the host for this Query Engine object.
Parameters:
host - the host name or IP address

setQueryPort

public void setQueryPort(int queryPort)
Sets the query port for this Query Engine object.
Parameters:
queryPort - the query port to use

setIndexPort

public void setIndexPort(int indexPort)
Sets the index port for this Query Engine object.
Parameters:
indexPort - the index port to use

clear

public void clear()
Clears any parameters set for this object via the setter methods as a convenience for object reuse. This method does not affect the internal state of the Query Engine itself.

getHost

public String getHost()
Returns the host name or IP address of this Query Engine.
Returns:
the host

getQueryPort

public int getQueryPort()
Returns the query port used for this Query Engine.
Returns:
the query port

getIndexPort

public int getIndexPort()
Returns the index port used for this Query Engine.
Returns:
the index port

isAlive

public boolean isAlive()
Returns true if the Query Engine is running.
Returns:
true if the engine is running, false otherwise

ping

public void ping()
          throws EboUnrecoverableSystemException
Determines the state of the Query Engine and throws an exception if the engine is not running,

runQuery

public Collection runQuery(EbiContext context,
                           EbiQuery query,
                           String[] repositories,
                           boolean returnElements)
                    throws EboUnrecoverableSystemException,
                           EboSecurityException
Executes the specified query.
Parameters:
context - context
query - the query to run
repositories - the set of Query Engine repositories to run the query against; if not specified, the query is run over all of the repositories
returnElements - if true, a Collection of EbiQueryResult's is returned, otherwise a Collection of Map's of document properties mapped to their values
Returns:
a Collection of EbiQueryResult's or Map's depending on the value of the returnElements parameter

indexBuffer

public int indexBuffer(EbiContext context,
                       String strBuffer,
                       String killDupsMode)
                throws EboUnrecoverableSystemException,
                       EboSecurityException
Indexes the String buffer containing document data into the Query Engine.
Parameters:
context - context
strBuffer - the buffer to index
killDupsMode - specifies how to deal with duplicates when indexing
Returns:
the ID of the indexer that is indexing the data
See Also:
EbiQueryEngine.getIndexerStatus(int)

importFiles

public int importFiles(EbiContext context,
                       String filterDirectory,
                       String tempDirectory,
                       String importFileName,
                       String repository,
                       String[] fileNames,
                       boolean storeContents,
                       boolean setSummaries,
                       int[] retVals)
                throws EboUnrecoverableSystemException,
                       EboSecurityException
Imports the array of files whose names are specified.
Parameters:
context - context
filterDirectory - the directory where binary document filters are installed
tempDirectory - the temporary directory, if any, for the importer to use
importFileName - the filepath of the output import file; if the file does not exist, the method attempts to create it, if it exists, the method will overwrite it with the new output
repository - the name of the query engine repository that the imported files are intended for
fileNames - the filepaths of content files to be imported
storeContents - if true, contents are stored into the output file
setSummaries - if true, the import process automatically creates a summary field for for each document based on the first couple of sentences
retVals - an array of status/error codes, one per each of the files in the fileNames array
Returns:
status/error code for the operation
See Also:
EbiQueryEngine.indexFile(EbiContext, String, String, String), EbiQueryEngine.getStatusMessage(int)

indexFile

public int indexFile(EbiContext context,
                     String killDupsMode,
                     String repository,
                     String importFileName)
              throws EboUnrecoverableSystemException,
                     EboSecurityException
Indexes the specified import file into the query engine.
Parameters:
context - context
killDupsMode - specifies how to deal with duplicates when indexing
repository - the name of the query engine repository that the content in the import file is intended for
importFileName - the filepath to the import content file
Returns:
the ID of the indexer that is indexing the data
See Also:
EbiQueryEngine.importFiles(EbiContext, String, String, String, String, String[], boolean, boolean, int[]), EbiQueryEngine.getIndexerStatus(int)

getIndexerStatus

public int getIndexerStatus(int indexID)
                     throws EboUnrecoverableSystemException
Returns the status of a specific indexer.
Parameters:
indexID - the index ID
Returns:
the status

getStatusMessage

public String getStatusMessage(int status)
                        throws EboUnrecoverableSystemException
Returns the message for a status or error code.
Parameters:
status - the status to get the message for
Returns:
the status message

removeDocuments

public void removeDocuments(EbiContext context,
                            String[] repositories,
                            String[] docs,
                            boolean byID)
                     throws EboUnrecoverableSystemException,
                            EboSecurityException
Removes the specified documents from the Query Engine.
Parameters:
context - context
repositories - the names of Query Engine repositories to remove the documents in
docs - the ID's or references/URL's of documents to be removed
byID - if true, 'docs' is assumed to be an array of document ID's, otherwise an array of document references

getRepositories

public Collection getRepositories(EbiContext context)
                           throws EboUnrecoverableSystemException,
                                  EboSecurityException
Returns the list of names of Query Engine repositories.
Parameters:
context - context
Returns:
a Collection of String's each of which is a repository name

addRepository

public void addRepository(EbiContext context,
                          String repositoryName)
                   throws EboUnrecoverableSystemException,
                          EboSecurityException
Adds a new repository to the Query Engine.
Parameters:
context - context
repositoryName - the name of the new repository

removeRepository

public void removeRepository(EbiContext context,
                             String repositoryName)
                      throws EboUnrecoverableSystemException,
                             EboSecurityException
Removes all documents from the specified Query Engine repository and removes the repository itself.
Parameters:
context - context
repositoryName - the repository name

clearRepository

public void clearRepository(EbiContext context,
                            String repositoryName)
                     throws EboUnrecoverableSystemException,
                            EboSecurityException
Removes all documents from the specified Query Engine repository.
Parameters:
context - context
repositoryName - the repository name

reinitialize

public void reinitialize(EbiContext context)
                  throws EboUnrecoverableSystemException,
                         EboSecurityException
Removes all documents from the Query Engine and reinitializes it.
Parameters:
context - context

reset

public void reset(EbiContext context)
           throws EboUnrecoverableSystemException,
                  EboSecurityException
Reloads the configuration settings for the Query Engine and resets it.
Parameters:
context - context

Novell exteNd
Director 5.2 API