mozilla/kitsune — pull request #1924 by mythmon (2014-04-25 18:36:09+00:00)
Title: [bug 999589] Synonyms!

This adds

* A model for synonyms
* A bulk editor for the same
* Machinery to sync from the DB into ES analyzers.
* The concept of a normal analyzer and a synonym analyzer. For example, now we have `snowball-english` and `snowball-english-synonyms`. It's nice.
* Updates the search code to use the right analyzers for the right situtations.
* Added some tests for things that were previously untested. :ghost:.

To test:

I made a second database for this, and started with `./manage.py generate data`. Then I deleted all the documents that made, and made a few by hand. I chose "awesome bar frob", "location bar gunk", and "address bar gork" as my test documents. Then I did `./manage.py esreindex --delete`. This was a lot easier to test with than a full DB, and faster to re-index.

After that, I did some searches, to make sure that it acted the way I expected. Then I used the synonym editor in the admin to add some synonyms. I used "frob => gunk" and "awesome bar, location bar, address bar => awesome bar, location bar, address bar" for my final test. Occasionally I got stale results. Usually I fixed this by clearing memcache and trying again.

I also rolled back to master, reindexed my three documents, then checked out my branch again, to see how ES would react. The answer was it was unhappy, because it could not find the analyzers expected. Once I pressed the "Sync synonyms to ES" button, it got happy again (because that created the new analyzers).

Questions:

* Does the wall of help text I wrote in the editor make sense?
* Does the flow of how to edit synonyms work? Is it clear what to do?

r?