Page MenuHomePhabricator

Provide some "term vs substring" support for the Ferret engine
ClosedPublic

Authored by epriestley on Aug 30 2017, 4:29 PM.
Tags
None
Referenced Files
F13061040: D18500.diff
Fri, Apr 19, 6:47 PM
Unknown Object (File)
Thu, Apr 11, 8:05 AM
Unknown Object (File)
Fri, Apr 5, 9:48 PM
Unknown Object (File)
Mar 15 2024, 12:56 AM
Unknown Object (File)
Feb 3 2024, 4:35 PM
Unknown Object (File)
Jan 13 2024, 5:37 AM
Unknown Object (File)
Jan 7 2024, 4:25 PM
Unknown Object (File)
Jan 3 2024, 7:02 PM
Subscribers
None

Details

Summary

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).
Test Plan

Ran searches similar to the above, they seemed to do what they should.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The code is pretty hacks-upon-hacks, but I'm still not really sure if this is a viable pathway forward or not so I'm trying to get it all working before I clean it up. Stuff I still have to do:

  • Make title: work (search only the title field).
  • Make dog -blue (negated terms) work.

Then we can bang on it a bit and see if it falls over. If it seems like it's going to hold, I'll clean things up a bit so the code, e.g., isn't adding random spaces to things for no apparent reason in 50 different places (the spaces are "magic").

I believe this is the right path forward, though the road may be bumpy.

This revision is now accepted and ready to land.Aug 30 2017, 4:40 PM
This revision was automatically updated to reflect the committed changes.