企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[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 代码 ``` ```