Close
dtSearch Text Retrieval Engine Programmer's Reference
Fuzzy Searching

Fuzzy searching will find a word even if it is misspelled.

For example, a fuzzy search for apple will find appple. Fuzzy searching can be useful when you are searching text that may contain typographical errors, or for text that has been scanned using optical character recognition (OCR). There are two ways to add fuzziness to searches: 

1. Set the dtsSearchFuzzy search flag to enable fuzzy searching for all of the words in your search request. You can adjust the level of fuzziness from 1 to 10. The higher the level of fuzziness, the more differences dtSearch will permit when matching words, and the closer these differences can be to the start of the word. 

2. Add fuzziness selectively using the % character. The number of % characters you add determines the number of differences dtSearch will ignore when searching for a word. The position of the % characters determines how many letters at the start of the word have to match exactly. Examples: 

ba%nana Word must begin with ba and have at most one difference between it and banana. 

b%%anana Word must begin with b and have at most two differences between it and banana.