AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
[TOC] ## 概述 配置两个表的全文索引 ``` source src1 { type = mysql # MySQL server information sql_host = localhost sql_user = root sql_pass = password sql_db = antdbms_wb # SQL query to retrieve data from the table sql_query = \ select * from im_group_msg\ sql_attr_uint = group_id sql_field_string = subject sql_field_string = content sql_field_string = send_name } source src2 { type = mysql # MySQL server information sql_host = localhost sql_user = root sql_pass = password sql_db = antdbms_wb # SQL query to retrieve data from the table sql_query = \ select * from im_msg_202304; # Defines what attributes should be stored and indexed # Defines which fields should be full-text indexed sql_field_string = subject sql_field_string = content sql_field_string = send_name } index index1 { source = src1 path = /var/data/index1 } index index2 { source = src2 path = /var/data/index2 } ``` 执行 sphinx ``` > indexer.exe --config=sphinx.conf --all // 创建索引文件 > searchd.exe --config=sphinx.conf [--install] // 启动服务 ,--install 表示注册 window 服务 > indexer.exe --config=sphinx.conf --rorate // 增量更新 ``` php 代码 ``` ```