Stop using _type (Elastic 6.0 support)
AcceptedPublic

Authored by mmodell on Sep 4 2018, 10:00 AM.

Details

Maniphest Tasks
T181393: Make sure elasticsearch 6 is supported in phabricator
Reviewers
Paladox
EBernhardson
Commits
rPHAB0c864b875f67: Stop using _type (Elastic 6.0 support)
Patch without arc
git checkout -b D1109 && curl -L https://phabricator.wikimedia.org/D1109?download=true | git apply
Summary

Elasticsearch 6 doesn't support multiple types per index. Instead use
a docType field for the same purpose.

Test Plan

set elastic version to 6 in phabricator's search cluster config,
then reindex everything.

Diff Detail

Repository
rPHAB Phabricator
Branch
wmf/stable
Lint
Lint OK
Unit
Unit Tests OK
Build Status
Buildable 3112
Build 5201: arc lint + arc unit
mmodell requested review of this revision.Sep 4 2018, 10:00 AM
mmodell created this revision.
Paladox accepted this revision.Sep 4 2018, 10:22 AM

LGTM although i haven't tested it.

This revision is now accepted and ready to land.Sep 4 2018, 10:22 AM
mmodell added inline comments.Sep 4 2018, 11:19 AM
src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
158

add a new query clause for the type

265

stop using the types in the query url

368–420

instead of creating a bunch of mapping types, create just one, named _doc

I'm not sure how to test the change, but conceptually everything in here makes sense for handling the conversion to a docType field.

Thanks, @EBernhardson. I will test it thoroughly before merging. I mainly wanted your eyes on it to be sure I wasn't doing something dumb which tests ok but has a bad impact on our elasticsearch nodes.