WordListBuilder provides a way to list words, field names, or field values in an index
WordListBuilder is intended for quick enumeration of words, field names, or field values in an index.
Two ways of listing words are provided, one for listing the words before and after a word in an index, and one for listing words that match a search term in an index.
The scrolling list of indexed words that updates as a user enters a search request in dtSearch Desktop is implemented using WordListBuilder's ListWords method. The "Browse Words" dialog box in dtSearch Desktop that lists words matching an expression is implemented using the ListMatchingWords method.
Listing of field values only lists values of fields that were designated as EnumerableFields when the documents were indexed.
For speed, WordListBuilder does not actually enumerate the references for each word and instead relies on counts incrementally stored in the index. Therefore, the reported counts may include artifacts of the indexing process such as reindexed or removed documents, so the counts may be higher than the actual count of references in the index. Compressing an index will remove these extra references.
To improve performance in cases where the same field values have to be enumerated repeatedly with different SearchFilters, you can set the flag dtsWordListEnableFieldValuesCache in Flags. 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.
Topic |
Description |
The following tables list the members exposed by WordListBuilder. | |
The methods of the WordListBuilder class are listed here. | |
The properties of the WordListBuilder class are listed here. |
WordListBuilder Methods |
Description |
Close the index. | |
Get the text of a word in the word list. | |
Get the number of times this word occurs in the index | |
Get the number of documents in which this word occurs | |
Get field associated with a word | |
List all field values in the index that match an expression | |
List all fields in the index | |
List all words in the index that match an expression | |
List words surrounding cursorWord in the index | |
Open the index at IndexPath and return true if the index was opened successfully | |
Open the index at IndexPath and return true if the index was opened successfully, using the provided indexCache. | |
Sort the word list by document count or term | |
Return Type: void | |
Return Type: void hBuilder: void* | |
Return Type: void hBuilder: void* | |
Return Type: int hBuilder: void* | |
Return Type: void hBuilder: void* iWord: int buf: char* bufSize: int | |
Return Type: int hBuilder: void* | |
Return Type: int hBuilder: void* | |
Return Type: void hBuilder: void* iWord: int buf: char* bufSize: int pCount: int* pDocCount: int* | |
Return Type: void hBuilder: void* fieldName: char* word: char* maxCount: int | |
Return Type: void hBuilder: void* maxCount: int | |
Return Type: void hBuilder: void* toMatch: char* maxCount: int searchFlags: int fuzziness: int | |
Return Type: void hBuilder: void* cursorWord: char* aRange: int | |
Return Type: int hBuilder: void* indexPath: char* | |
Return Type: void hBuilder: void* wordListBuilderFlags: int | |
Return Type: void hBuilder: void* hFilter: void* | |
Return Type: boolean hBuilder: void* flags: int |
WordListBuilder Properties |
Description |
Number of words in the list | |
Flags from the WordListBuilderFlags enumeration to control the behavior of the WordListBuilder | |
Zero if the last operation succeeded, or an ErrorCodes value if the last operation failed |
Copyright (c) 1998-2023 dtSearch Corp. All rights reserved.
|