Subject Re: [IBO] search with a several criteria
Author Gediminas
Still have some questions

At 2003-10-21 05:22, you wrote:
>What you're seeing here is "horizontal dataset refinement" doing its
>stuff. I've yet to understand the full magic of this but I'll explain it
>......
>When searching, IBO considers various possible sets that it could have in
>the buffer to satisfy the current search criteria. It can tell from its
>Keyfields whether it already has them in the buffer or whether it has to
>refresh the buffer in order to have the requested rows available. Every
>fresh request for rows gets fresh parameters and, if the ordering or the
>list of searched columns change, it actually has to issue a new query.
>
>When you do an incremental search, you are not looking for a single record
>- you are looking for all records that match [STARTING WITH :aString],
>which is the set of characters that has been typed into the control. With
>each extra character you type, it refines the search horizontally (left to
>right across the aString value, as it grows). Depending on how fast or
>slow your typing is, IBO is busy making up a new parameter to pass to
>:aString and is pull back fewer and fewer records each time, as the HDR
>gets nearer and nearer to identifying a single record.

If incremental search uses [STARTING WITH :aString], then each additional
character in a control would narrow dataset. However IB_Grid shows all the
dataset (not refined with STARTING WITH :aString), only cursor is moved to
the nearest matching record & incremental search's control has nearest
record match ending. How to force grid to display only incremental search's
dataset - i'm interested only in refined dataset, unmatched rows are?
Monitor doesn't show any issued queries for TIB_IncSearch, but

>The search is always an ordered search, to ensure that the records with the
>search field matching the ordering item come out first.

That I understand, but I have tried to refine initial dataset for name
(ordered by name), then switch to the surname ordering and use already by
name refined dataset for further refining. However TIB_Grid showed initial
not refined dataset - as it was before refining by name (STARTING WITH
:aNameString)

> >Moved to IB_ParamEdit - everything is ok
> >select "Name" , "Surname" from Table
> >where "Name" starting with :Name and "Surname" starting with :Surname:
> >
> >but I miss 2 great features:
> >- there is no autocompletion of a selected nearest record (IB_IncSearch has
> >it) - looked into IB_IncSearch.pas but failed to understand, where is
> >autocompletion code;
>
>Look at the SeekNearest property of TIB_IncSearch. This *is* the
>incremental search control. Incremental search characteristics are
>available on TIB_Grid, TIB_LookupCombo and TIB_LookupList as well.

Yes, SeekNearest proprety is turned on for TIB_IncSearch, but it's missing
in TIB_ParamEdit - I liked behaviour, when if I type 'H' the first matching
record (for example 'Helen') is autocompleted in the control, so I have
'Helen' - 'elen' is selected.

> >- select doesn't use cached dataset, it make query every time on key press;
>
>Of course it queries - this isn't Access!! - but not necessarily every
>time. If it has all of the requested rows already in the buffer, it simply
>repositions. You will see queries happening on the occasions when some or
>all of your requested rows are not present in the buffer.

monitor window everytime shows query - requested rows is not presented in
the buffer even first character refines only 1 suitable record (if there is
only 1 record with starting character 'H', queries are send for 'H', 'He',
'Hel', 'Hele' params)



--/ Gediminas /--
The Truth Is Out There