欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

分享我的社工库的裤子+sphinx社工库搭建教程

程序员文章站 2022-07-10 10:26:58
  搭建教程: 先导入md5.phpinfo.me.sql 下载sphinx  http://sphinxsearch.com/  我用的是windows版...

 

搭建教程:

先导入md5.phpinfo.me.sql

下载sphinx  http://sphinxsearch.com/  我用的是windows版的  当然linux也差不多

创建配置文件sphinx-zh/bin/sphinx.conf

#
# Minimal Sphinx configuration sample (clean, simple, functional)
#
 
source src1
{
        type                        = mysql
 
        sql_host                = localhost
        sql_user                = root
        sql_pass                = 1141056911
        sql_db                  = md5
        sql_port                = 3306
 
        sql_query                = SELECT `id`,`username`,`password`,`email`,`salt`,`order` FROM md5_sgk
 
        sql_query_info                = SELECT * FROM md5_sgk WHERE id=$id
}
 
index test1
{
        source                        = src1
        path                        = D:/sphinx-zh/data/
        docinfo                        = extern
        charset_type                = utf-8
        chinese_dictionary = D:/sphinx-zh/etc/xdict
}
 
indexer
{
        mem_limit                = 256M
}
 
searchd
{
        listen                        = 9312
        listen                        = 9306:mysql41
        log                        = D:/sphinx-zh/log/searchd.log
        query_log                = D:/sphinx-zh/log/query.log
        read_timeout                = 5
        max_children                = 30
        pid_file                = D:/sphinx-zh/searchd.pid
        max_matches                = 1000
        seamless_rotate                = 1
        preopen_indexes                = 1
        unlink_old                = 1
        workers                        = threads # for RT to work
        binlog_path                =  D:/sphinx-zh/1
}

 

然后执行命令创建索引 C:\Documents and Settings\Administrator>cd D:\sphinx-zh\bin

C:\Documents and Settings\Administrator>cd /d D:\sphinx-zh\bin

D:\sphinx-zh\bin>indexer --all

sphinx-for-chinese 2.1.0-dev (r3361)

Copyright (c) 2008-2012, sphinx-search.com

using config file './sphinx.conf'...
indexing index 'test1'...
WARNING: Attribute count is 0: switching to none docinfo
^Cllected 9000 docs, 0.4 MB

现在就开始创建索引了请耐心等待 创建完成以后执行 searchd.exe启动搜索服务

然后就可以用如下源码查询了 sgk源码:

sgk

源码还需要自行改改

接下来就尽情享受毫秒级搜索的速度吧