﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-编程自动化-随笔分类-ubuntu 编程</title><link>http://www.cppblog.com/AutomateProgram/category/13049.html</link><description>当音乐和传说在深夜中沉寂后，程序的每个字符还在跳动！</description><language>zh-cn</language><lastBuildDate>Tue, 24 May 2011 15:28:39 GMT</lastBuildDate><pubDate>Tue, 24 May 2011 15:28:39 GMT</pubDate><ttl>60</ttl><item><title>CoreSeek介绍</title><link>http://www.cppblog.com/AutomateProgram/archive/2011/05/23/146969.html</link><dc:creator>漂漂</dc:creator><author>漂漂</author><pubDate>Mon, 23 May 2011 05:21:00 GMT</pubDate><guid>http://www.cppblog.com/AutomateProgram/archive/2011/05/23/146969.html</guid><wfw:comment>http://www.cppblog.com/AutomateProgram/comments/146969.html</wfw:comment><comments>http://www.cppblog.com/AutomateProgram/archive/2011/05/23/146969.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/AutomateProgram/comments/commentRss/146969.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/AutomateProgram/services/trackbacks/146969.html</trackback:ping><description><![CDATA[&nbsp; 
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Tahoma; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="color: rgb(255,0,0)">CoreSeek可以说是一个简单的搜索引擎，但是它并没有提供完整搜索引擎中重要的爬虫功能。CoreSeek提供中文全文索引/搜索，它基于Sphinx研发并独立发布，在中文搜索和信息处理领域有不错的表现。</span></span></div>
<div><br clear="none" /></div>
<div><span style="color: rgb(255,0,0)">coreseek主要有两个大的内容，1.中文分词LibMMSeg，2.全文索引/搜索<strong><a href="http://www.coreseek.cn/index.php?page=Sphinx" shape="rect">Sphinx</a></strong></span></div>
<div><br clear="none" /></div>
<div><strong>ubuntu 下的主要安装和使用如下：</strong></div>
<div><strong>可参考：<a href="http://www.coreseek.cn/products-install/install_on_bsd_linux/" shape="rect">http://www.coreseek.cn/products-install/install_on_bsd_linux/</a></strong></div>
<div><br clear="none" /></div>
<div><strong>安装ubuntu下需要的模块：</strong></div>
<div><pre style="font-weight: bold"><strong>coreseek安装需要预装的软件：</strong></pre><pre style="font-weight: bold"><strong>apt-get install make gcc g++ automake libtool mysql-client libmysqlclient15-dev   libxml2-dev libexpat1-dev</strong></pre><pre style="font-weight: bold"><strong><br clear="none" /></strong></pre><pre><span style="font-weight: 800">中文分词 LibMMSeg 安装：</span></pre><pre><span style="font-weight: 800"><br clear="none" /></span></pre><pre><span style="font-weight: 800"><br clear="none" /></span></pre><pre>##安装coreseek开发的mmseg，为coreseek提供中文分词功能
$ cd mmseg-3.2.14
##ubuntu环境下，需要使用ACLOCAL_FLAGS="-I /usr/share/aclocal" ./bootstrap
$ <strong>./bootstrap</strong>
$ ./configure --prefix=/usr/local/mmseg3
$ make &amp;&amp; make install
##如果提示libtool: unrecognized option `--tag=CC' ，请查看<a href="http://www.coreseek.cn/products-install/faq/#qa24" shape="rect" target="_blank">libtool问题解决方案</a>
##安装完成后，mmseg使用的词典和配置文件，将自动安装到/usr/local/mmseg3/etc中

##中文分词测试，如果显示不正常，请检查当前环境下的locale和UTF-8中文字符显示设置
$  /usr/local/mmseg3/bin/mmseg -d /usr/local/mmseg3/etc src/t1.txt
    中文/x 分/x 词/x 测试/x 
    中国人/x 上海市/x 

