Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text Search with Wild Cards
Message
From
14/07/2003 21:44:56
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
14/07/2003 20:56:54
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00809908
Message ID:
00810061
Views:
15
>Yes, I have used individual word DBFs and indexes in other contexts and it works great -- if you know the whole word you want. Unfortunately, given the constraint about leading characters, that won't work in this case.

Well, suppose you want to index a field that contains the text:

"The quick brown fox jumps over the lazy dog"

you could include a special table that has the following texts (with pointers to the original record):
The quick 
he quick b
e quick br
 quick bro
...
This would allow you to search any part of the string, and do so quickly. Saving only the first 10 charaters (or any other number you choose) would keep the table to a reasonable size - or try to do so! This your special table might still be several times the original table.

Once there is a match (within the 10 characters searched), you can examine the record to see whether the remainder of the expression searched also matches (if the text searched has more than 10 characters).

Quite complicated, but I really see no alternative in VFP - a fast search requires the corresponding index.

Before you even start, do some initial calculations, to see whether you will not surpass the 2 GB limit per table (and practical limits of disk storage).

Regards,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform