You are here: C++ API > Classes > dtsWordListBuilder Class > dtsWordListBuilder::listFieldValues Method
Close
dtSearch Text Retrieval Engine Programmer's Reference
dtsWordListBuilder::listFieldValues Method

List all values of an enumerable field.

Syntax
C++
void listFieldValues(const char * fieldName, const char * toMatch, long maxWords);
Parameters
Description
const char * fieldName
The name of the field to enumerate
const char * toMatch
The expression to match, which may include wildcards
long maxWords
Maximum number of words to include in the list

The field must have been designated as an enumerable field (in dtsIndexJob.enumerableFields) when the index was created. If fieldName is not an enumerable field, no values will be returned. 

The maximum amount of text that can be stored in each stored field is the lesser of the maxStoredFieldSize option setting or 127 characters, including the field name. 

To limit the values returned to documents that are part of search results, use setSearchFilter

To improve performance in cases where the same field values have to be enumerated repeatedly with different SearchFilters, you can set the flag dtsWordListEnableFieldValuesCache using setFlags(). This will make listFieldValues calls from the same WordListBuilder faster at the cost of substantial memory use, because the field values and occurrences in the index will be stored in memory until the WordListBuilder is deleted. The amount of memory required is proportional to the number of documents in the index times the number of values in the enumerable field that is cached.

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