Icon BuildWordList Method

procedure BuildWordList(const TableName: String; const
      FieldName: String; WordBuffer: String; WordList:
      TDBISAMStringList; const SpaceChars: String; const IncludeChars:
      String; Occurrences: Boolean; PartialWords: Boolean)


Use the BuildWordList method to populate the WordList parameter with the word tokens that are parsed from the WordBuffer string parameter passed to the method, using the SpaceChars and IncludeChars parameters to control the parsing. The TableName and FieldName parameters specify which table and field the WordBuffer string applies to. The reason for this information is that it is passed on to the TDBISAMEngine OnTextIndexFilter and OnTextIndexTokenFilter events in order to give the event handlers attached to these events the proper information about how to perform any custom filtering. The Occurrences parameter is used to specify whether you wish to have the Objects property for each string list item (search word) populated with the number of occurrences of that word or with the position of the start of that word (0-based) in the WordBuffer parameter. You'll have to cast these integer values from TObject values when accessing them via the Objects property. The PartialWords parameter is used to specify whether partial words should be allowed and asterisks in words should be left intact even if they are designated as a space character or not designated as an include character. This parameter is useful when using the BuildWordList method for parsing a search string that includes wildcards.

Information The WordList parameter is a special descendant of the TStringList object called TDBISAMStringList for performing locale-specific sorting and searching of a string list. The TDBIAMStringList object contains an additional LocaleID property that can be set to match the locale of the table being searched. The WordList parameter is where the results of this procedure are stored, and this parameter is cleared during the operation of the procedure.