Index

DKTextQuery

Purpose:

DKTextQuery is a concrete subclass of dkQuery, created by a datastore object to represent and execute a query involving textual data. Text queries refer to a class of queries on the content of text fields for an approximate match with the given text search expression; that is, the existence (or non existence) of certain phrases or word-stems.

The text query object performs the necessary data format conversion internally (for example, datastream conversion for Text Search Engine), so the methods relevant to these conversions are transparent to the end user.

Class summary:

class DKTextQuery : public dkQuery
{
public:
   DKTextQuery (dkDatastore* ds, const char* queryString);
   DKTextQuery (dkDatastore* ds, DKCQExpr* queryExpr);
   DKTextQuery(const DKTextQuery& query);
   virtual ~DKTextQuery();
 
   virtual void prepare(const DKNVPair* params = 0);
   virtual void execute(const DKNVPair* params = 0);
   virtual DKQueryStatus status();
   virtual DKAny result(DKBoolean fDelete = TRUE);
   virtual dkResultSetCursor* resultSetCursor();
   virtual unsigned long numberOfResults();
};

Members:

Constructors and destructor
   DKTextQuery (dkDatastore* ds, const char* queryString);
   DKTextQuery (dkDatastore* ds, DKCQExpr* queryExpr);
   DKTextQuery(const DKTextQuery& query);
   virtual ~DKTextQuery();
 

DKTextQuery object has three constructors. The first one takes its associated datastore and the query string. The second constructor takes its associated datastore and a query expression. The third constructor is a copy constructor. DKTextQuery object may also be constructed by calling the createQuery() method on its associated datastore object.

Member functions

prepare
Stages or prepares the parameter-specific query.
virtual void prepare(const DKNVPair* params = 0);

execute
Executes this query. The result is obtained by calling result().
virtual void execute(const DKNVPair* params = 0);

status
Gets the status of a query.
virtual DKQueryStatus status();

result
Returns the result pointer to the caller. The result is a DKAny object, which contains a pointer to the DKResults object. The DKResults object is a collection of DKAny objects. The value of any of these DKAny objects is a pointer to a DKDDO object, which represents a document or folder.
virtual DKAny result(DKBoolean fDelete = TRUE);

resultSetCursor
Returns the query result in a dkResultSetCursor object.
virtual dkResultSetCursor* resultSetCursor();

numberOfResults
Gets the number of query results.
virtual unsigned long numberOfResults();

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.