mozilla/kitsune — pull request #1552 by mythmon (2013-08-08 22:08:16+00:00)
Title: Fix highlighting 900869

This fixes problems with highlighting in non-English languages. The problem is that if 'term_vector': 'with_positions_offsets' is not set, the field is reanalyzed for highlighting ,and that reanalysis (apparently) did not take into account the locale specific analyzer. Using position offsets skips the reanalysis of the field, so it keeps the correct information from stemming and stop words.

To test:
* Search in French for "chargeant". Documents will match, but no highlighting will happen.
* Search in French for "ne firefox". "ne" will be highlight, but it should not be.
* Reindex. I used `./manage.py esreindex --mapping_types=wiki_document --delete`.
* Repeat the first search. There should be highlights.
* Repeat the second search. "ne" should not be highlighted.

This is a mapping change, even though there are no code changes, so the two step process is needed so we can safely do a re-index.

r?

This PR was originally created as a clone of the ill-born #1551.