Hi Jon,

> When I’m typing in one of the search fields (Name or Address), a box
> with possible matches pops up, but quite often there are names/addresses
> missing in this box, and I haven’t been able to find a pattern in this.
> If I type a (single) j, k, l, e, i or s, then my name comes up, but not
> if I type just o, n or r. Do you know why?

Yes. The 'nm' relation in the DB model

   (rel nm (+Sn +IdxFold +String))

uses two index prefixes:

   1. +Sn for the soundex algorithm. It stores a condensed and unified
      pattern in the DB index tree. In case of e.g. "Jon Kleiser" this
      is "JNSLSR". This pattern is used for tolerant searches.

   2. +IdxFold applies the 'fold' function the whole name, and stores it
      (i.e. "jonkleiser") in the index. Then it splits the name on
      blanks, 'fold's the fragments, and stores substrings of these
      fragments.

But: The substrings are generated only up to a maximal length of three.
This is to avoid storing lots of single- or double-letter tokens - which
are not meaningful to search - in the index.

Thus, "jon" is stored, but not "on" or "n".

If you dump the index, you'll see what's there:

   : (scan '(nm . +Prs))
   ("JNSLSR" {2} . T) {2}
   ("eiser" {2}) {2}
   ("iser" {2}) {2}
   ("jonkleiser" . {2}) {2}
   ("kleiser" {2}) {2}
   ("leiser" {2}) {2}
   ("ser" {2}) {2}

Thus, when you type in the search field, this index is accessed. Typing
"iser" or only "ser" will find something, but "o", "n" or "r" won't.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to