【发布时间】:2010-10-06 07:33:37
【问题描述】:
我正在研究http://code.google.com/p/django-fts/ 应用程序的工作原理。我正在尝试设置 psql FTS 以使用该应用程序,但无法理解如何正确创建索引。
不明白如何创建文档中指定的 GIN 索引。
我的模型如下:
class Product(fts.SearchableModel):
name = models.CharField(max_length = 1000)
description = models.TextField(blank = True)
在数据库中我有一个表 store_product
但是当我在我的 psql 中运行以下命令时,我有一个错误:
base=# CREATE INDEX "store_product_index" ON "store_product" USING gin("name");
ERROR: data type character varying has no default operator class for access method "gin"
HINT: You must specify an operator class for the index or define a default operator class for the data type.
你能帮我理解这里有什么问题吗?
【问题讨论】:
标签: django postgresql full-text-search