sphinx中文分词coreseek的配置_第1页
sphinx中文分词coreseek的配置_第2页
sphinx中文分词coreseek的配置_第3页
sphinx中文分词coreseek的配置_第4页
sphinx中文分词coreseek的配置_第5页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

coreseek的配置■LJ13source■LJ13sourceIF{15豆rr豆Tg~20~21~documentdatasourcetype,mandatory^nodefsuitvaluknowntypesaremysqljpgsqljmssqljsmlpipetype =mysq################################################SQLsettings(for,mysql?and?pgsql?types第13行改成数据源名称localhostroot123456localhostroot123456test3306#optional,defsuitis330623行修改数据库信息T3 sql_query_pre =SETNAMESutf8T4 sql_query_pre =SETSESSIONquery_cache_type=OFF73行打开这两个选项sql_query =\一SELECTid,group.id,UNIK_TIMESTMP(date_added)ASdate_added,titlecontent\FROMdocuments第79行写出要查询的SQL语句根据表与表结构=group_id=group_id109行根据什么表中的那一列字段来排序sourcesrclthrottled:srcl100sql_ranged_throttle100256行为对增量数据源的配置暂时全部注释掉indestest1{documentsource(s)toindexmulti-value^mandatorydocumentIDsmustbegloballyuniqueacrossallsourcessource =srclindesfilespathandfilenamejwithoutestensionmandatory^pathmustbewritable^e^tensionswillbeauto-appendpath =/usr/local/coreseek/var/data/test1documentattributevalues(docinfo)storagemodeoptionaljdefsuitis’Extern'knownvaluesare?none?f,eKtern,and?inline,docinfo 二estern271行为主索引testl为名字我取名为documentindex276行source设置数据源的来源既是上面配置数据源的名称所以填写document

280行path设置数据源存放的路径一般把后面的名字改成主索引的名称就是了documentindex#stopwords 二G:\data\stopwords.tKtwordformsfile】in"mapfrom>mapto"plainteKtformatoptionaljdefsuitisempty一#wordforms 二G:\data\wordforms.tKttokenizingexceptionsfileoptionaljdefsuitisempty#plaintextcasesensitive^spaceinsensitiveinmap-frompartone"MapSeveralWords=>ToASingleOne17entryperline##§sceptions =/data/exceptions.tst315,321,330行对停词的设置默认是英文停词这里把他注释掉34口 charset_type =sbcs3413驻3驻 #####34T ####optionaljdefaultvaluedependsoncharset_typedefaultsareconfiguredtoincludeEnglishandRussiancharactersonlyyouneedtochangethetabletoincludeadditionalonesthisbehaviorMAYchangeinfutureversions'sbcs?defaultvalueischarset_table =0..9^A..Z->a..Zj_ja..ZjU+A8->U+B8jU+B8jU+CO. .U+DF->U+E0..U+FF,U+EO..U+FF##nutf-8,defaultvalueis#charset_table =CL.9,A..Z->a..a..z,U+410..U+42F->U4430..U+44F,U+430..U+44F■C.1 340行设置编码charset_type=zh_cn.utf-8然后在后面加上一句charset_dictpath =/usr/local/mmseg/etc/中文字典路径353行UTF8的注释去掉错误操作应该要注释掉inheritedindesesample#alltheparametersarecopiedfromtheparentindeZjandmaythenbeoverriddeninthisindezdefinitionindeztest1stenuned:test1{path =/usr/local/coreseek/var/data/test1steimnedmorphology =stem_en477行这里是对增量索引的配置由于刚才把增量源给注释掉了所以这里也暂时先注释掉indesdist1{,,?distributed?indeKtypeMUSTbespecifiedtype 二distributedlocalindestobesearchedtherecanbemanylocalindeKesconfiguredlocal =test1local =test1steuunedremoteagentmultipleremoteagentsmaybespecifiedsyntasforTCPconnectionsis,hostname:port:indez13[indes2[,...syntaxforlocalUNIXconnectionsis,/path/to/socket:indeK1[iiragent =localhost:9313:remote1agent 二localhost:9314:remote23remote3agent =/var/run/searchd.sock:remote4492行对分布式的设置意义不大关闭agentagent506和507行或者全部注释掉indeKer{memorylimit,inbyteSjkiloytes(16384K)optionaljdefsuitis32虬maxis2047Mjrmem_limit =32M533行推荐256M配置好过后进入bin目标生成索引/usr/local/coreseek/bin/indexer-c/usr/local/coreseek/etc/csft.conf—all增量索引配置创建一个计数器的表CREATETABLE'sph_counter'('counter_id'int(10)unsignedNOTNULLAUTO_INCREMENT,'max_doc_id'int(11)NOTNULL,PRIMARYKEY('counter_id'))ENGINE=MyISAMDEFAULTCHARSET=utf8修改配置文件主数据源里面:我们需要把欲查询语句改成下面的语句:13行Sourcemain{把sql_query_pre的改成下面的语句79行sql_query_pre=REPLACEINTOsph_counterSELECT1,MAX(id)FROMdocumentssql_query =\SELECTid,group_id,UNIX_TIMESTAMP(date_added)ASdate_added,title,content\FROMdocuments\WHEREid<=(SELECTmax_doc_idFROMsph_counterWHEREcounter_id=1)}256行配置增量索引源srclthrottlet为增量索引源名称:srcl为继承的主索引源将其改成:sourcedelta:document{sql_query_pre=setnamesutf8sql_query=SELECTid,group_id,UNIX_TIMESTAMP(date_added)ASdate_added,title,contentfromdocumentswhereid>(selectmax_doc_idfromsph_counterwherecounter_id=1)}485indexdeltaindes:documentindes4S6{path =/usr/local/coreseek/var/data/test1stenunedmorphology =stem_en} 一 一第485行配置增量索引deltaindex为增量索引名称:后面继承主索引487行path写上存放路径通常改掉后面名称为deltaindex就行并在上边加上数据源的来源indexdeltaindex:documentindex{source = deltapath = /usr/local/coreseek/var/data/deltaindexmorphology = stem_en}配置完成后/usr/local/coreseek/bin/indexer-c/usr/local/coreseek/etc/csft.conf—rotate--all生成所有索引/usr/local/coreseek/bin/indexer-c/usr/local/coreseek/etc/csft.conf--rotatedeltaindex生成增量索引/usr/local/coreseek/bin/indexer-c/usr/local/coreseek/etc/csft.conf—mergedocumentindexdeltaindex合并索引给PHP安装模块tarzxfsphinx-1.1.0.tgz解压包/usr/local/php/bin/phpize./configure—with-php-config=/usr/local/php/bin/php-config—with-sp

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论