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
F15453767: D18500.diff
Sat, Mar 29, 2:12 PM
F15440237: D18500.id44446.diff
Wed, Mar 26, 11:34 AM
F15439746: D18500.id44432.diff
Wed, Mar 26, 9:11 AM
F15439290: D18500.id.diff
Wed, Mar 26, 6:48 AM
F15431021: D18500.diff
Mon, Mar 24, 10:08 AM
F15417206: D18500.diff
Thu, Mar 20, 4:00 PM
F15408423: D18500.id44446.diff
Tue, Mar 18, 10:55 PM
F15285468: D18500.id44432.diff
Mar 4 2025, 1:52 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.