Coreseek:第一步配置文件
Windows操作系统下:mysql数据源配置:(对应coreseek-3.2.13-win32/etc/csft_mysql.conf) #源定义source mysql{type= mysql #表示使用mysql数据源sql_host= localhost #表示数据库服务器的链接地址sql_user= root #表示数据库的用户名sql_pass= 123456 #表
Windows操作系统下:mysql数据源配置:(对应coreseek-3.2.13-win32/etc/csft_mysql.conf)
#源定义 source mysql { type = mysql #表示使用mysql数据源 sql_host = localhost #表示数据库服务器的链接地址 sql_user = root #表示数据库的用户名 sql_pass = 123456 #表示数据库的密码 sql_db = test #表示数据库的名称 sql_port = 3306 #表示数据库的端口 sql_query_pre = SET NAMES utf8 #从数据库之中读取数据的SQL语句设置 sql_query = SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content FROM documents #sql_query第一列id需为整数,且被系统使用,无需再设置sql_attr_uint #使用sql_attr设置的字段,只能作为属性,使用SphinxClient::SetFilter()进行过滤;未被设置的字段,自动作为全文检索的字段,使用SphinxClient::Query("搜索字符串")进行全文搜索; #title、content作为字符串/文本字段,被全文索引 sql_attr_uint = group_id #从SQL读取到的值必须为整数;sql_attr_uint表示该字段是数值属性 sql_attr_timestamp = date_added #从SQL读取到的值必须为整数,作为时间属性;sql_attr_timestamp表示该字段是时间属性;可以不用该配置 sql_query_info_pre = SET NAMES utf8 #命令行查询时,设置正确的字符集,3.2.14开始支持 sql_query_info = SELECT * FROM documents WHERE id=$id #命令行查询时,从数据库读取原始数据信息 } #index定义 index mysql { source = mysql #对应的source名称 path = var/data/mysql #索引存放的位置,路径为var/data docinfo = extern mlock = 0 morphology = none min_word_len = 1 html_strip = 0 #charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Li}
需要注意的有:
1,必须有一个自增的字段id,当然你在数据库里写uid,nid其他的名字也行,ID属性,必须提供,在SQL语句中字段名称不限。对应SQL查询的第一个字段,系统自动使用,内部属性名为@id,不需要也不能在配置中设定。
2.sql_attr_float,sql_attr_string等是属性!属性是什么,属性是用来过滤的,比如你搜索时会选择某个时间段就会用到sql_attr_timestamp时间戳属性,搜索过滤某个人或者群组发的信息,就会用到 group_id和author_id这个属性,属性是用来过滤,不是用来索引的!所以,你如果在下面声明了属性,那么这个属性就不会建索引,即及你搜索这个id或者时间戳的时候会搜不到结果,所以你是要为这值建索引还是当做属性用还是要想一想

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











In Laravel development, dealing with complex model relationships has always been a challenge, especially when it comes to multi-level BelongsToThrough relationships. Recently, I encountered this problem in a project dealing with a multi-level model relationship, where traditional HasManyThrough relationships fail to meet the needs, resulting in data queries becoming complex and inefficient. After some exploration, I found the library staudenmeir/belongs-to-through, which easily installed and solved my troubles through Composer.

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

There are many ways to customize a development environment, but the global Git configuration file is one that is most likely to be used for custom settings such as usernames, emails, preferred text editors, and remote branches. Here are the key things you need to know about global Git configuration files.

Analysis of memory leak phenomenon of Java programs on different architecture CPUs. This article will discuss a case where a Java program exhibits different memory behaviors on ARM and x86 architecture CPUs...

Git is a distributed version control system designed to track code changes and allow collaborative development. It enables developers to document project evolution, manage code merges, and maintain project history in an efficient and secure way. Through Git's distributed architecture, each developer has a complete copy of the project and performs common version control operations without communicating with a central server.

The troubleshooting idea of SSH connection failure after SpringBoot service has been running for a period of time has recently encountered a problem: a Spring...

I encountered a tricky problem when developing a multi-device-compatible website: how to accurately identify the user's browser and device information. After trying multiple methods, I found that directly parsing user-agent strings (User-Agent) are both complex and unreliable, and often misjudgments occur. Fortunately, I successfully solved this problem by installing the WhichBrowser/Parser library using Composer.

Choose a reliable trading platform such as OKEx to ensure access to the official entrance.
