Page MenuHomePhabricator

Filter search input that innodb doesn't like
ClosedPublic

Authored by mmodell on Oct 13 2016, 10:49 PM.

Details

Summary

Searches such as '--word' or "+word +" cause errors from
the innodb fulltext engine. This filters search terms and
also prefers exact phrase matches over separate word matches.

Test Plan

Ran a bunch of test queries against my local test
environment.

Diff Detail

Repository
rPHAB Phabricator
Branch
D414
Lint
Lint OK
Unit
Unit Tests Skipped
Build Status
Buildable 1160
Build 1713: differential-jessieJenkins
Build 1712: arc lint + arc unit

Event Timeline

mmodell updated this revision to Diff 1101.Oct 13 2016, 10:49 PM
mmodell retitled this revision from to Filter search input that innodb doesn't like.
mmodell updated this object.
mmodell edited the test plan for this revision. (Show Details)
mmodell added reviewers: demon, thcipriani.
mmodell added a subscriber: jcrespo.
Paladox accepted this revision.Oct 13 2016, 10:54 PM
Paladox added a reviewer: Paladox.
Paladox added a subscriber: Paladox.

Oh yes, innodb has limitations and does support double -- or double ++, but in myisam this wasent supported but silently ignored it.

This revision is now accepted and ready to land.Oct 13 2016, 10:54 PM
mmodell updated this revision to Diff 1103.Oct 13 2016, 11:21 PM
mmodell edited edge metadata.

Add word stemming

Paladox added inline comments.Oct 14 2016, 12:58 AM
src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
191

Should this be

$stemmed_query = preg_replace('/\+\+|\-\-|\+\-|\-\+/', '', $q);

since below was changed to $stemmed_query

hashar resigned from this revision.Oct 14 2016, 7:45 AM
hashar removed a reviewer: hashar.

@mmodell could you land this please? To test?

mmodell updated this revision to Diff 1113.Oct 19 2016, 8:06 PM

Don't do stemming.

@mmodell oh didn't stemming work?

mmodell closed this revision.Nov 15 2016, 9:54 PM