gpt4 book ai didi

sphinx - 如何允许特殊字符 (#,@,!,&,(,),%) 作为 Sphinx 中的搜索关键字

转载 作者:行者123 更新时间:2023-12-02 05:01:43 25 4
gpt4 key购买 nike

我对允许特殊字符 (#,@,!,&,(,),%) 作为 Sphinx 中的搜索关键字的实现感到震惊。

请建议我..

下面是配置文件,

/* 开始 */

source dbserver
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass =
sql_db = mydb
#sql_sock = /var/run/mysqld/mysqld.sock
sql_port = 3306
}


searchd
{
listen = localhost:3312
# port = 9313
log = /* some searchd.log path */
query_log = /* some query.log path */
pid_file = /* some searchd.pid path */
max_matches = 10000
seamless_rotate = 0
}


source adsearch : mydbserver
{
sql_query_post = REPLACE INTO sph_tracker SELECT 1,'ad',CURRENT_TIMESTAMP;

sql_ranged_throttle = 1
sql_attr_uint = networkid
sql_attr_uint = folderid
sql_attr_uint = createdby
sql_attr_uint = status
sql_attr_timestamp = createdon
}

index index_adsearch
{
source = adsearch
path = /* some path */
morphology = stem_en
min_word_len = 0
#min_prefix_len = 5
min_infix_len = 2
enable_star = 1
preopen = 1
}

source delta_adsearch : adsearch
{
sql_query = DELETE FROM ad where status='Deleted' AND deleteflag='Y'
}

index delta_index_adsearch : index_adsearch
{
source = delta_adsearch
path = /* some path */
}

source tmplsearch : mydbserver
{
sql_query_post = REPLACE INTO sph_tracker SELECT 2,'template',CURRENT_TIMESTAMP;


sql_ranged_throttle = 1
sql_attr_uint = networkid
sql_attr_uint = industryid
sql_attr_uint = status
sql_attr_timestamp = createdon
sql_attr_timestamp = startdate
sql_attr_timestamp = enddate
sql_attr_uint = active
sql_attr_uint = primarysize
}

index index_tmplsearch
{
source = tmplsearch
path = /* some path */
morphology = stem_en
min_word_len = 0
#min_prefix_len = 5
min_infix_len = 2
enable_star = 1
preopen = 1
}

source delta_tmplsearch : tmplsearch
{
sql_query = DELETE FROM adtemplate where status='Deleted' AND deleteflag='Y'
}

index delta_index_tmplsearch : index_tmplsearch
{
source = delta_tmplsearch
path = /* some path */
}


source media_assets_search : mydbserver
{
#sql_query_post = REPLACE INTO sph_tracker SELECT 3,'media',CURRENT_TIMESTAMP;

sql_ranged_throttle = 1
sql_attr_uint = networkid
sql_attr_uint = mediatype
sql_attr_uint = mediacat
sql_attr_uint = uploadedby
sql_attr_uint = active
sql_attr_uint = industryid
sql_attr_timestamp = uploaddate
sql_attr_uint = diskstore
}

index index_media_assets_search
{
source = media_assets_search
path = /* some path */
morphology = stem_en
min_word_len = 0
#min_prefix_len = 5
min_infix_len = 2
enable_star = 1
preopen = 1
}

source delta_media_assets_search : media_assets_search
{

}

index delta_index_media_assets_search : index_media_assets_search
{
source = delta_media_assets_search
path = /* some path */
}

/* 结束 */

请看看这个并建议我..

谢谢,

纳古..

最佳答案

您需要将它们添加到 charset_table 配置中。

您可能还想确保对查询进行转义以避免被误解为搜索语法。

虽然也确实阅读了 blend_chars

关于sphinx - 如何允许特殊字符 (#,@,!,&,(,),%) 作为 Sphinx 中的搜索关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15744134/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com