1. <td id="wjkjs"><strong id="wjkjs"><sup id="wjkjs"></sup></strong></td>
      <li id="wjkjs"><em id="wjkjs"></em></li>

        <optgroup id="wjkjs"><strong id="wjkjs"></strong></optgroup><input id="wjkjs"><ruby id="wjkjs"></ruby></input>

      1. <input id="wjkjs"></input><input id="wjkjs"><li id="wjkjs"><address id="wjkjs"></address></li></input>

        1. ECOS百科全書|高級搜索|RSS訂閱|加入收藏|服務中心|聯系我們歡迎您光臨!

          ECStore部署SPHINX-SEARCHD實戰教程

          來源:清風設計團隊 發布時間:2019-09-19 12:28 字體:【   點擊


          #參考資料

          b2b2c :https://jinjiajin.net/762.html #   

          ECSTore:http://ecos.phpwindow.com/append-c/sphinx-2.html 


          【注意以下內容以ecstore為主,至于b2b2c則有部分配置不同】


          #安裝re正則,分詞依賴

          yum install -y re2 re2-devel


          #安裝sphinx searchd軟件

          vi /etc/bashrc #添加# PATH=$PATH:/usr/local/sphinx/bin
          wget http://sphinxsearch.com/files/sphinx-2.2.10-release.tar.gz
          tar xzf sphinx-2.2.10-release.tar.gz && cd sphinx-2.2.10-release
          ./configure --prefix=/usr/local/sphinx --with-re2 --with-re2-libs=/usr/lib64/libre2.so CXXFLAGS="-std=c++11" # –with-mysql=/usr/local/mysql/
          vi src/Makefile #修改# LIBS = -lexpat -ldl -lm -lz  -L/usr/local/lib -lrt -liconv -lpthread
          make && make install


          # -- 由于scws只能單機部署,如果是集群則每臺機器都需要部署 -- # BEGIN

          #安裝scws中文分詞

          wget http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2
          tar xvf scws-1.2.3.tar.bz2 && cd scws-1.2.3
          ./configure --prefix=/usr/local/scws
          make && make install


          #安裝php的scws擴展

          cd scws-1.2.3/phpext/ && $(which phpize)
          ./configure --with-scws=/usr/local/scws --with-php-config=/usr/local/php/bin/php-config
          make && make install


          #配置php.ini末尾添加

          [scws]
          extension = scws.so
          scws.default.charset = utf8
          ;以下的的路徑就是編譯時的--with-scws的值
          scws.default.fpath = /usr/local/scws/


          #安裝scws的詞典

          cd /usr/local/scws/etc/
          wget http://www.xunsearch.com/scws/down/scws-dict-chs-gbk.tar.bz2
          wget http://www.xunsearch.com/scws/down/scws-dict-chs-utf8.tar.bz2
          tar xvjf scws-dict-chs-gbk.tar.bz2
          tar xvjf scws-dict-chs-utf8.tar.bz2
          chown root:root *.xdb

          # -- 由于scws只能單機部署,如果是集群則每臺機器都需要部署 -- # END


          #修改ecstore配置

          vi /home/wwwroot/xxx.com/config/config.php

          #反注釋以下(配置scws分詞)

          define('SCWS_DICT', 'xxx.xdb');
          define('SCWS_RULE', 'xxx.ini');

          #反注釋以下(指定sphinx searchd服務器)

          define('SPHINX_SERVER_HOST', 'xxx');
          define('SPHINX_PCONNECT', 1);

          #修改sphinx searchd配置

          vi /home/wwwroot/xxx.com/app/search/config/sphinx.conf

          修改三處地方:sql_host/sql_user/sql_pass/sql_db/sql_port

          修改log/query_log/pid_file路徑:/usr/local/sphinx/var/log/

          修改index的b2c_goods_merge/b2c_goods_delta/search_associate路徑:/usr/local/sphinx/var/data/

          cp /home/wwwroot/xxx.com/app/search/config/sphinx.conf /usr/local/sphinx/etc/sphinx.conf


          #測試sphinx searchd更新索引

          searchd && indexer --all --rotate

          #修改定時任務腳本配置

          vi /home/wwwroot/xxx.com/app/search/config/build_delta_index.sh
          vi /home/wwwroot/xxx.com/app/search/config/build_main_index.sh
          chmod +x /home/wwwroot/xxx.com/app/search/config/*.sh

          改完以上兩個文件的各三行配置后,分別運行一次(可能無法鎖定pid文件,增加sleep方法避免)


          #增加定時任務更新索引

          crontab -e
          30 2 * * * /home/wwwroot/xxx.com/app/search/config/build_delta_index.sh > /dev/null 2>&1 &
          * * * * * /usr/local/sphinx/bin/indexer b2c_goods_delta --config /usr/local/sphinx/etc/sphinx.conf --rotate & #商品增量索引
          * * * * * /usr/local/sphinx/bin/indexer search_associate --config /usr/local/sphinx/etc/sphinx.conf --rotate & #聯想詞索引更新


          ------分隔線--------

          關鍵詞:B2B2C,ecstore,sphinx,searchd,高級搜索,實戰教程

          轉載請保留:http://www.cechidyw.com/html/jszx/b2b2c/article-2854.html

          ------分隔線--------
          尚未注冊暢言帳號,請到后臺注冊
          国产精品 日韩 综合 图片_高清欧美AV亚洲AV_国产av在在线免费观看_日本特大黄色A片
          1. <td id="wjkjs"><strong id="wjkjs"><sup id="wjkjs"></sup></strong></td>
            <li id="wjkjs"><em id="wjkjs"></em></li>

              <optgroup id="wjkjs"><strong id="wjkjs"></strong></optgroup><input id="wjkjs"><ruby id="wjkjs"></ruby></input>

            1. <input id="wjkjs"></input><input id="wjkjs"><li id="wjkjs"><address id="wjkjs"></address></li></input>