[Info-vax] Looking for some text search ideas
David Froble
davef at tsoft-inc.com
Fri Sep 26 21:08:53 EDT 2014
Paul Sture wrote:
> On 2014-09-26, Michael Moroney <moroney at world.std.spaamtrap.com> wrote:
>> Bill Pedersen <pedersen at ccsscorp.com> writes:
>>
>>> A recent example was to search only for the leading letter of the
>>> string. On match then check the character at the position of the last
>>> letter in desired srting for a match, if not match continue with
>>> comparison search for first letter of string at position after the last
>>> letter failed. This has been shown to speed up the searches.
>> I've seen that search, not quite like that but the location and value of
>> the mismatch determined how many characters to skip. More efficient with
>> long search strings. I believe NOTES uses that algorithm.
>
> The implementation language and the size of the field(s) being searched
> might determine the best method here, and it can be a tradeoff between
> runtime and KISS programming. To take a worst case example, the overhead
> of a DCL loop proceeding up a string 1 byte at a time would outweigh the
> advantage of Bill's method, using F$LOCATE on the whole string would be
> much more efficient.
>
> When I did this sort of thing in COBOL many moons ago I used calls to
> STR$POSITION on the whole string (max 132 bytes) to keep the program
> simple to develop and later maintain. Sub 2 second response times were
> however not required for that application.
>
>> Anyway, to the OP, does the value being search appear anywhere or only
>> as a portion of a key (your "head gasket" example) ? If only in the key,
>> can you make a parallel file with only the keys and search that smaller
>> file?
>
> Reducing the amount of data to be chewed through on a search is always a
> good idea.
>
> Next question: If the search returns multiple results, do they need
> ordering by for example the number of units sold, to reflect popular parts.
> In the case of lawn mowers, it's probably seasonal, so look at preceding
> year's figures?
>
> One can get quite carried away with the possibilities here :-)
>
Part description is a 30 or 40 byte string.
The data field is not a key.
From how I understand things, this would be used when a customer
doesn't have specific part numbers. The web site would then present a
list of what's available based upon what was asked for, ie; a gasket.
I'm guessing that then it's the customer's job to select from the list
presented. Web site is not my problem. Coming up with how to supply
them with what they ask for is my responsibility.
The request has never come up before. Never seemed to be a problem.
I'm a bit curious now, as the GUI software that presents a parts
explosion for some product, say a lawn mower, always seemed to be adequate.
More information about the Info-vax
mailing list