Fix search indexing with Whoosh 2.7.
Review Request #7354 — Created May 28, 2015 and submitted — Latest diff uploaded
Our search index tried to store a user's group membership using a MultiValueField. There's nothing in the Haystack docs that indicates that we can't do this, and in fact, it's totally fine to do this -- IF the field is meant to be indexed and not just stored along with the rest of the data. However, if you turn off indexing, it's only allowed to be a list of numeric IDs, for some reason. At least, that's the case with Whoosh. Previously, Whoosh didn't seem to mind this, but as of Whoosh 2.7, it gets very upset. So instead, we're now storing as a CharField, flattening the list into a string, and splitting again in the template. This mimics what Haystack was already doing, but in a way that should work everywhere.
Successfully indexed and searched using Whoosh 2.5 and Whoosh 2.7.
Unit tests pass on both.