请看sql_field_string的文档说明:

    # combined field plus attribute declaration (from a single column)
# stores column as an attribute, but also indexes it as a full-text field
#
# sql_field_string = author

我们不需要attribute属性,不用管。只要在sql_query中选出相应的column就行了,就可以在php中使用extended_query_mode来进行query了,相应的域名就是列的名字。请看如下的conf文件:

    sql_query        = \
SELECT bid, review_count, stars, name, full_address, categories \
FROM busi_info sql_attr_uint = review_count
sql_attr_uint = stars

在php中搜索的时候,php文件如下:

<?php
ini_set('memory_limit', '-1');
ini_set('max_execution_time', '100');
include 'sphinxapi.php'; $sc= new SphinxClient();
$sc->setServer('localhost', 9312);
$sc->setRankingMode(SPH_RANK_NONE);
$sc->SetLimits(0,73180000,1000000); $sc->SetMatchMode(SPH_MATCH_EXTENDED2);
$res = $sc->query('@categories Travel', 'idx_busi');
$ids = array_keys($res['matches']);
print_r($ids); ?>

这样就行啦!只要用“@域名 query”这种格式就好了。

最新文章

  1. [转] STM32各种时钟的区别
  2. 移动开发可能用到的css单位
  3. Python Day9
  4. 转!! PreparedStatement是如何防止SQL注入的
  5. Error Domain=ASIHTTPRequestErrorDomain Code=8 &quot;Failed to move file from&quot;xxx/xxx&quot;to&quot;xxx/xxx&quot;
  6. 从Hadoop Summit 2016看大数据行业与Hadoop的发展
  7. JVM_Bind:8080 的解决办法【131031】
  8. js弹窗
  9. easyui源码翻译1.32--DateBox(日期输入框)
  10. HttpClient4.4 进行Http连接通讯
  11. HDU_2058——等差数列,子集,集合长度判断
  12. 《SAS编程和数据挖掘商业案例》第14部分学习笔记
  13. 有人实践过 Phabricator 以及 Arcanist 作为 code review 的工具么?(转)
  14. Git 开发新的功能分支
  15. 启动Eclipse时An internal error occurred during: &quot;Initializing Java Tooling&quot;.错误
  16. 动态规划-最长上升子序列(LIS)
  17. tensorflow 的数据管理
  18. 13. The Impact of New Technology on Business 新科技对商务的影响
  19. linux系统安全审计简单设置
  20. Codeforces Round #530 Div. 1 自闭记

热门文章

  1. 复用TCP连接提升流媒体服务器之间流量转发效率
  2. 十一、oracle 数据库管理员
  3. Load$$ execution region symbols
  4. 复习TextView(查漏补缺)
  5. SQLServer 错误: 15404,无法获取有关 Windows NT 组 用户
  6. 《JS权威指南学习总结--第三章类型、值和变量》
  7. PHP 5 数据类型
  8. hdu_5794_A Simple Chess(lucas+dp)
  9. nefu 519 昨日重现
  10. 第4章 流程控制----编写Java程序,使用while循环语句计算1+1/2!+1/3!+...+1/20!之和