1
我正在研究http://code.google.com/p/django-fts/应用程序的工作方式。我试图设置psql FTS来处理应用程序,但无法理解如何正确创建索引。django-fts:如何为psql创建索引
不明白如何创建GIN索引,因为它是在doc中指定的。
我的模型如下:
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.
你能帮我理解这里有什么问题吗?
感谢您的回答。它给了我一个错误: – 2010-10-06 12:26:51
db =#CREATE INDEX“store_product_index”ON“store_product”使用杜松子酒(to_tsvector('english',name)); 错误:函数to_tsvector(“未知”,字符变化)不存在 线1:... tore_product_index“ON”store_product“使用杜松子酒(to_tsvecto ... ^ 提示:没有函数匹配给定的名称和参数类型你可能需要添加明确的类型转换 – 2010-10-06 12:27:15
你使用的是什么版本的PostgreSQL?你确定你是一个内置的全文搜索的吗?如果没有,你需要安装tsearch模块... – 2010-10-07 17:15:44