sphinx 返回多个字段?
Array
(
[error] =>
[warning] =>
[status] => 0
[fields] => Array
(
[0] => name
)
[attrs] => Array
(
)
[matches] => Array
(
[0] => Array
(
[id] => 1
[weight] => 1
[attrs] => Array
(
)
)
)
[total] => 1
[total_found] => 1
[time] => 0
[words] => Array
(
[zhangsan] => Array
(
[docs] => 1
[hits] => 1
)
)
)
matches 里面只有ID ,能返回name字段吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先你的索引源里边要有显示的字段sql_field_string,然后matches数组里边看array要大于0 才等于搜到里数据,在打印数组的matches 就出来了。
![clipboard.png clipboard.png](https://www.wenjiangs.com/wp-content/uploads/stackoverflow/202211/1664952786138.png)