Documentation
(C) IBM Corp. 1996, 1999

Text Extender: Administration and Programming

DesGetSearchResultTable

Purpose

Uses a search argument for searching through text documents identified by a text column. The handle data of the found text items is written to a result table. Browse information about rank and the number of matches can also be written to the result table.

Syntax

DESRETURN
  DesGetSearchResultTable
    (SQLHDBC           hdbc,
     char              *pTableSchema,
     DESSMALLINT       TableSchemaLength,
     char              *pTableName,
     DESSMALLINT       TableNameLength,
     char              *pColumnName,
     DESSMALLINT       ColumnNameLength,
     char              *pSearchArgument,
     DESSMALLINT       ArgumentLength,
     char              *pResultSchema,
     DESSMALLINT       ResultSchemaLength,
     char              *pResultTableName,
     DESSMALLINT       ResultTableNameLength,
     DESSEARCHOPTION   SearchOption,
     DESBROWSEOPTION   BrowseOption,
     DESBROWSEINFO     *pBrowseInfo,
     DESMESSAGE        *pErrorMessage);

Function arguments

Table 12. DesGetSearchResultTable arguments
Data Type Argument Use Description
SQLHDBC hdbc input A database connection handle.
char * pTableSchema input The schema of the base table to be searched.
DESSMALLINT TableSchemaLength input Either the length of pTableSchema (not including a null byte terminator) or DES_NTS.
char * pTableName input Pointer to the name of the base table to be searched.
DESSMALLINT TableNameLength input Either the length of pTableName (not including a null byte terminator) or DES_NTS.
char * pColumnName input Pointer to the name of the column to be addressed by the intended text search. The column must be of type DESTEXTH.
DESSMALLINT ColumnNameLength input Either the length of pColumnName (not including a null byte terminator) or DES_NTS.
char * pSearchArgument input Pointer to the text search argument.
DESSMALLINT ArgumentLength input Either the length of pSearchArgument (not including a null byte terminator) or DES_NTS.
char * pResultSchema input Pointer to the schema containing the result table.
DESSMALLINT ResultSchemaLength input Either the length of pSchemaName (not including a null byte terminator) or DES_NTS.
char * pResultTableName input Pointer to the name of the result table that you have previously created in which the result of the search is to be stored. See Figure 14 for the structure of this table.
DESSMALLINT ResultTableNameLength input Either the length of pResultTableName (not including a null byte terminator) or DES_NTS.
DESSEARCHOPTION SearchOption input An option that determines whether you are asking for ranking information, for the number of matches, or only for the handles of the matching text documents.

DES_RANK
DES_MATCH
DES_RANKANDMATCH
DES_TEXTHANDLEONLY

This option determines the content of result table as described in Usage.

DESBROWSEOPTION BrowseOption input Reserved.

DESBROWSEINFO * pBrowseInfo output Pointer to browse information or a pointer to null, depending on the value of BrowseOption.
DESMESSAGE * pErrorMessage output Implementation-defined message text. If an error occurs, Text Extender returns an error code and an error message. The application program allocates the buffer of size DES_MAX_MESSAGE_LENGTH. If pErrorMessage is the null pointer, no error message is returned.

Usage

The connection to the database must be established by the application program calling DesGetSearchResultTable.

The name pResultTableName refers to a result table that you have created in advance. The utility DESRESTB in the sample directory creates a result table for text handles. After the call of this function, the result table contains information identifying text values matching the search argument.

This is the structure of the result table:

Figure 14. Structure of the result table


REQTEXT

The data type of TEXTHANDLE is DB2TEXTH or DB2TEXTFH. The data type of RANK is DOUBLE. The data type of MATCHES is INTEGER.

The search argument at pSearchArgument is described in Chapter 10, Syntax of search arguments.

If the value of BrowseOption is BROWSE, Text Extender returns browse information from the Text Extender search engine located on the server. pBrowseInfo points to the browse information which is the input to DesStartBrowseSession. If the value of BrowseOption is NO_BROWSE pBrowseInfo points to null.

Return codes

RC_SUCCESS
RC_NO_BROWSE_INFO
RC_SE_NO_DATA
 
RC_ALLOCATION_ERROR
RC_FILE_IO_PROBLEM
RC_INTERNAL_ERROR
RC_INVALID_BROWSE_OPTION
RC_INVALID_PARAMETER
RC_INVALID_SEARCH_OPTION
RC_INVALID_SESSION
RC_PARSER_INVALID_ESCAPE_CHARACTER
RC_PARSER_SYNTAX_ERROR
RC_RESULT_TABLE_NOT_EXIST
RC_SE_COMMUNICATION_PROBLEM
RC_SE_EMPTY_INDEX
RC_SE_EMPTY_QUERY
RC_SE_FUNCTION_DISABLED
RC_SE_FUNCTION_IN_ERROR
RC_SE_INCORRECT_HANDLE
RC_SE_INDEX_DELETED
RC_SE_INDEX_NOT_ACCESSIBLE
RC_SE_INDEX_SUSPENDED
RC_SE_INSTALLATION_PROBLEM
RC_SE_IO_PROBLEM
RC_SE_MAX_NUMBER_OF_BUSY_INDEXES
RC_SE_NOT_ENOUGH_MEMORY
RC_SE_PROCESSING_LIMIT_EXCEEDED
RC_SE_QUERY_TOO_COMPLEX
RC_SE_SERVER_BUSY
RC_SE_SERVER_CONNECTION_LOST
RC_SE_SERVER_NOT_AVAILABLE
RC_SE_UNEXPECTED_ERROR
RC_SE_UNKNOWN_INDEX_NAME
RC_SE_UNKNOWN_SERVER_NAME
RC_SE_WRITE_TO_DISK_ERROR
RC_SQL_ERROR_NO_INFO
RC_SQL_ERROR_WITH_INFO
RC_TEXT_COLUMN_NOT_ENABLED
 
Warnings: The following return codes indicate that the function has returned a result, but it may not be as expected.
 
RC_SE_CONFLICT_WITH_INDEX_TYPE
RC_SE_DICTIONARY_NOT_FOUND
RC_SE_STOPWORD_IGNORED
RC_SE_UNKNOWN_SECTION_NAME
RC_SE_DOCMOD_READ_PROBLEM


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]