Logo Tamarack Associates
Products Download Support Order Contact

Addendum to the Rubicon 2 Manual

procedure CheckMatchResults(Search : TrbSearch;
              DataSet : TDataSet; Sorted : Boolean);

Use this procedure to perform a union of the Rubicon search results and the DataSet. After calling the procedure, Search will reflect the results of the union. The DataSet is not altered. The DataSet must contain the IndexFieldName column. If the DataSet is sorted by IndexFieldName, then Sorted may be set to True. However, if Search.MatchCount is small and DataSet.RecordCount is large, setting Sorted to False should improve performance. The Sorted parameter is ignored under
Delphi 1. The DataSet must be indexed for Delphi 1. See example in c:\rubicon2\examples\TTable\ExRange.dpr.

 

property TrbCustomCache.CompressPercent : Integer;

When a TrbCache is used with TrbUpdate or TrbSearch, words and indexes are added to the cache as they are used by the engine. When the cache is full, the indexes will be compressed. When more than CompressPercent of the words in the cache are compressed, then the least recently used words are purged from the cache.

Setting CompressPercent to a higher value means that more words can be held by the cache, but more time will be spent compressing and decompressing frequently used words. This setting has no impact when the cache is used with a TrbMake or TrbAppend component.

Default is 75. Acceptable values are 1..99. Recommended values are in the range of 60..90.

Introduced in Rubicon 2.05

 

property TrbEngine.FastPhrase : Boolean;

Set this property to True in TrbMake (it is read only elsewhere) to enable faster searching for phrases.  When enabled, searches containing leading wildcards are not supported unless ReverseField is also enabled.

This property should only be set by advanced users after careful evaluation since using it increases the Words table size significantly.  This property is public, not published, so it must be set in code.  For a complete discussion of this property, see FastPhrase.

Introduced in Rubicon 2.04.

 

property TrbController.FieldNames : TStrings;

The default field name for the field containing the database name is DBName, not DatabaseName.

 

TErrorEvent = procedure (Sender : TObject; const E : Exception) of object;

property TrbServerUpdate.OnError : TErrorEvent;

This event is called when the component encounters an error writing a word to the WordsLink.

Introduced in Rubicon 2.20.

 

procedure TrbSearch.MatchingWordsEx(List : TStrings);

Similar to MatchingWords, but the Objects property contains a pointer to a TWordInfo record.

Introduced in Rubicon 2.08.

 

property TrbSearch.MissingWords : TStrings;

Returns a list of words missing from the search.  A search for "delphi3 or delphi4" may return 100 matches, but "delphi3" may not be in the database, in which case it would appear in MissingWords.

Introduced in Rubicon 2.08.

 

property TrbTextDataSetLink.IndexFieldName : String;

The example in the manual is incorrect.  Should be:

rbMakeTextTableLink1.IndexFieldName := 'CustNo';

 

property TrbTextDataSetLink.OnMinIndex : TIndexValueEvent;
property TrbTextDataSetLink.OnMaxIndex : TIndexValueEvent;

The examples shown for these events are incorrectly shown as procedures, not functions, in the October 1998 manual.

If the OnMinIndex event is being used to reserve some index locations below the current minimum index value in the table and query based drivers are being used, the value returned by the event must not be less than the current minimum index value minus the BlockSize.

 

property TrbEngine.OnParseWord : TParseWordEvent;

TParseWordEvent = function (Sender : TObject; var S : PChar; var Len : Cardinal; Wildcards : Boolean) : String of object;


Use this event to implement custom parsing to the text.  S is a pointer to the text being parsed.  Len in the number of characters in S.  The function should return the next word, S should be returned pointing to a character that follows the word, and Len should returned decremented by the number of characters processed by the function.

The event should return each word to the Sender even if the word does not meet the MinWordLen criteria, the word is in the OmitList, or the word may be rejected by the OnAcceptWord event.  Even if a word is not indexed, it can be used in proximity searches and may be used when FastPhrase is enabled.

This event is called when indexing the text and when parsing words entered in a search.  This ensures that the parsing used is consistent between indexing and searching.  However, when searches are performed, wildcard characters should not be considered as word delimiters.  Therefore, when the event is called in the context of a search, the Wildcards parameter is set to True so that the event can make the appropriate adjustments.

