Close
dtSearch .NET Standard API 2023.02
DataSource.DocFields Property

In DocFields, supply any fielded data you want the dtSearch Engine to index.

string DocFields;

DocFields is a string containing any number of field-value pairs. Each field name and each value must be followed by a TAB character (\t or Chr(9)). 

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

Example: "*SampleField\t This is the text of SampleField\t". 

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

Example: "**SampleField\t This is the text of SampleField". 

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 SearchResultsItem.UserFields for each item. 

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

Example: "Meta/Subject\t This is the subject\tMeta/Authort This is the author" 

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. 

If you are indexing documents, metadata in those documents will also be indexed as fields, so you may want to name your DocFields items to avoid clashes with common document metadata fields such as Title, Subject, Author, etc.