> (de importAddr (F)
> (let (Cnt 0 L NIL)
> (in F
> (while (setq L (split (line) "^I"))
> (let Obj (request '(+Prs) 'nm (pack (car L)))
> (put> Obj 'adr (pack (cadr L)))
> (put> Obj 'em (pack (caddr L)))
> (put> Obj 'tel (pack (cadddr L)))
> (put> Obj 'dob (format (pack (get L 5)))) )
> (commit 'upd)
> (inc 'Cnt) ) )
> (prinl "Lines read: " Cnt) ) )
OK, fine. Looks good :)
> If I do the import twice from the same file, then I get duplicates of
> each address in the DB.
This is strange, and should not be the case. Are you sure? The 'request'
prevents that, as long as the names 'nm' are different.
> One of the addresses in my DB is "Veien 1, 9999 Byen”. If I search for
> "1" in Address, I get no match, but if I search for "9" in Address, I
> get a match. Why this difference?
I tried to explain that in a previous mail. Only substrings of a minimal
length of 3 characters make sense to be searched, because that is the
shortest substring written into the index. Searching for a single
character may or may not return something, depending if it happens that
a substring starts with it. "999" and "9999" are in the index.
> If my DB containes very many addresses, say more than 1000, then a
> search could easily match lot more than the 12 that can be displayed at
> one time in this app.
Yes, then you may scroll down in the chart.
> If the number of matches also was quite big, then I think it would
> have been nice to see this number down by the back- and forth-buttons at
> the bottom. Is it easy to get hold of this number?
Not in general. As I said, the search is incremenetal. 1000 is not much,
I have a million in some databases. Searching through all of them just
to obtain the count of matches is not feasible.
So QueryChart searches only as many as is given by the chart, and then
continues to fetch the next single line, or the next page of 12 lines.
> How many addresses do you think this simple app can handle, without
> operations (search, update) getting very slow? More than 100.000? I’m
> just curious.
No limit. It won't get slow even with 100 millions, for the above