+
 新版

有没有人用过XunSearch? 求教一个问题.

Latsu 发布于 2012/05/25 17:15
阅读 2K+
收藏 0

现在我只能实现单条件搜索,不知道能不能多条件搜索呢?

	public function getShopRows($array = array()){
	    Yii::import('application.vendors.sdk.php.lib.XS');
	    $xs = new XS('shop');
	    
	    $query = "regionId:".$array['regionId'];
	    //return $query;exit;
	    $ShopDoc = $xs->search->setCharset('UTF-8')->setLimit(1000, 0)->search($query);//我现在想再search里传入数组,进行多字段的查询...不知道怎么实现呢?
	    $shopRows = array();
	    $fields = $xs->getAllFields();
	    foreach($ShopDoc as $doc)
	    {
	        $row = array();
	        foreach ($fields as $field)
	        {
	            $row[$field->name] = $doc->f($field);
	        }
	        $shopRows[] = $row;
	    }
	    return $shopRows;
	}

加载中
0
hightman
hightman
多个条件之间用空格或 AND 或 OR 连接就可以啊
0
Latsu
Latsu

->search($query AND xxx OR xxx) ?是这样吗? 能不能直接传数组呢?


0
严令令
多语言支持阿拉伯语吗?支持分布式搜索吗?正在研究是否用哪个搜索引擎希望能提供答案,谢谢!
严令令
找到了!
0
非良
非良
sphinx 这个挺不错的.
0
丰圣谋
丰圣谋

$keyword = $_GET['keys'] . " category:cookbook or category:food";

$this->so->query($keyword,$pgLen,$offer);

0
二师兄_dyj

请问多条件搜索 类似 type=1 and cate_id=1 这种条件怎么给

 

OSCHINA
登录后可查看更多优质内容
返回顶部
顶部