views:

20

answers:

0

I am using Django, haystack, solr, to do searching. Ive am able to search and now I would like to find similar items using more_like_this. When I try to use the more_like_this functionality I get back all of the objects that are of that model type instead of just the ones that closely match it. Here is some code to show you how I am using it:

def resource_view(request, slug):
    resource = Resource.objects.get(slug=slug)
    versions = Version.objects.get_for_object(resource)
    related = SearchQuerySet().more_like_this(resource)
    add_comment_form = AddCommentForm()
    return render_to_response('resources/resource.html',
                              {'resource': resource,
                               'versions': versions,
                               'related': related,
                               'add_comment_form': add_comment_form},
                              context_instance=RequestContext(request))

Apparently I need to enable mlt in the solrconfig.xml file. Anyone know how to do this, or an article/tutorial that is helpful?