Ref T12819. Distinguishes between "term" queries and "substring" queries, and tries to match them correctly most of the time. For example:
- example matches "example", obviously.
- ~amp matches "example", but amp does not.
- examples matches "example" through stemming.
- "examples" does not match "example" (quoted text does not stem).
- "an examp" does not match "an example" (quoted text is still term text).
- ~"an examp" matches "an example" (quoted, substring-operator text uses substring search).