[Answered ]-Haystack + solr duplicate on update

2👍

So this one was tricky to track down, but the problem was actually in my index_queryset function.

This:

return self.get_model().objects.filter(specialty__search_include=True)

should actually be this:

return self.get_model().objects.filter(specialty__search_include=True).distinct()

That function had duplicates in it and was causing my error, not the solr schema like I had thought. Specialty is a ManyToManyField.

0👍

I just faced the same issue.
According to this topic it is necessary to remove .pyc files. Inside of a project simply do the next (for Linux):

find . -name "*.pyc" -type f -delete

Leave a comment