Combine trigram with ranked searching in django 1.10
<p>We working with searching in django 1.10 and we need user ranked searching with trigram searching.</p>

<p>Our code is this:</p>

<pre><code>def get_queryset(self):
        search = self.request.GET.get('text', '')
        vector = SearchVector('name',weight='A',
            config=settings.SEARCH_LANGS[
                settings.LANGUAGE
            ],
            ) + SearchVector(
            'content',
            weight='B',
            config=settings.SEARCH_LANGS[
                settings.LANGUAGE
            ],
            )
        query = SearchQuery(search)
        return Article.objects.annotate(
            rank=SearchRank(
                vector,
                query
                ),
            similarity=TrigramSimilarity(
                'name', search
                ) + TrigramSimilarity(
                'content', search
                ),
            ).filter(
            rank__gte=0.3
            ).filter(
            similarity__gt=0.3
            ).order_by(
            '-similarity'
            )[:20]
</code></pre>

<p>But this code doesn't  return any query, without use trigram we haven problems, but, combined between they we can't get a query.</p>

<p>How can we combine trigram and ranked searching in django 1.10?</p>