如何从 sphinx RT 索引中获取字符串字段
How to get string fields from sphinx RT index
无法从下面table,
获取标题字段
RT 结构有以下字段,
id, gid, title
但是当运行下面的查询无法获取title字段时,
SELECT * FROM rt WHERE MATCH('test');
+------+--------+------+
| id | weight | gid |
+------+--------+------+
| 1 | 1643 | 123 |
| 2 | 1643 | 234 |
+------+--------+------+
如何从 rt 索引中获取标题字段?
提前致谢,
你无法 field
s 出来。字段已编入索引,但未存储。
你只能得到 attribute
s。可以使 title
同时成为 field
和 attribute
。
rt_field = title
rt_attr_string = title
然后就可以插入进去了...
INSERT INTO rt ( id, title ) VALUES ( 3, 'third row' ), ( 4, 'fourth entry' );
两者都会使用它。
无法从下面table,
获取标题字段RT 结构有以下字段,
id, gid, title
但是当运行下面的查询无法获取title字段时,
SELECT * FROM rt WHERE MATCH('test');
+------+--------+------+
| id | weight | gid |
+------+--------+------+
| 1 | 1643 | 123 |
| 2 | 1643 | 234 |
+------+--------+------+
如何从 rt 索引中获取标题字段?
提前致谢,
你无法 field
s 出来。字段已编入索引,但未存储。
你只能得到 attribute
s。可以使 title
同时成为 field
和 attribute
。
rt_field = title
rt_attr_string = title
然后就可以插入进去了...
INSERT INTO rt ( id, title ) VALUES ( 3, 'third row' ), ( 4, 'fourth entry' );
两者都会使用它。