Add options to control term_search_key+term_weight use

Authored by Lucas_Werkmeister_WMDE on Mar 12 2018, 6:57 PM.


Add options to control term_search_key+term_weight use

Two new settings common to repository and client are added:
useTermsTableSearchFields (internally abbreviated to useSearchFields)
controls whether TermSqlIndex reads and writes the term_search_key and
term_weight fields, and forceWriteTermsTableSearchFields (internally
abbreviated to forceWriteSearchFields) overrides just the writing part
of useTermsTableSearchFields, so that you can try disabling reading the
search fields without having missing information in the database if you
need to re-enable it.

If term_search_key is not used and TermSqlIndex is still used for
searching, it uses the term_text field instead, which leads to
suboptimal results because that field is not normalized. Wikibase will
warn about this situation in case of wbsearchentities (you should only
use this option if Cirrus is used); for other uses of TermSqlIndex which
don’t have a Cirrus alternative (yet) – term conflict detection and
property lookup by label – the suboptimal results are deemed acceptable.

Bug: T188993
Change-Id: I354f4d352a9ebd4bc0fc0b28c172b409b3cbef45