If this event is used to index the text in TrbMake, the OnParseWord event must also be set in TrbUpdate and TrbSearch.

In Delphi 1, the Len parameter will appear as a Word.

See c:\rubicon2\examples\TTable\ExParse.dpr for an example.

Introduced in Rubicon 2.04.

 

property TrbRankSearch.RankPresense : Word;

Returns the number of matching words found for the current record. If the current record does not meet the search criteria, returns zero. Each matching word has a maximum score or rank of one. If the search if for "delphi or paradox or dbase" and all three words appear in the text, the rank will be three (even if a word appears multiple times), if only two words appear, the rank will be two, etc. Note that this property is only useful when the search uses OR search logic, otherwise all the scores will be the same.

Run-time and read only.  Introduced in Rubicon 2.02.
 

 

procedure TrbBase.Reset;

If the configuration of Rubicon components are changed at run time, it may be necessary to call this method before executing any subsequent operations (e.g. rbSearch1.Reset). Should only be called by TrbEngine descendents. It should only be necessary to call Reset when changing a link, the dataset associated with a link, or a cache component at run time. Call Reset after making changes to properties, but before calling Execute or performing a delete/edit/insert.

 

property TrbWordsDataSetLink.ReverseField : Boolean;

When this property is True, the Words table will contain an rbReverse field which will be the reverse of the rbWord field. The rbReverse field is used to optimize the performance of searches that begin with a wildcard, but do not end with a
wildcard (e.g. '*tion', but not '*pute*').

Default is False.  Introduced in Rubicon 2.03.

 

property TrbBasicSearch.SearchOptions : TSearchOptions;
TSearchOption = (soLazyPhrase,soNavNatural,soNavReverse);

When soNavNatural is set, navigation with FindFirst, FindNext, FindPrior, and FindLast is in natural order based on the IndexFieldName, otherwise navigation is based on the RankMode.

soNavReverse reverses the meaning of the FindXxxx methods. When set, FindFirst acts like FindLast, FindNext acts like FindPrior, etc. This is useful when used with TrbMatchMaker because it can reverse the ordering of the Match dataset.

When this soLazyPhrase is set and the Words table has been indexed with FastPhrase, slPhrase searches will not confirm that the phrase exists in the Text and thus result in faster search performance.  If FastPhrase has not been enabled, this property is ignored. This setting should only be used by advanced users after careful evaluation since using it may result in false matches when the phrase consists of three or more words.

Introduced in Rubicon 2.05.


property TrbTextSQLLink.SelectAll : Boolean;

Text queries by default only select the IndexFieldName and FieldNames fields. If an application needs to access other fields, then set SelectAll to true and all the fields will be retrieved.

When using a TrbMatchMaker, it is often necessary to set SelectAll to True in order to include fields other than IndexFieldName and FieldNames.

Default is False.

 

property TrbTextDataSetLink.SubFieldNames : TStrings;

The example shows rbSearch1, should be rbTextTableLink1, in the October 1998 manual.

 

procedure TrbUpdateDialog.UpdateEvent(Sender : TObject);

Assign this method to the AfterUpdate and/or AfterBatch events in order to notify TrbUpdateDialog when to update itself.  When the first update is performed, the update dialog will be automatically displayed.

procedure TForm1.FormCreate(Sender: TObject);
begin
 rbTable1.AfterUpdate := rbUpdateDialog1.UpdateEvent;
 rbUpdate1.AfterBatch := rbUpdateDialog1.UpdateEvent;
end;

 

All of the above corrections are reflected in the 2.05 help file.

Custom Ordering of Search Results (p. 175)

In the fourth paragraph, the reference to IndexFieldName should instead be IndexFieldNames.  For a TTable, the code is:

if MatchCount > 0 then
 begin
  rbMatchMaker1.Execute;
  // Need to add a primary index first for Paradox tables
  Table3.AddIndex('','HelpNo',[ixPrimary]);
  Table3.AddIndex('Name','Name',[]);
  Table3.IndexFieldNames := 'Name'
 end;

 

Copyright 2003 © Tamarack Associates 

www.TamarackA.com Last updated 06/13/03 www.FullTextSearch.com