Links
dtSearch Text Retrieval Engine Programmer's Reference 7.70
DSearchJob::OnFound Method (long, long, char *, long, dtsSearchNotificationItem&)
OnFound Method | DSearchJob Class | dtSearch Namespace | Example | Send Feedback

Each time a document is retrieved, this function will be called.

virtual void OnFound(long totalFiles, long totalHits, const char * name, long hitsInFile, dtsSearchNotificationItem& item);
Parameters
Parameters 
Description 
long totalFiles 
Total number of files found so far 
long totalHits 
Total number of hits found so far 
const char * name 
Name of the file retrieved 
long hitsInFile 
Number of hits in this file 
dtsSearchNotificationItem& item 
Document properties (these will be mostly empty of the dtsSearchDelayDocInfo SearchFlags flag was set. 
Remarks

An application can call DSearchJob::VetoThisItem from the OnFound callback to prevent the item from being included in search results.

Example
 CMySearchJob : public DSearchJob {
 public:
 ...
 virtual void OnError(long errorCode, const char *msg) {
     // First call base class implementation
     DSearchJob::OnError(errorCode, msg);
     // Now show the message to the user
     CString csMsg = GetMyErrorForErrorCode(errorCode);
     ShowMessageToUser(csMsg);
     }
 virtual void OnFound(long totalFiles, long totalHits,
     const char *name, long hitsInFile, dtsSearchResultsItem& item) {
     // First call base class implementation
     DSearchJob::OnFound(totalFiles, totalHits, name, hitsInFile, item);
     // Now show the file to the user
     ShowFoundFileToUser(name);
    }
    };
Group
Links
You are here: C++ Support Classes > dtSearch Namespace > Classes > DSearchJob Class > OnFound Method > DSearchJob::OnFound Method (long, long, char *, long, dtsSearchNotificationItem&)
Copyright (c) 1995-2012 dtSearch Corp. All rights reserved.