Sphinx 2.0.8 发布,全文搜索引擎 Installing Sphinx on Windows
参考资料地址信息
http://sphinxsearch.com/docs/latest/installing-windows.html
http://my.oschina.net/melonol/blog/127438
http://www.sphinxsearch.org/sphinx-tutorial
http://www.cnblogs.com/ainiaa/archive/2010/12/21/1912459.html
1.下载Sphinx地址包
http://sphinxsearch.com/downloads/release/
2.在解压到指定目录文件夹下如:D:/php/sphinx
3.修改配置文件信息 D:\php\sphinx\sphinx.conf.in
具体修改可以参考 http://my.oschina.net/melonol/blog/127438 配置信息说明
http://www.cnblogs.com/ainiaa/archive/2010/12/21/1912459.html
等配置信息设置好,创建索引信息
D:\php\sphinx\bin>indexer.exe --all
安装服务(如果配置没有问题,服务是可以正常启动的)
D:\php\sphinx\bin\searchd --install --config D:\php\sphinx\bin\sphinx.conf --servicename SphinxSearch
yii框架查询样例
$searchQuery = new \yii\sphinx\Query; $ids = []; foreach ($searchQuery->from('index_name')->match(new \yii\db\Expression(':match', ['match' => '@(data) ' . $keywords . ' @(datatype) type_' . SEARCH_Type]))->all() as $search) { $ids[] = $search['itemid']; }
待续....