>Recently I came across a requirement of a client where i have to search for a string or group of words in memo from the table consisting of 33,000 records and each record has a memo of
>minimum 50 lines.
The fastest way I have found to do ad-hoc searches of memo fields is simply:
Set order to 0
Scan for cSearchString $ MemoField
EndScan
If the search needs to be case-insensitive:
cSearchString = Upper(cSearchString)
Scan for cSearchString $ Upper(MemoField)
If you have the disk space, you can replicate the memo field as an all-uppercase clone and search on this. It will speed things up just a bit by avoiding the UPPER() function.
Memo searches go quite a bit faster if your memo file is nice and compact (i.e., not many deleted memos). There are commands available to clean up and compact a memo file. You can also speed things up a bit by using an optimized BlockSize. Read about this in help. The Memo file has to be created with your desired BlockSize in order for the value to have any effect.
If you need instantaneous response time, consider PHdBase.