• 安装searchd


    把安装包解压到 D:coreseek

    创建表

    create table product(
    
    id int key auto_increment,
    title varchar(255),
    content text
    );
    insert into product(title,content) values
    ('苹果电脑1','苹果电脑很好1'),
    ('苹果电脑2','苹果电脑很好2'),
    ('苹果笔记本1','苹果笔记本很好1'),
    ('山西苹果','山西苹果好吃'),
    ('dell电脑','苹果电脑很好1'),
    ('联想电脑1','联想电脑很好1');

    配置文件

    #源定义 设置数据来源
    source mysql
    {
        type                    = mysql
        sql_host                = localhost
        sql_user                = root
        sql_pass                = 
        sql_db                    = system
        sql_port                = 3306
        sql_query_pre            = SET NAMES utf8
        sql_query                = select id,title,content from product
    }
    
    #index定义 设置索引
    index index1
    {
        source            = mysql            
        path            = D:/coreseek/var/data/mysql 
        docinfo            = extern
        mlock            = 0
        morphology        = none
        min_word_len        = 1
        html_strip                = 0
    
    
        charset_dictpath = D:/coreseek/etc/                            
        charset_type        = zh_cn.utf-8
    }
    
    #全局index定义
    indexer
    {
        mem_limit            = 128M
    }
    
    #searchd服务定义
    searchd
    {
        listen                  =   9312
        read_timeout        = 5
        max_children        = 30
        max_matches            = 1000
        seamless_rotate        = 0
        preopen_indexes        = 0
        unlink_old            = 1
        pid_file=D:/coreseek/var/log/searchd_mysql.pid
        log=D:/coreseek/var/log/searchd_mysql.log
        query_log=D:/coreseek/var/log/query_mysql.log
    
    }
    

      

    创建索引

    D:/coreseek,执行:binindexer -c etccsft_mysql.conf --all

    安装服务

    binsearchd --install  --config d:/coreseek/etc/csft_mysql.conf

    安装成功后命令行窗口会提示"services searchd installed successfully"。

     

    删除服务   

    sc delete +服务名称

     sc delete searchd

  • 相关阅读:
    多元线性回归(pandas/scikit-learn)
    hive查询语法
    Python日志记录(Logging)
    python调用C/C++动态链接库和jython
    MacPorts的安装和使用
    python多进程(multiprocessing)
    Z-Score数据标准化处理(python代码)
    皮尔逊相关系数的计算(python代码版)
    参考书籍
    MFC 之ActiveX控件学习
  • 原文地址:https://www.cnblogs.com/chenliuxiao/p/9353988.html
Copyright © 2020-2023  润新知