<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      golang全文搜索--使用sphinx

      不多廢話,測試環(huán)境 `ubuntu 13.10` ## 安裝 sudo apt-get install sphinxsearch ## 配置 nano /etc/sphinxsearch/sphinx.conf # 數(shù)據(jù)源配置 source default { type = xmlpipe2 xmlpipe_command = /path/xmlpipe2 xmlpipe_fixup_utf8 = 1 } # 索引配置 index default { type = plain source = default # 索引文件路徑 path = /path/filename # 不存儲文檔信息 docinfo = none #最小索引詞長度 min_word_len = 2 charset_type = utf-8 # 指定utf-8的編碼表 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F # 簡單分詞,只支持0和1,如果要搜索中文,請指定為1 ngram_len = 1 # 需要分詞的字符,如果要搜索中文,去掉前面的注釋 ngram_chars = U+3000..U+2FA1F } ## xmlpipe2的格式 ... ... ... ... 只要配置文件中 xmlpipe_command 字段配置的可執(zhí)行文件輸出為相應(yīng)的xml流即可,這樣幾乎適配了所有數(shù)據(jù)源 ## 生成索引 $ indexer default Sphinx 2.0.4-release (r3135) Copyright (c) 2001-2012, Andrew Aksyonoff Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com) using config file '/etc/sphinxsearch/sphinx.conf'... indexing index 'default'... WARNING: Attribute count is 0: switching to none docinfo WARNING: collect_hits: mem_limit=0 kb too low, increasing to 12288 kb collected 4 docs, 0.0 MB sorted 0.0 Mhits, 100.0% done total 4 docs, 47 bytes total 0.000 sec, 54970 bytes/sec, 4678.36 docs/sec total 2 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg total 6 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg ## 查詢 $ search 55 Sphinx 2.0.4-release (r3135) Copyright (c) 2001-2012, Andrew Aksyonoff Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com) using config file '/etc/sphinxsearch/sphinx.conf'... index 'default': query '55 ': returned 1 matches of 1 total in 0.000 sec displaying matches: 1. document=233221, weight=1695 words: 1. '55': 1 documents, 1 hits ## 配置searchd 編輯sphinx配置文件,添加: ## 監(jiān)聽地址 searchd { # 監(jiān)聽地址(Unix socket) listen = /var/log/searchd.sock # 日志文件 log = /var/log/searchd.log # 查詢?nèi)罩? query_log = /var/log/query.log # 客戶端讀取超時時間 read_timeout = 5 # 客戶端請求超時時間 client_timeout = 3000 # PID 文件 pid_file = /var/log/searchd.pid } ## 運行searchd $ sudo searchd Sphinx 2.0.4-release (r3135) Copyright (c) 2001-2012, Andrew Aksyonoff Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com) using config file '/etc/sphinxsearch/sphinx.conf'... WARNING: compat_sphinxql_magics=1 is deprecated; please update your application and config listening on UNIX socket /var/log/searchd.sock precaching index 'default' precached 1 indexes in 0.000 sec 驗證一下狀態(tài) $ searchd --status Sphinx 2.0.4-release (r3135) Copyright (c) 2001-2012, Andrew Aksyonoff Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com) using config file '/etc/sphinxsearch/sphinx.conf'... searchd status -------------- uptime: 7 connections: 1 maxed_out: 0 ## golang客戶端 package main import ( "github.com/yunge/sphinx" "log" ) func main() { // 鏈接參數(shù) opts := &sphinx.Options{ Socket: "/var/log/searchd.sock", Timeout: 5000, } // 創(chuàng)建客戶端 spClient := &sphinx.Client{Options: opts} if err := spClient.Error(); err != nil { log.Fatal(err) } // 打開鏈接 if err := spClient.Open(); err != nil { log.Fatal(err) } // 獲取實例信息 status, err := spClient.Status() if err != nil { log.Fatal(err) } for _, row := range status { log.Printf("%20s:\t%s\n", row[0], row[1]) } // 查詢 res, err := spClient.Query("33", "default", "Test Query()") if err != nil { log.Fatal(err) } log.Println(res) } 輸出: 2013/12/05 01:14:55 uptime: 148 2013/12/05 01:14:55 connections: 2 2013/12/05 01:14:55 maxed_out: 0 2013/12/05 01:14:55 command_search: 0 2013/12/05 01:14:55 command_excerpt: 0 2013/12/05 01:14:55 command_update: 0 2013/12/05 01:14:55 command_keywords: 0 2013/12/05 01:14:55 command_persist: 2 2013/12/05 01:14:55 command_status: 2 2013/12/05 01:14:55 command_flushattrs: 0 2013/12/05 01:14:55 agent_connect: 0 2013/12/05 01:14:55 agent_retry: 0 2013/12/05 01:14:55 queries: 0 2013/12/05 01:14:55 dist_queries: 0 2013/12/05 01:14:55 query_wall: 0.000 2013/12/05 01:14:55 query_cpu: OFF 2013/12/05 01:14:55 dist_wall: 0.000 2013/12/05 01:14:55 dist_local: 0.000 2013/12/05 01:14:55 dist_wait: 0.000 2013/12/05 01:14:55 query_reads: OFF 2013/12/05 01:14:55 query_readkb: OFF 2013/12/05 01:14:55 query_readtime: OFF 2013/12/05 01:14:55 avg_query_wall: 0.000 2013/12/05 01:14:55 avg_query_cpu: OFF 2013/12/05 01:14:55 avg_dist_wall: 0.000 2013/12/05 01:14:55 avg_dist_local: 0.000 2013/12/05 01:14:55 avg_dist_wait: 0.000 2013/12/05 01:14:55 avg_query_reads: OFF 2013/12/05 01:14:55 avg_query_readkb: OFF 2013/12/05 01:14:55 avg_query_readtime: OFF 2013/12/05 01:14:55 &{[content] [] [] [] 1 1 0.001 [{33 1 1}] 0} api參考 http://gowalker.org/github.com/yunge/sphinx sphinx配置參考 http://www.coreseek.cn/docs/coreseek_4.1-sphinx_2.0.1-beta.html

      posted on 2013-12-05 01:21  黑暗伯爵  閱讀(3896)  評論(1)    收藏  舉報

      導(dǎo)航

      主站蜘蛛池模板: 97国产揄拍国产精品人妻| 亚洲国产性夜夜综合| 国产成人午夜福利院| 亚洲三级香港三级久久| 成 人 色 网 站免费观看| 欧美人与动欧交视频| 日韩有码中文在线观看| 在线免费观看毛片av| awww在线天堂bd资源在线| 日韩永久永久永久黄色大片| 靖安县| 国产视频精品一区 日本| 人妻中文字幕精品系列| 国产综合有码无码中文字幕| 亚洲中文字幕无码爆乳app| 热久在线免费观看视频 | 日韩精品欧美高清区| av中文字幕一区人妻| 国产成人啪精品视频免费软件| 国产一区二区av天堂热| 中文字幕有码日韩精品| 奇米四色7777中文字幕| 少妇被粗大的猛烈进出69影院一| 亚洲ⅴa曰本va欧美va视频| 懂色AV| 中文字幕无码久久精品| 国产做无码视频在线观看浪潮| 国产美女深夜福利在线一 | 国产成人一区二区三区视频免费 | 2021国产精品视频网站| 久久国产成人亚洲精品影院老金| 国产av一区二区亚洲精品| 成人性生交片无码免费看| 99久久久无码国产麻豆| 白嫩少妇激情无码| 国产成人亚洲日韩欧美| 久久精品国产亚洲AⅤ无码| 欧美日韩国产一区二区三区欧| 在线观看中文字幕国产码| 日韩在线视频观看免费网站| 国产精品久久中文字幕|