1. 云栖社区>
  2. PHP教程>
  3. 正文

php连接coreseek

作者:用户 来源:互联网 时间:2017-12-01 18:19:42

php连接coreseek

php连接coreseek - 摘要: 本文讲的是php连接coreseek, <?phpinclude_once 'sphinxapi.php';$s = new SphinxClient();$s->setServer("localhost", 9312);$s->SetConnectTim






<?php
include_once 'sphinxapi.php';
$s = new SphinxClient();
$s->setServer("localhost", 9312);
$s->SetConnectTimeout ( 1 );//设置链接超时
$s->setMatchMode(SPH_MATCH_ANY);//匹配模式
$s->setMaxQueryTime(3);//查询超时
//$s->SetSelect ( $select );//设置返回的字段
/*
$cl->SetSelect ("*, @weight+(user_karma+ln(pageviews))*0.1 AS myweight");
$cl->SetSelect ("exp_years, salary_gbp*{$gbp_usd_rate} AS salary_usd,
IF(age>40,1,0) AS over40");
$cl->SetSelect ("*, AVG(price) AS avgprice");
*/
/*
$cl->SetGroupBy ("category", SPH_GROUPBY_ATTR,"@count desc");
$cl->SetGroupDistinct ("vendor");
==
SELECT id, weight, all-attributes,
COUNT(DISTINCT vendor) AS @distinct,
COUNT(*) AS @count
FROM products
GROUP BY category
ORDER BY @count DESC
*/
//$s->SetGroupBy ( $groupby, SPH_GROUPBY_ATTR, $groupsort );//汇总
//$s->SetGroupDistinct ( $distinct );//设置不重复字段
$s->SetArrayResult ( true );//结果是否有ID//$s->SetSortMode ( SPH_SORT_EXTENDED, $sortby );//排序模式//link
//$s->SetFilter ( 'target_type', array(1),true );$s->SetLimits ( 0, 10 );//显示数量:开始 量 最大量 右偏移量
$result = $s->query("good","team");//查询print_r($result);
 

以上是云栖社区小编为您精心准备的的内容,在云栖社区的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索php , 连接 coreseek ,以便于您获取更多的相关知识。