You are here: C++ API > Classes > dtsInputStream Structure > dtsInputStream::fields Data Member
Close
dtSearch Text Retrieval Engine Programmer's Reference
dtsInputStream::fields Data Member

Null-delimited string set containing pairs of field names and values to be associated with this document in the index.

Syntax
C++
const char * fields;

Example:

"SampleField\0This is the text of SampleField\0\0".

Field names can include nesting, using / to separate field name elements. Example:

"Meta/Subject\0 This is the subject\0Meta/Author\0 This is the author\0\0"

In this example, you could search across both fields by searching for "Meta contains (something)", or you could search for "Author contains (something)", or you could search for "Meta/Author contains (something)" to distinguish this Author field from any other Author fields that might be present in the document. 

Add a * in front of a field name to prevent the field name from being indexed as part of the field. Example:

"*SampleField\0 This is the text of SampleField\0\0".

Add two * in front of a field name to designate the field as a hidden stored field. Example:

"**SampleField\0 This is the text of SampleField\0\0"

Hidden stored fields are automatically stored in the index as document properties, and any text in a hidden stored field is not searchable. After a search, the values of any hidden stored fields will be returned in dtsSearchResultsItem.userFields for each item. 

An application using the dtsDataSource API to generate data to be indexed can use fields to add field data to documents as they are being indexed, without modifying the original documents. 

External file parsers should ignore the contents of fields.

Copyright (c) 1995-2021 dtSearch Corp. All rights reserved.