search.php 573 B

123456789101112131415
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: chendeben
  5. * Date: 2017/12/6
  6. * Time: 11:18
  7. */
  8. require 'sphinxapi.php';
  9. $s=new SphinxClient();
  10. $s->SetServer("s5.97admin.com",9312);
  11. $s->SetLimits ( 0, 30, 1000, 0 ); //设置结果集偏移量 SetLimits (便宜量,匹配项数目,查询的结果集数默认1000,阀值达到后停止)
  12. //$s->SetFilter ( $attribute, $values, $exclude=false ); //设置属性过滤
  13. //$s->SetGroupBy ( $attribute, $func, $groupsort="@group desc" ); //设置分组的属性
  14. $res = $s->query('母女');
  15. $ids=array_keys($res['matches']);