Word Splite took: 1 ms.
</pre><pre><br clear="none" /></pre></div>
<div><pre>##安装coreseek：
$ cd csft-3.2.14
##执行configure，进行编译配置：
$ <strong>sh buildconf.sh</strong>
$ ./configure --prefix=/usr/local/coreseek --without-python --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --without-mysql
$ make &amp;&amp; make install
</pre></div>
<div>支持mysql</div>
<div><pre>$ cd csft-3.2.14
$ make clean
$ ./configure --prefix=/usr/local/coreseek  --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-mysql
##<strong>以上configure参数请正确拷贝，不要遗漏或者随意修改</strong>
$ make &amp;&amp; make install
</pre></div>
<div><span style="color: rgb(255,0,0)">现在两部分已经安装成功了，接下来测试一下是否安装成功。</span></div>
<div><br clear="none" /></div>
<div><pre>##<span>三、coreseek中文全文检索测试</span>

$ cd testpack
$  /usr/local/coreseek/bin/indexer -c etc/csft.conf
##以下为正常情况下的提示信息：
    Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]
    Copyright (c) 2007-2010,
    Beijing Choice Software Technologies Inc (http://www.coreseek.com)

     using config file 'etc/csft.conf'...
    total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
    total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
##
##csft-4.0版显示：ERROR: nothing to do.
##
$  /usr/local/coreseek/bin/indexer -c etc/csft.conf --all
##以下为正常索引全部数据时的提示信息：（csft-4.0版类似）
    Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]
    Copyright (c) 2007-2010,
    Beijing Choice Software Technologies Inc (http://www.coreseek.com)

     using config file 'etc/csft.conf'...
    indexing index 'xml'...
    collected 3 docs, 0.0 MB
    sorted 0.0 Mhits, 100.0% done
    total 3 docs, 7585 bytes
    total 0.075 sec, 101043 bytes/sec, 39.96 docs/sec
    total 2 reads, 0.000 sec, 5.6 kb/call avg, 0.0 msec/call avg
    total 7 writes, 0.000 sec, 3.9 kb/call avg, 0.0 msec/call avg

$  /usr/local/coreseek/bin/indexer -c etc/csft.conf xml
##以下为正常索引指定数据时的提示信息：（csft-4.0版类似）
    Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]
    Copyright (c) 2007-2010,
    Beijing Choice Software Technologies Inc (http://www.coreseek.com)

     using config file 'etc/csft.conf'...
    indexing index 'xml'...
    collected 3 docs, 0.0 MB
    sorted 0.0 Mhits, 100.0% done
    total 3 docs, 7585 bytes
    total 0.069 sec, 109614 bytes/sec, 43.35 docs/sec
    total 2 reads, 0.000 sec, 5.6 kb/call avg, 0.0 msec/call avg
    total 7 writes, 0.000 sec, 3.9 kb/call avg, 0.0 msec/call avg

$  /usr/local/coreseek/bin/search -c etc/csft.conf
##以下为正常测试搜索时的提示信息：（csft-4.0版类似）
    Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]
    Copyright (c) 2007-2010,
    Beijing Choice Software Technologies Inc (http://www.coreseek.com)

     using config file 'etc/csft.conf'...
    index 'xml': query '': returned 3 matches of 3 total in 0.093 sec

    displaying matches:
    1. document=1, weight=1, published=Thu Apr  1 22:20:07 2010, author_id=1
    2. document=2, weight=1, published=Thu Apr  1 23:25:48 2010, author_id=1
    3. document=3, weight=1, published=Thu Apr  1 12:01:00 2010, author_id=2

    words:


$  /usr/local/coreseek/bin/search -c etc/csft.conf -a Twittter和Opera都提供了搜索服务
##以下为正常测试搜索关键词时的提示信息：（csft-4.0版类似）
    Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]
    Copyright (c) 2007-2010,
    Beijing Choice Software Technologies Inc (http://www.coreseek.com)

     using config file 'etc/csft.conf'...
    index 'xml': query 'Twittter和Opera都提供了搜索服务 ': returned 3 matches of 3 total in 0.038 sec

    displaying matches:
    1. document=3, weight=24, published=Thu Apr  1 12:01:00 2010, author_id=2
    2. document=1, weight=4, published=Thu Apr  1 22:20:07 2010, author_id=1
    3. document=2, weight=3, published=Thu Apr  1 23:25:48 2010, author_id=1

    words:
    1. 'twittter': 1 documents, 3 hits
    2. '和': 3 documents, 15 hits
    3. 'opera': 1 documents, 25 hits
    4. '都': 2 documents, 4 hits
    5. '提供': 0 documents, 0 hits
    6. '了': 3 documents, 18 hits
    7. '搜索': 2 documents, 5 hits
    8. '服务': 1 documents, 1 hits

$  /usr/local/coreseek/bin/searchd -c etc/csft.conf
##以下为正常开启搜索服务时的提示信息：（csft-4.0版类似）
    Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]
    Copyright (c) 2007-2010,
    Beijing Choice Software Technologies Inc (http://www.coreseek.com)

    using config file 'etc/csft.conf'...
    listening on all interfaces, port=9312
##如要停止搜索服务，请使用/usr/local/coreseek/bin/searchd -c etc/csft.conf --stop
##如要已启动服务，要更新索引，请使用/usr/local/coreseek/bin/indexer -c etc/csft.conf --all --rotate

##然后，请参考csft-3.2.14下api目录中的相关文件，使用PHP、Python、Ruby、Java来测试搜索服务；也可以前往&lt; ahref="/products-install/step_by_step/"&gt;搜索服务建立三步曲，查看第三步使用PHP测试。

##四、继续
##通过以上步骤，coreseek已经安装测试完成，可以提供正常的xml数据源索引以及提供对应的搜索服务了
##下一步工作，请查看手册，准备好mysql数据信息，以及进行mysql数据源的测试，并在您的应用中调用搜索服务；mysql数据源的配置可参考testpack/etc/csft_mysql.conf文件
</pre></div>
<div><br clear="none" /></div>
<div><span style="color: rgb(255,0,0)">这里要说明一下，coreseek支持两种格式的搜索，可以搜索xml和mysql，上面测试的是使用xml。</span></div>
<div><br clear="none" /></div>
<div><span style="color: rgb(255,0,0)">coreseek使用.csft来设置是那种搜索方式和搜索的一些配置信息，如mysql的数据库和地址等。</span></div>
<div><span style="color: rgb(255,0,0)"><br clear="none" /></span></div>
<div><span style="color: rgb(255,0,0)">/usr/local/coreseek/binindexer -c etc/csft.conf --all</span></div>
<div>是先为搜索引擎建立起索引得过程。</div>
<div><pre>/usr/local/coreseek/bin/search -c etc/csft.conf -a Twittter和Opera都提供了搜索服务
</pre>则是在文档中搜索 <pre> Twittter和Opera都提供了搜索服务
</pre><pre>的内容。
</pre></div>
<div><pre><span style="color: rgb(255,0,0)">这样命令端的搜索搜索就可以简单的建立了。</span></pre></div><img src ="http://www.cppblog.com/AutomateProgram/aggbug/146969.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/AutomateProgram/" target="_blank">漂漂</a> 2011-05-23 13:21 <a href="http://www.cppblog.com/AutomateProgram/archive/2011/05/23/146969.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>QT Creator 下编译 openGL</title><link>http://www.cppblog.com/AutomateProgram/archive/2010/02/07/107448.html</link><dc:creator>漂漂</dc:creator><author>漂漂</author><pubDate>Sun, 07 Feb 2010 12:16:00 GMT</pubDate><guid>http://www.cppblog.com/AutomateProgram/archive/2010/02/07/107448.html</guid><wfw:comment>http://www.cppblog.com/AutomateProgram/comments/107448.html</wfw:comment><comments>http://www.cppblog.com/AutomateProgram/archive/2010/02/07/107448.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/AutomateProgram/comments/commentRss/107448.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/AutomateProgram/services/trackbacks/107448.html</trackback:ping><description><![CDATA[使用诺基亚的qt Creator 编译openGL的工程需要下载openGL<br>sudo apt-get install freegult3-dev<br>进行openGL的安装。<br><br>
<img src ="http://www.cppblog.com/AutomateProgram/aggbug/107448.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/AutomateProgram/" target="_blank">漂漂</a> 2010-02-07 20:16 <a href="http://www.cppblog.com/AutomateProgram/archive/2010/02/07/107448.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>