Links
dtSearch Text Retrieval Engine Programmer's Reference
dtsSearchResultsItem Structure
Data Members | Classes | Legend | Members | Methods | Send Feedback

Properties of a single retrieved document from a search.

struct dtsSearchResultsItem {
  const char * filename;
  const char * displayName;
  const char * title;
  struct dtsFileDate modified;
  long hitCount;
  long wordCount;
  long size;
  long score;
  const char * userFields;
  long docId;
  long iIndex;
  const char * hitsByWord;
  long typeId;
  const char * hitsByWord2;
  long * hits;
  const char * location;
  const char * shortName;
  long indexedBy;
  const char * indexRetrievedFrom;
  const char * synopsis;
  const char * hitDetails;
  long scorePercent;
  long originalHitCount;
  long phraseCount;
  struct dtsFileDate created;
  __int64 size64;
};
File

dtsearch.h

Remarks

There are two ways to obtain a dtsSearchResultsItem: 

(1) Call dtsSearchResults.getDocInfo(), or (2) In a search callback function during a search.

Search callbacks

The dtSearch Engine will pass a pointer to a dtsSearchResultsItem to the pReportCallBack function that you supply in a dtsSearchJob to receive detailed status information during a search. The pointer is passed in the pFoundItem member of the dtsSearchResultsItem, which is passed in the dtsMessage structure passed to in the ptrParam. (The paramA member is the number of hits in the retrieved document and the strParam member is the name of the retrieved document.) 

If the dtsSearchDelayDocInfo SearchFlag was set, most of the data in the dtsSearchResultsItem will be blank in callbacks, because the document information record has not yet been retrieved. Only information generated by the search (document id, hit count, hitsByWord, etc.) will be present.

Data Members
Data Member 
Description 
File created date 
Either a blank string, or the name of the retrieved file in a form that is more suited to user display than the filename 
A long integer that uniquely identifies this document in the index 
Name of the retrieved file. 
count of items in hits list (See phraseCount below for an alternative count.) 
A null-delimited string set containing details on the hits generated by each word match in a search request. See the documentation on the dtsSearchWantHitDetails Flag for more information. 
hits 
Word offsets of the hits in the document 
A null-delimited string set containing the number of times each word or phrase in a search request was found. The string set consists of a series of entries with the number of hits, the word or phrase, and, if the search involved a field name, the name of the field. Phrases are quoted. To obtain hitsByWord, set the dtsSearchWantHitsByWord flag in the dtsSearchJob's searchFlags member. 
deprecated, use hitDetails 
If more than one index was searched, this will identify the index that the document was retrieved from. The iIndex member is an index into the indexesToSearch list in the dtsSearchJob
Build number of dtSearch Engine version that indexed this file 
Path of the index this document was found in 
Location of the document 
The modification date of the document 
after URL-encode/decode, hitCount might be less than originalHitCount 
Number of phrases matching the search request. By default, dtSearch counts each word in search results as a hit. When the dtsSearchWantHitsByWord flag is set in the dtsSearchJob's searchFlags member, in addition to creating the hitsByWord table (see above), dtSearch will also calculate the hit count with each phrase counted as a single hit. The hitCount is still reported as the number of words matching the search request. 
The score for each document is either the hit count or the weighted score, if automatic or variable term weighting was used in the search. 
The scorePercent for each document is the score expressed as a percentage, relative to the highest-scoring document in the search results list. 
Filename of the document with path removed 
size 
Size of the document, in bytes, when it was indexed (superseded by size64
Size of the document, in bytes, when it was indexed 
Snippet of text showing hits in context, if a search report was generated from the search results containing this item, and if the dtsReportStoreInResults flag was set in the dtsSearchReportJob 
Text from the beginning of the document 
File type of the document when it was indexed (see dtsImportType for a list of type ids) 
A null-delimited list of field names and field values containing each field in this document that was listed in the storedFields list in the dtsIndexJob used to index the document 
Number of words in the document when it was indexed. 
Group
Methods
Method 
Description 
Get user-friendly name to display for this file, taking into account whether the PDF and HTML titles should be used in place of filenames 
Returns true if this document was cached in the index when the index was created
Legend
 
Data Member 
 
Method 
Links
You are here: C++ API > Classes > dtsSearchResultsItem Structure
Copyright (c) 1995-2008 dtSearch Corp. All rights reserved.