Sphinx 斯芬克斯研究堂';t返回一些已定义的属性
我正在处理Sphinx搜索的配置。问题是-并非每个值都从索引返回。 我的当前配置:Sphinx 斯芬克斯研究堂';t返回一些已定义的属性,sphinx,Sphinx,我正在处理Sphinx搜索的配置。问题是-并非每个值都从索引返回。 我的当前配置: source pl_PL_main_source { type = pgsql sql_host = xxx sql_user = xxx sql_pass = xxx sql_db = xxx sql_port = xxx } source pl_PL_artifacts_search : pl_PL_main_sourc
source pl_PL_main_source {
type = pgsql
sql_host = xxx
sql_user = xxx
sql_pass = xxx
sql_db = xxx
sql_port = xxx
}
source pl_PL_artifacts_search : pl_PL_main_source {
sql_query = select \
id, \
title, \
description, \
slug, \
'-' AS thumb_url, \
'/' AS test, \
'\.' AS test2, \
'\:' as test3, \
(CASE WHEN COALESCE(thumb_width, 0) = 0 THEN 280 ELSE thumb_width END) AS thumb_width, \
(CASE WHEN COALESCE(thumb_height, 0) = 0 THEN 280 ELSE thumb_height END) AS thumb_height, \
(COALESCE(thumb_height, 0) > COALESCE(thumb_width, 0)) AS is_vertical, \
add_timestamp \
FROM artifacts.item WHERE is_removed IS FALSE AND is_public IS TRUE
sql_field_string = title
sql_attr_string = description
sql_attr_string = slug
sql_attr_string = thumb_url
sql_attr_string = test
sql_attr_string = test2
sql_attr_string = test3
sql_attr_uint = thumb_width
sql_attr_uint = thumb_height
sql_attr_bool = is_vertical
sql_attr_string = add_timestamp
}
index pl_PL_artifacts_search {
source = pl_PL_artifacts_search
path = /usr/local/sphinx/var/data/pl_PL/pl_PL_artifacts_search
min_word_len = 2
infix_fields = title
charset_table = 0..9, A..Z->a..z, a..z, U+0143->U+0144, \
U+0104->U+0105, U+0106->U+0107, U+0118->U+0119, \
U+0141->U+0142, U+00D3->U+00F3, U+015A->U+015B, \
U+0179->U+017A, U+017B->U+017C, U+0105, U+0107, \
U+0119, U+0142, U+00F3, U+015B, U+017A, U+017C, \
U+0144
wordforms = /usr/local/sphinx/wordform-pl-dict-urf-8
}
indexer {
mem_limit = 512M
}
searchd {
listen = xxx:sphinx
log = /usr/local/sphinx/var/log/pl_PL/pl_PL_searchd.log
query_log = /usr/local/sphinx/var/log/pl_PL/pl_PL_query.log
read_timeout = 5
max_children = 30
pid_file = /usr/local/sphinx/var/log/pl_PL/pl_PL_searchd.pid
seamless_rotate = 1
unlink_old = 1
binlog_path = /usr/local/sphinx/var/log/pl_PL
}
索引器重建索引时没有问题。问题是当我使用Sphinx客户端并查询该索引时。它返回正确的结果,但不返回所有属性。以下是样本或结果:
[692307] => Array
(
[weight] => 100
[attrs] => Array
(
[title] => xxx
[description] =>
[slug] => xxx
[thumb_url] => -
[thumb_width] => 533
[thumb_height] => 400
[is_vertical] => 0
[add_timestamp] =>
)
)
[692411] => Array
(
[weight] => 100
[attrs] => Array
(
[title] => yyy
[description] =>
[slug] => yyy
[thumb_url] => -
[thumb_width] => 563
[thumb_height] => 388
[is_vertical] => 0
[add_timestamp] =>
)
)
为什么我的测试属性(test、test2、test3)没有返回?您确定索引已经重新加载,它的posible
索引器构建了它,但是searchd
没有加载新索引。不知道如何建立索引,看看这是否可能。但检查pl\u pl\u searchd.log
应该会告诉您索引是否已被读取。从日志中可以看出,实际上索引并没有重建。我超出了索引限制大小(4gb)。。。