【发布时间】:2012-05-15 07:20:23
【问题描述】:
我们正在我们的架构中部署 RT 索引。但是我们需要一些澄清和部署过程中遇到的一些困难。
在索引中定义的架构:
index logtable
{
type = rt
path = /usr/local/sphinx20/var/data/logtable
rt_attr_string = TransactionId
rt_attr_uint = CustomerId
rt_attr_timestamp = DateOfTransaction
rt_attr_string = CustomerFeedback
rt_field = TransactionType
}
面临的问题
问题 1: 我们如何在 SPHINXQL 中获取 count() 查询结果。因为它对我们很重要,所以根据客户数量,我们必须将其显示在我们的应用程序中。
下面的例子,
Query - select count(*) from logtable where CustomerId='871';
在 SphinxQL 中 - 我们没有得到这个结果并得到以下错误。ERROR 1064 (42000): index logtable: invalid schema: Count(*) or @count is queried, but not available in the schema.
问题 2: 我在 conf 中为“TransactionId”字段声明为 STRING 属性,但如果该字段在 where 条件下使用,我无法检索记录。
Example below,
select * from logtable where TransactionId='TRA23454';
我收到以下错误, ERROR 1064 (42000): sphinxql: 语法错误,意外 $undefined,在 '"TRA23454"' 附近需要 CONST_INT 或 CONST_FLOAT 或 '-'
如果知道,请帮助我们关闭这些问题。
库马兰
【问题讨论】:
标签: php open-source full-text-search sphinx