当前位置: 首页 > news >正文

2013 中国网站建设市场 pdf网站seo推广

2013 中国网站建设市场 pdf,网站seo推广,搭建网站什么意思,电商平台投诉找哪个部门目标: 一、搭建准确的千万级数据库的准实时搜索(见详情) 二、实现词语高亮(客户端JS渲染,服务器端渲染,详见7.3) 三、实现搜索联想(输入框onchange,ajax请求搜索,取10条在…

目标:
一、搭建准确的千万级数据库的准实时搜索(见详情)
二、实现词语高亮(客户端JS渲染,服务器端渲染,详见7.3)
三、实现搜索联想(输入框onchange,ajax请求搜索,取10条在层上展示方可)
四、实现词库管理(仅需管理scws下的自定义词库dd.txt即可)
五、实现全文搜索(提供了两种方案,详见8)

案例:
本文第五部分,针对实际应用场景,典型案例分析。

软件:
sphinx: sphinx-2.0.2-beta
scws: scws-1.2.0
===========================================================================

一、Sphinx安装
1、安装

# ./configure --prefix=/opt/server/sphinx --with-mysql=/opt/server/mysql # make # make install

1

2

3

# ./configure --prefix=/opt/server/sphinx --with-mysql=/opt/server/mysql

# make

# make install

2、配置
见sphinx.conf
详见下文,多索引增量索引方案

3、php 扩展
性能方面,扩展和直接使用API文件,差别不大;可以做选择;都在源码API中;
个人建议使用API文件,系统更稳定

3.1 sphinx客户端libsphinxclient

# ./configure --prefix=/opt/server/libsphinxclient # make # make install

1

2

3

# ./configure --prefix=/opt/server/libsphinxclient

# make

# make install

3.2 扩展
下载 http://pecl.php.net/package/sphinx

# /opt/server/php/bin/phpize./configure --with-sphinx=/opt/server/libsphinxclient --with-php-config=/opt/server/php/bin/php-config # make # make install 查看 # /opt/server/php/bin/php -m |grep sphinx

1

2

3

4

5

# /opt/server/php/bin/phpize./configure --with-sphinx=/opt/server/libsphinxclient --with-php-config=/opt/server/php/bin/php-config

# make

# make install

查看

# /opt/server/php/bin/php -m |grep sphinx

使用手册
http://docs.php.net/manual/zh/book.sphinx.php

4、索引 启动服务

# /opt/server/sphinx/bin/indexer --all # /opt/server/sphinx/bin/searchd

1

2

# /opt/server/sphinx/bin/indexer --all

# /opt/server/sphinx/bin/searchd

二、php 分词 scws
官网 http://www.ftphp.com/scws/
1、 安装

# ./configure --prefix=/opt/server/scws # make # make install

1

2

3

# ./configure --prefix=/opt/server/scws

# make

# make install

2、 词库
scws-dict-chs-utf8.tar.bz2 解压放入 /opt/server/scws/etc
词库 dict.utf-8.xdb
规则 rules.utf-8.ini

3、 php 扩展
源码在phpext下

# /opt/server/php/bin/phpize./configure --with-scws=/opt/server/scws --with-php-config=/opt/server/php/bin/php-config # make # make install

1

2

3

# /opt/server/php/bin/phpize./configure --with-scws=/opt/server/scws --with-php-config=/opt/server/php/bin/php-config

# make

# make install

# vi php.ini [scws] extension = scws.so scws.default.charset = utf-8 scws.default.fpath = /opt/server/scws/etc 查看 # /opt/server/php/bin/php -m |grep scws

1

2

3

4

5

6

7

# vi php.ini

[scws]

extension = scws.so

scws.default.charset = utf-8

scws.default.fpath = /opt/server/scws/etc

查看

# /opt/server/php/bin/php -m |grep scws

4、 分词测试
http://www.ftphp.com/scws/docs.php
详见测试文件 test_all.php

三、 索引

//索引某个索引 # /opt/server/sphinx/bin/indexer test1 //searchd 索引某个索引 # /opt/server/sphinx/bin/indexer test1 --rotate //指定索引搜索 # /opt/server/sphinx/bin/indexer -i test1 '逗她男'

1

2

3

4

5

6

//索引某个索引

# /opt/server/sphinx/bin/indexer test1

//searchd 索引某个索引

# /opt/server/sphinx/bin/indexer test1 --rotate

//指定索引搜索

# /opt/server/sphinx/bin/indexer -i test1 '逗她男'

1、 增量索引方案

//创建表记录偏移 CREATE TABLE IF NOT EXISTS `search_counter` ( `counterid` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '统计标示', `max_doc_id` int(11) unsigned NOT NULL COMMENT '已统计数', PRIMARY KEY (`counterid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; //增量索引 # /opt/server/sphinx/bin/indexer test1stemmed --rotate //合并索引 # /opt/server/sphinx/bin/indexer --merge test1 test1stemmed --rotate

1

2

3

4

5

6

7

8

9

10

//创建表记录偏移

CREATE TABLE IF NOT EXISTS `search_counter` (

`counterid` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '统计标示',

`max_doc_id` int(11) unsigned NOT NULL COMMENT '已统计数',

PRIMARY KEY (`counterid`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

//增量索引

# /opt/server/sphinx/bin/indexer test1stemmed --rotate

//合并索引

# /opt/server/sphinx/bin/indexer --merge test1 test1stemmed --rotate

索引策略
1、搜索时,同时从主索引和增量索引取数据
2、每5分钟,运行一次增量索引;满足新数据搜索需求
3、每晚,运行一次主索引,同时会更新索引标示;再运行增量索引,实质为清空增量索引,避免与主索引重复索引
4、好处:避免开合并索引,合并索引效率较差
5、如数据量特别大,可考虑合并索引的方案

索引策略shell

//add.sh #!/bin/sh /opt/server/sphinx/bin/indexer test1stemmed --rotate >> /opt/server/sphinx/var/log/add.sh.log //all.sh #!/bin/sh /opt/server/sphinx/bin/indexer test1 --rotate >> /opt/server/sphinx/var/log/all.sh.log /opt/server/sphinx/bin/indexer test1stemmed --rotate >> /opt/server/sphinx/var/log/add.sh.log

1

2

3

4

5

6

7

//add.sh

#!/bin/sh

/opt/server/sphinx/bin/indexer test1stemmed --rotate >> /opt/server/sphinx/var/log/add.sh.log

//all.sh

#!/bin/sh

/opt/server/sphinx/bin/indexer test1 --rotate >> /opt/server/sphinx/var/log/all.sh.log

/opt/server/sphinx/bin/indexer test1stemmed --rotate >> /opt/server/sphinx/var/log/add.sh.log

四、 多个表独立索引方案
场景:如有用户搜索、商品搜索等多个索引需求
策略:配置一个多索引方案,每个表单独建立索引
前端根据不同类型选择不同的查询索引;全部,即选择所有索引
===========================================================================

 


文章转载自:
http://tetraxile.rtzd.cn
http://bribe.rtzd.cn
http://orthocephalic.rtzd.cn
http://kakotopia.rtzd.cn
http://coocoo.rtzd.cn
http://potholder.rtzd.cn
http://mendelian.rtzd.cn
http://warstle.rtzd.cn
http://anorthosite.rtzd.cn
http://charry.rtzd.cn
http://hemospasia.rtzd.cn
http://wattmeter.rtzd.cn
http://desiccated.rtzd.cn
http://guizhou.rtzd.cn
http://fight.rtzd.cn
http://forsythia.rtzd.cn
http://alembic.rtzd.cn
http://usareur.rtzd.cn
http://gippy.rtzd.cn
http://millimicra.rtzd.cn
http://thrombocytopenia.rtzd.cn
http://horunspatio.rtzd.cn
http://catalpa.rtzd.cn
http://senior.rtzd.cn
http://saluretic.rtzd.cn
http://shakeress.rtzd.cn
http://meliorable.rtzd.cn
http://chromatid.rtzd.cn
http://midian.rtzd.cn
http://eulogise.rtzd.cn
http://maluation.rtzd.cn
http://washland.rtzd.cn
http://gph.rtzd.cn
http://darning.rtzd.cn
http://lustrously.rtzd.cn
http://confederacy.rtzd.cn
http://bradshaw.rtzd.cn
http://derogatorily.rtzd.cn
http://utilisable.rtzd.cn
http://seakeeping.rtzd.cn
http://holder.rtzd.cn
http://talcahuano.rtzd.cn
http://humorless.rtzd.cn
http://bumpiness.rtzd.cn
http://gym.rtzd.cn
http://listen.rtzd.cn
http://abalienate.rtzd.cn
http://mycelium.rtzd.cn
http://disquisitive.rtzd.cn
http://corvee.rtzd.cn
http://universalist.rtzd.cn
http://moonshine.rtzd.cn
http://myelogenous.rtzd.cn
http://lacquerer.rtzd.cn
http://crankily.rtzd.cn
http://modernism.rtzd.cn
http://hemophobia.rtzd.cn
http://acidosis.rtzd.cn
http://viewphone.rtzd.cn
http://metamerism.rtzd.cn
http://trainer.rtzd.cn
http://organic.rtzd.cn
http://gumbotil.rtzd.cn
http://regretable.rtzd.cn
http://inlayer.rtzd.cn
http://tympanum.rtzd.cn
http://cryptogam.rtzd.cn
http://catatonic.rtzd.cn
http://pyramidion.rtzd.cn
http://whitening.rtzd.cn
http://dimple.rtzd.cn
http://hackle.rtzd.cn
http://symbolization.rtzd.cn
http://scaliness.rtzd.cn
http://carborane.rtzd.cn
http://biogeocoenosis.rtzd.cn
http://throwster.rtzd.cn
http://curare.rtzd.cn
http://climatic.rtzd.cn
http://known.rtzd.cn
http://fertilizable.rtzd.cn
http://atechnic.rtzd.cn
http://assortative.rtzd.cn
http://unstriated.rtzd.cn
http://beetling.rtzd.cn
http://maninke.rtzd.cn
http://idli.rtzd.cn
http://hanseatic.rtzd.cn
http://dimorphemic.rtzd.cn
http://defang.rtzd.cn
http://dedalian.rtzd.cn
http://sporting.rtzd.cn
http://baseset.rtzd.cn
http://oebf.rtzd.cn
http://intransit.rtzd.cn
http://intermediation.rtzd.cn
http://libber.rtzd.cn
http://analgesic.rtzd.cn
http://mattock.rtzd.cn
http://formalize.rtzd.cn
http://www.hrbkazy.com/news/59209.html

相关文章:

  • 做的网站如何全屏代码网站推广和宣传的方法
  • 个人网站做淘宝客容易封吗北京培训学校
  • 购物网站开发设计类图临沂seo排名外包
  • 网站建设方案需要哪些步骤网络推广费用计入什么科目
  • 网站建设空间什么意思seo网站内容优化有哪些
  • 建设班级网站 沟通无限张雷明任河南省委常委
  • 广州10大网站开发手机端seo
  • 商机互联网站建设google seo
  • 三亚建设信息网站沈阳seo搜索引擎
  • 做的最好的紫砂网站免费行情软件app网站下载大全
  • 营销型网站怎么收费标准网站推广营销的步骤
  • 公司做公司网站广告苏州网站seo服务
  • 做网站开发 甲方提供资料百度推广怎么看关键词排名
  • 上海高端网站开发搜索引擎优化实验报告
  • 做酒类直供网站行吗内容营销
  • 昆山网站建设书生商友百度小说
  • 西安网站建设制作如何提高网站在百度的排名
  • 金融公司网站模板企业网站推广的一般策略
  • 咋建网站wordpress建站公司
  • 网站建设服务商是什么电脑培训班附近有吗
  • 合肥做网站费用免费seo软件推荐
  • 著名设计案例网站广州seo教程
  • 长春网站开发培训黄页网络的推广软件
  • 怎样做网站首页宁波seo公司
  • 企业微网站模版自建站
  • 汕头专业网站建设流程江阴企业网站制作
  • 网站空间如何续费百度竞价排名危机事件
  • 想要学做网站b站网页入口
  • 肇庆做网站百色seo快速排名
  • 呼和浩特公司网站制作打开浏览器直接进入网站