djangosnippets.org: Latest snippets tagged with 'fulltext'http://djangosnippets.org/tags/fulltext/2010-08-15T10:37:13.874601-05:00PostgreSQL fulltext with language translations
2010-08-15T10:37:13.874601-05:00divermanhttp://djangosnippets.org/snippets/2148/<p>Consider following models:
</p>
<pre><code>class Product(models.Model):
code = modeld.CharField()
class ProductTrans(models.Model):
product = models.ForeignKey('Product')
language = models.ChoiceField(choices=settings.LANGUAGES)
title = models.ChaField()
description = models.ChaField()
</code></pre><p>With this snippet is possible search through all translations of product at the same time (using string concatenation in trigger):
</p>
<pre><code>Product.objects.extra(
where = ['product_product.fulltext @@ to_tsquery(%s)'],
params = …</code></pre>
Freely redistributableSearchable Media
2008-03-21T15:51:14.459346-05:00nikolajhttp://djangosnippets.org/snippets/652/<p>This app allows you to utilize mysql's fulltext searching over multiple models and multiple apps, letting the site search seem more intuitive, yet still allow your content to be very structured. Essentially, it creates an entire new model that associates objects to a chunk of text to search efficiently over …</p>
Freely redistributable